public Object value (Element node) { return node.getAttribute (name); } }
public UpdateSite(Document document) { this.document = document; this.dom = document.getRootElement(); if (dom.getAttribute("associateSitesURL") != null) { associateSitesUrl = dom.getAttributeValue("associateSitesURL"); } }
public UpdateSite(Document document) { this.document = document; this.dom = document.getRootElement(); if (dom.getAttribute("associateSitesURL") != null) { associateSitesUrl = dom.getAttributeValue("associateSitesURL"); } }
public Attribute getAttribute (String name, Namespace ns) { if (ns == null || ns.getPrefix ().length () == 0) return getAttribute (name); return getAttribute (ns.getPrefix ()+":"+name); }
@Override public List<? extends TargetDefinition.Location> getLocations() { ArrayList<TargetDefinition.Location> locations = new ArrayList<TargetDefinition.Location>(); Element locationsDom = dom.getChild("locations"); if (locationsDom != null) { for (Element locationDom : locationsDom.getChildren("location")) { String type = locationDom.getAttributeValue("type"); if ("InstallableUnit".equals(type)) locations.add(new IULocation(locationDom)); else locations.add(new OtherLocation(type, locationDom.getAttribute("path").getValue())); } } return Collections.unmodifiableList(locations); }
public String getAttributeValue (String name, Namespace ns) { Attribute a = getAttribute (name, ns); return a == null ? null : a.getValue (); }
public Element checkMandatoryAttribute (String name) { Attribute a = getAttribute (name); if (a == null) throw new XMLParseException ("Element "+getName ()+" has no attribute "+name); return this; }
public Object value (Element node) { if (null == node.getAttribute (name)) throw new MappingException ("Required attribute \""+name+"\" is missing: "+node); return delegate.value (node); } }
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; }