public Element addAttributes (Attribute... attributes) { for (Attribute node: attributes) addAttribute (node); return this; }
public Element addAttribute (String name, String value) { return addAttribute (new Attribute (name, value)); }
public void addArtifact(String classifier, String id, String version) { Element artifacts = iuDom.getChild(ARTIFACTS); if (artifacts == null) { artifacts = new Element(ARTIFACTS); iuDom.addNode(artifacts); } Element newArtifact = new Element(ARTIFACT); newArtifact.addAttribute(CLASSIFIER, classifier); newArtifact.addAttribute(ID, id); newArtifact.addAttribute(VERSION, version); artifacts.addNode(newArtifact); }
public void addArtifact(String classifier, String id, String version) { Element artifacts = iuDom.getChild(ARTIFACTS); if (artifacts == null) { artifacts = new Element(ARTIFACTS); iuDom.addNode(artifacts); } Element newArtifact = new Element(ARTIFACT); newArtifact.addAttribute(CLASSIFIER, classifier); newArtifact.addAttribute(ID, id); newArtifact.addAttribute(VERSION, version); artifacts.addNode(newArtifact); }
public Element copy (Node orig) { super.copy (orig); Element other = (Element)orig; if (other.attributeMap != null) { for (Attribute a: other.attributeMap.values ()) { addAttribute (a.copy ()); } } this.beginName = other.beginName; this.compactEmpty = other.compactEmpty; this.endName = other.endName; this.name = other.name; // Ignore parent this.postSpace = other.postSpace; this.startToken = other.startToken; return this; }
public void addSelfCapability() { Element provides = iuDom.getChild(PROVIDES); if (provides == null) { provides = new Element(PROVIDES); iuDom.addNode(provides); } Element newCapability = new Element(PROVIDED); newCapability.addAttribute(NAMESPACE, P2_IU_NAMESPACE); newCapability.addAttribute(NAME, getId()); newCapability.addAttribute(VERSION, getVersion()); provides.addNode(newCapability); }
public void addSelfCapability() { Element provides = iuDom.getChild(PROVIDES); if (provides == null) { provides = new Element(PROVIDES); iuDom.addNode(provides); } Element newCapability = new Element(PROVIDED); newCapability.addAttribute(NAMESPACE, P2_IU_NAMESPACE); newCapability.addAttribute(NAME, getId()); newCapability.addAttribute(VERSION, getVersion()); provides.addNode(newCapability); }
public Element setAttribute (Attribute a) { Attribute existing = getAttribute (a.getName ()); if (existing == null) addAttribute (a); else existing.copy (a); return this; }
public Element setAttribute (String name, String value, Namespace ns) { Attribute a = getAttribute (name, ns); if (a == null) { a = new Attribute (name, value, ns); addAttribute (a); } else { a.setValue (value); } return this; }
parent.addAttribute ((Attribute)toNode (token));