Example #1
0
 public CSpecExtension(
     ICSpecData base,
     Set<String> removedDependencies,
     Map<String, AlterDependency> alteredDependencies,
     Set<String> removedAttributes,
     Map<String, String> renamedAttributes,
     Map<String, AlterAttribute<? extends TopLevelAttribute>> alteredAttributes) {
   this.base = base;
   this.removedDependencies = Utils.createUnmodifiableSet(removedDependencies);
   this.removedAttributes = Utils.createUnmodifiableSet(removedAttributes);
   this.renamedAttributes = Utils.createUnmodifiableMap(renamedAttributes);
   this.alteredAttributes = Utils.createUnmodifiableMap(alteredAttributes);
   this.alteredDependencies = Utils.createUnmodifiableMap(alteredDependencies);
 }
Example #2
0
  /**
   * We will initialize file contents with a sample text.
   *
   * @throws SAXException
   */
  @Override
  protected InputStream openContentStream(String containerName, String fileName) {
    String name = containerName;
    int lastSlash = name.lastIndexOf('/');
    if (lastSlash >= 0) name = name.substring(lastSlash + 1);

    CSpecBuilder builder = new CSpecBuilder();
    builder.setName(name);
    builder.setComponentTypeID(INIT_COMPONENT_TYPE);
    builder.setVersion(Version.parseVersion(INIT_VERSION_STRING));

    CSpec cspec = new CSpec(builder);

    AccessibleByteArrayOutputStream bld = new AccessibleByteArrayOutputStream();
    try {
      Utils.serialize(cspec, bld);
    } catch (SAXException e) {
      throw new RuntimeException(
          Messages.cannot_create_a_new_buckminster_component_specification_file, e);
    }

    return bld.getInputStream();
  }
 protected DummyParser(IProperties<String> properties) throws SAXException {
   super(Utils.createXMLReader(false, true));
   this.properties = properties;
 }