public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinition of the target attribute in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.targetAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, TARGET_ATTR_NAME); }
final AttributeDefinitions attributeDefinitions = new AttributeDefinitions(elementProcessorsByTemplateMode);
for (final String attributeNameStr : ALL_STANDARD_HTML_ATTRIBUTE_NAMES) { standardHTMLAttributeDefinitions.add( buildHTMLAttributeDefinition( AttributeNames.forHTMLName(attributeNameStr), elementProcessorsByTemplateMode.get(TemplateMode.HTML)));
public AttributeDefinition forName(final TemplateMode templateMode, final String attributeName) { if (templateMode == null) { throw new IllegalArgumentException("Template Mode cannot be null"); } switch (templateMode) { case HTML: return forHTMLName(attributeName); case XML: return forXMLName(attributeName); case TEXT: return forTextName(attributeName); case JAVASCRIPT: return forJavaScriptName(attributeName); case CSS: return forCSSName(attributeName); case RAW: throw new IllegalArgumentException("Attribute Definitions cannot be obtained for " + templateMode + " template mode "); default: throw new IllegalArgumentException("Unknown template mode " + templateMode); } }
public AttributeDefinition forName(final TemplateMode templateMode, final String prefix, final String attributeName) { if (templateMode == null) { throw new IllegalArgumentException("Template Mode cannot be null"); } switch (templateMode) { case HTML: return forHTMLName(prefix, attributeName); case XML: return forXMLName(prefix, attributeName); case TEXT: return forTextName(prefix, attributeName); case JAVASCRIPT: return forJavaScriptName(prefix, attributeName); case CSS: return forCSSName(prefix, attributeName); case RAW: throw new IllegalArgumentException("Attribute Definitions cannot be obtained for " + templateMode + " template mode "); default: throw new IllegalArgumentException("Unknown template mode " + templateMode); } }
private Attribute buildAttribute(final String name, final String value, final AttributeValueQuotes quotes) { final AttributeDefinition attributeDefinition = this.attributeDefinitions.forName(this.templateMode, name); return new Attribute(attributeDefinition, name, Attribute.DEFAULT_OPERATOR, value, quotes, null, -1, -1); }
public AttributeDefinition forName(final TemplateMode templateMode, final char[] attributeName, final int attributeNameOffset, final int attributeNameLen) { if (templateMode == null) { throw new IllegalArgumentException("Template Mode cannot be null"); } switch (templateMode) { case HTML: return forHTMLName(attributeName, attributeNameOffset, attributeNameLen); case XML: return forXMLName(attributeName, attributeNameOffset, attributeNameLen); case TEXT: return forTextName(attributeName, attributeNameOffset, attributeNameLen); case JAVASCRIPT: return forJavaScriptName(attributeName, attributeNameOffset, attributeNameLen); case CSS: return forCSSName(attributeName, attributeNameOffset, attributeNameLen); case RAW: throw new IllegalArgumentException("Attribute Definitions cannot be obtained for " + templateMode + " template mode "); default: throw new IllegalArgumentException("Unknown template mode " + templateMode); } }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinition of the target attribute in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.targetAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, this.targetAttributeCompleteName); }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinition of the target attribute in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.targetAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, TARGET_ATTR_NAME); }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinitions of the target attributes in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.attributeOneDefinition = attributeDefinitions.forName(getTemplateMode(), this.attributeOneCompleteName); this.attributeTwoDefinition = attributeDefinitions.forName(getTemplateMode(), this.attributeTwoCompleteName); }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinition of the target attribute in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.targetAttributeDefinition = attributeDefinitions.forName(getTemplateMode(), this.targetAttrCompleteName); }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinition of the target attribute in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.targetAttributeDefinition = attributeDefinitions.forName(getTemplateMode(), this.targetAttrCompleteName); }
final AttributeDefinition attributeDefinition = this.attributeDefinitions.forName(this.templateMode, attributeName);
final AttributeDefinition attributeDefinition = this.attributeDefinitions.forName(this.templateMode, attributeName);
(attributeDefinition != null ? attributeDefinition : attributeDefinitions.forName(templateMode, completeName));
(newAttributeDefinition != null ? newAttributeDefinition : attributeDefinitions.forName(templateMode, newCompleteName));
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinitions in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.discriminatorAttributeDefinition = (this.discriminatorAttrName != null? attributeDefinitions.forName(TEMPLATE_MODE, this.discriminatorAttrName) : null); this.idAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, ID_ATTR_NAME); this.typeAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, TYPE_ATTR_NAME); this.nameAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, NAME_ATTR_NAME); this.valueAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, VALUE_ATTR_NAME); this.checkedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, CHECKED_ATTR_NAME); this.selectedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, SELECTED_ATTR_NAME); this.disabledAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, DISABLED_ATTR_NAME); this.multipleAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, MULTIPLE_ATTR_NAME); }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinitions in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.discriminatorAttributeDefinition = (this.discriminatorAttrName != null? attributeDefinitions.forName(TEMPLATE_MODE, this.discriminatorAttrName) : null); this.idAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, ID_ATTR_NAME); this.typeAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, TYPE_ATTR_NAME); this.nameAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, NAME_ATTR_NAME); this.valueAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, VALUE_ATTR_NAME); this.checkedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, CHECKED_ATTR_NAME); this.selectedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, SELECTED_ATTR_NAME); this.disabledAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, DISABLED_ATTR_NAME); this.multipleAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, MULTIPLE_ATTR_NAME); }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinitions in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.discriminatorAttributeDefinition = (this.discriminatorAttrName != null? attributeDefinitions.forName(TEMPLATE_MODE, this.discriminatorAttrName) : null); this.idAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, ID_ATTR_NAME); this.typeAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, TYPE_ATTR_NAME); this.nameAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, NAME_ATTR_NAME); this.valueAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, VALUE_ATTR_NAME); this.checkedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, CHECKED_ATTR_NAME); this.selectedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, SELECTED_ATTR_NAME); this.disabledAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, DISABLED_ATTR_NAME); this.multipleAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, MULTIPLE_ATTR_NAME); }
public void setAttributeDefinitions(final AttributeDefinitions attributeDefinitions) { Validate.notNull(attributeDefinitions, "Attribute Definitions cannot be null"); // We precompute the AttributeDefinitions in order to being able to use much // faster methods for setting/replacing attributes on the ElementAttributes implementation this.discriminatorAttributeDefinition = (this.discriminatorAttrName != null? attributeDefinitions.forName(TEMPLATE_MODE, this.discriminatorAttrName) : null); this.idAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, ID_ATTR_NAME); this.typeAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, TYPE_ATTR_NAME); this.nameAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, NAME_ATTR_NAME); this.valueAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, VALUE_ATTR_NAME); this.checkedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, CHECKED_ATTR_NAME); this.selectedAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, SELECTED_ATTR_NAME); this.disabledAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, DISABLED_ATTR_NAME); this.multipleAttributeDefinition = attributeDefinitions.forName(TEMPLATE_MODE, MULTIPLE_ATTR_NAME); }