private Attribute[] buildAttributeArray(final Map<String,String> attributes, final AttributeValueQuotes quotes) { if (attributes == null || attributes.size() == 0) { return Attributes.EMPTY_ATTRIBUTE_ARRAY; } int i = 0; final Attribute[] newAttributes = new Attribute[attributes.size()]; for (final Map.Entry<String,String> attributesEntry : attributes.entrySet()) { newAttributes[i++] = buildAttribute(attributesEntry.getKey(), attributesEntry.getValue(), quotes); } return newAttributes; }
@Override public IStandaloneElementTag createStandaloneElementTag(final String elementName, final String attributeName, final String attributeValue, final boolean synthetic, final boolean minimized) { final ElementDefinition elementDefinition = this.elementDefinitions.forName(this.templateMode, elementName); final Attributes attributes = buildAttributes(new Attribute[] { buildAttribute(attributeName, attributeValue, null) }); return new StandaloneElementTag(this.templateMode, elementDefinition, elementName, attributes, synthetic, minimized); }
@Override public IOpenElementTag createOpenElementTag(final String elementName, final String attributeName, final String attributeValue, final boolean synthetic) { final ElementDefinition elementDefinition = this.elementDefinitions.forName(this.templateMode, elementName); final Attributes attributes = buildAttributes(new Attribute[] { buildAttribute(attributeName, attributeValue, null) }); return new OpenElementTag(this.templateMode, elementDefinition, elementName, attributes, synthetic); }