Tag getTag() { Tag option = new Tag("Option").addAttribute("label", label) .addAttribute("value", value); return option; }
private String getPath() { if (parent == null) return name; else return parent.getPath() + "/" + name; } }
/** * root/preferences/native/os */ public Collection<Tag> select(String path) { return select(path, null); }
public Tag toTag() { Tag top = new Tag("metadata"); if (modelVersion != null) top.addAttribute("modelVersion", modelVersion); new Tag(top, "groupId").addContent(group); new Tag(top, "artifactId").addContent(artifact); return top; }
public String findRecursiveAttribute(String name) { String value = getAttribute(name); if (value != null) return value; if (parent != null) return parent.findRecursiveAttribute(name); return null; }
/** * Construct a new Tag with a name and a set of attributes. The attributes * are given as ( name, value ) ... */ public Tag(String name, String[] attributes, Object... contents) { this(name, contents); for (int i = 0; i < attributes.length; i += 2) addAttribute(attributes[i], attributes[i + 1]); }
/** * Return the attribute value or a default if not defined. */ public String getAttribute(String key, String deflt) { String answer = getAttribute(key); return answer == null ? deflt : answer; }
public XMLResourceGenerator referral(URI reference, int depth) { Tag referall = new Tag(repository, "referral"); referall.addAttribute("url", reference); if (depth > 0) referall.addAttribute("depth", depth); return this; }
public String findRecursiveAttribute(String name) { String value = getAttribute(name); if (value != null) return value; if (parent != null) return parent.findRecursiveAttribute(name); return null; }
/** * Construct a new Tag with a name and a set of attributes. The attributes * are given as ( name, value ) ... */ public Tag(String name, String[] attributes, Object... contents) { this(name, contents); for (int i = 0; i < attributes.length; i += 2) addAttribute(attributes[i], attributes[i + 1]); }
/** * root/preferences/native/os */ public Collection<Tag> select(String path) { return select(path, (Tag) null); }
/** * Return the attribute value or a default if not defined. */ public String getAttribute(String key, String deflt) { String answer = getAttribute(key); return answer == null ? deflt : answer; }
Tag getTag() { Tag icon = new Tag("Icon").addAttribute("resource", resource) .addAttribute("size", size); return icon; }
public String findRecursiveAttribute(String name) { String value = getAttribute(name); if (value != null) return value; if (parent != null) return parent.findRecursiveAttribute(name); return null; }
/** * Construct a new Tag with a name and a set of attributes. The attributes * are given as ( name, value ) ... */ public Tag(String name, String[] attributes, Object... contents) { this(name, contents); for (int i = 0; i < attributes.length; i += 2) addAttribute(attributes[i], attributes[i + 1]); }
/** * root/preferences/native/os */ public Collection<Tag> select(String path) { return select(path, (Tag) null); }
/** * Return the attribute value or a default if not defined. */ public String getAttribute(String key, String deflt) { String answer = getAttribute(key); return answer == null ? deflt : answer; }
/** * Construct a new Tag with a name and a set of attributes. The attributes * are given as ( name, value ) ... */ public Tag(String name, String[] attributes, Object... contents) { this(name,contents); for (int i = 0; i < attributes.length; i += 2) addAttribute(attributes[i], attributes[i + 1]); }
/** * root/preferences/native/os */ public Collection<Tag> select(String path) { return select(path, null); }
/** * root/preferences/native/os */ public Collection<Tag> select(String path) { return select(path, (Tag) null); }