/** * 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]); }
/** * 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]); }
/** * 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]); }
/** * 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]); }
/** * 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]); }
/** * Note that calling {@link #name(String)} sets increment to * {@link System#currentTimeMillis()}. In order to retain backward * compatibility that is not change. Therefore, in order to specify a value * {@link #increment(long)} should be called after. * * @param increment * @return this */ public XMLResourceGenerator increment(long increment) { repository.addAttribute("increment", increment); return this; }
Tag getTag() { Tag icon = new Tag("Icon").addAttribute("resource", resource) .addAttribute("size", size); return icon; }
Tag getTag() { Tag option = new Tag("Option").addAttribute("label", label) .addAttribute("value", value); return option; }
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; }
Tag getTag() { Tag option = new Tag("Option").addAttribute("label", label) .addAttribute("value", value); return option; }
private void doCoverage(Tag report, Document doc, XPath xpath) throws XPathExpressionException { int bad = Integer.parseInt(xpath.evaluate("count(//method[count(ref)<2])", doc)); int all = Integer.parseInt(xpath.evaluate("count(//method)", doc)); report.addAttribute("coverage-bad", bad); report.addAttribute("coverage-all", all); }
Tag getTag() { Tag icon = new Tag("Icon").addAttribute("resource", resource) .addAttribute("size", size); return icon; }
public void addNamespaces(Tag tag) { for (Map.Entry<String, String> entry : namespaces.entrySet()) tag.addAttribute("xmlns:" + entry.getValue(), entry.getKey()); }
Tag getTag() { Tag designate = new Tag("Designate"); if (factory) { designate.addAttribute("factoryPid", pid); } else { designate.addAttribute("pid", pid); } new Tag(designate, "Object").addAttribute("ocdref", ocdRef); return designate; }
private void directives(Tag cr, Map<String, String> directives) { directives.entrySet() .forEach(e -> { Tag d = new Tag(cr, "directive"); d.addAttribute("name", e.getKey()); d.addAttribute("value", e.getValue()); }); }
private void directives(Tag cr, Map<String, String> directives) { directives.entrySet() .forEach(e -> { Tag d = new Tag(cr, "directive"); d.addAttribute("name", e.getKey()); d.addAttribute("value", e.getValue()); }); }
Tag getInnerTag(Namespaces namespaces) { Tag designate = new Tag("Designate"); if (factory) { designate.addAttribute("factoryPid", pid); } else { designate.addAttribute("pid", pid); } addAttributes(designate, namespaces); new Tag(designate, "Object").addAttribute("ocdref", ocdRef); return designate; }
Stream<Tag> propertiesTags(String element) { return properties.stream() .map(p -> new Tag(element).addAttribute("entry", p)); }
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; }
Tag getOuterTag() { Tag metadata = new Tag("metatype:MetaData").addAttribute("xmlns:metatype", MetatypeVersion.VERSION_1_3.getNamespace()); Namespaces namespaces = new Namespaces(); String xmlns = MetatypeVersion.VERSION_1_3.getNamespace(); namespaces.registerNamespace("metatype", xmlns); addNamespaces(namespaces, xmlns); namespaces.addNamespaces(metadata); metadata.addContent(getInnerTag(namespaces)); return metadata; }