public final String toString() { return getAttributeName().toString(); }
@Override protected final void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) { final String newAttributeValue = EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString()); // These attributes might be "removable if empty", in which case we would simply remove the target attributes... if (this.removeIfEmpty && (newAttributeValue == null || newAttributeValue.length() == 0)) { // We are removing the equivalent attribute name, without the prefix... structureHandler.removeAttribute(this.attributeOneDefinition.getAttributeName()); structureHandler.removeAttribute(this.attributeTwoDefinition.getAttributeName()); } else { // We are setting the equivalent attribute name, without the prefix... StandardProcessorUtils.setAttribute(structureHandler, this.attributeOneDefinition, this.attributeOneCompleteName, newAttributeValue); StandardProcessorUtils.setAttribute(structureHandler, this.attributeTwoDefinition, this.attributeTwoCompleteName, newAttributeValue); } }
@Override protected final void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) { if (EvaluationUtils.evaluateAsBoolean(expressionResult)) { StandardProcessorUtils.setAttribute(structureHandler, this.targetAttributeDefinition, this.targetAttributeCompleteName, this.targetAttributeCompleteName); } else { structureHandler.removeAttribute(this.targetAttributeDefinition.getAttributeName()); } }
@Override protected final void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) { String newAttributeValue = EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString()); // If we are not adding anything, we'll just leave it untouched if (newAttributeValue != null && newAttributeValue.length() > 0) { final AttributeName targetAttributeName = this.targetAttributeDefinition.getAttributeName(); if (tag.hasAttribute(targetAttributeName)) { final String currentValue = tag.getAttributeValue(targetAttributeName); if (currentValue.length() > 0) { newAttributeValue = currentValue + ' ' + newAttributeValue; } } StandardProcessorUtils.setAttribute(structureHandler, this.targetAttributeDefinition, TARGET_ATTR_NAME, newAttributeValue); } }
@Override protected final void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) { String newAttributeValue = EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString()); // If we are not adding anything, we'll just leave it untouched if (newAttributeValue != null && newAttributeValue.length() > 0) { final AttributeName targetAttributeName = this.targetAttributeDefinition.getAttributeName(); if (tag.hasAttribute(targetAttributeName)) { final String currentValue = tag.getAttributeValue(targetAttributeName); if (currentValue.length() > 0) { newAttributeValue = currentValue + ' ' + newAttributeValue; } } StandardProcessorUtils.setAttribute(structureHandler, this.targetAttributeDefinition, TARGET_ATTR_NAME, newAttributeValue); } }
protected void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) { final String newAttributeValue = EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString()); // These attributes are "removable if empty", so we simply remove the target attribute... if (newAttributeValue == null || newAttributeValue.length() == 0) { // We are removing the equivalent attribute name, without the prefix... structureHandler.removeAttribute(this.targetAttributeDefinition.getAttributeName()); structureHandler.removeAttribute(attributeName); } else { // We are setting the equivalent attribute name, without the prefix... StandardProcessorUtils.replaceAttribute( structureHandler, attributeName, this.targetAttributeDefinition, this.targetAttrCompleteName, (newAttributeValue == null ? "" : newAttributeValue)); } }
@Override protected final void doProcess( final ITemplateContext context, final IProcessableElementTag tag, final AttributeName attributeName, final String attributeValue, final Object expressionResult, final IElementTagStructureHandler structureHandler) { final String newAttributeValue = EscapedAttributeUtils.escapeAttribute(getTemplateMode(), expressionResult == null ? null : expressionResult.toString()); // These attributes might be "removable if empty", in which case we would simply remove the target attribute... if (this.removeIfEmpty && (newAttributeValue == null || newAttributeValue.length() == 0)) { // We are removing the equivalent attribute name, without the prefix... structureHandler.removeAttribute(this.targetAttributeDefinition.getAttributeName()); structureHandler.removeAttribute(attributeName); } else { // We are setting the equivalent attribute name, without the prefix... StandardProcessorUtils.replaceAttribute( structureHandler, attributeName, this.targetAttributeDefinition, this.targetAttrCompleteName, (newAttributeValue == null ? "" : newAttributeValue)); } }
public void process( final ITemplateContext context, final IProcessableElementTag tag, final IElementTagStructureHandler structureHandler) { final TemplateMode templateMode = getTemplateMode(); final IAttribute[] attributes = tag.getAllAttributes(); // Should be no problem in performing modifications during iteration, as the attributeNames list // should not be affected by modifications on the original tag attribute set for (final IAttribute attribute : attributes) { final AttributeName attributeName = attribute.getAttributeDefinition().getAttributeName(); if (attributeName.isPrefixed()) { if (TextUtil.equals(templateMode.isCaseSensitive(), attributeName.getPrefix(), this.dialectPrefix)) { // We will process each 'default' attribute separately processDefaultAttribute(getTemplateMode(), context, tag, attribute, structureHandler); } } } }
final AttributeName attributeName = attribute.getAttributeDefinition().getAttributeName(); final String attributeValue = EscapedAttributeUtils.unescapeAttribute(context.getTemplateMode(), attribute.getValue());
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
private final boolean isDisabled(final IProcessableElementTag tag) { // Disabled = attribute "disabled" exists return tag.hasAttribute(this.disabledAttributeDefinition.getAttributeName()); }
@Override public void process(ITemplateContext context, IProcessableElementTag tag, IElementTagStructureHandler structureHandler) { TemplateMode templateMode = getTemplateMode(); IAttribute[] attributes = tag.getAllAttributes(); for (IAttribute attribute : attributes) { AttributeName attributeName = attribute.getAttributeDefinition().getAttributeName(); if (attributeName.isPrefixed()) { if (TextUtil.equals(templateMode.isCaseSensitive(), attributeName.getPrefix(), dialectPrefix)) { processDataAttribute(context, tag, attribute, structureHandler); } } } }
@Override public void process(ITemplateContext context, IProcessableElementTag tag, IElementTagStructureHandler structureHandler) { TemplateMode templateMode = getTemplateMode(); IAttribute[] attributes = tag.getAllAttributes(); for (IAttribute attribute : attributes) { AttributeName attributeName = attribute.getAttributeDefinition().getAttributeName(); if (attributeName.isPrefixed()) { if (TextUtil.equals(templateMode.isCaseSensitive(), attributeName.getPrefix(), dialectPrefix)) { processDataAttribute(context, tag, attribute, structureHandler); } } } }