public final void replaceAttributeValue(final Component component, final ComponentTag tag) { if (this.isEnabled(component)) { final IValueMap attributes = tag.getAttributes(); final Object replacementValue = this.getReplacementOrNull(component); if (AttributeModifier.VALUELESS_ATTRIBUTE_ADD == replacementValue) { attributes.put((Object) this.attribute, (Object) null); } else if (AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE == replacementValue) { attributes.remove((Object) this.attribute); } else { final String value = this.toStringOrNull(attributes.get((Object) this.attribute)); final String newValue = this.newValue(value, this.toStringOrNull(replacementValue)); if (newValue != null) { attributes.put((Object) this.attribute, (Object) newValue); } } } }
public final void onComponentTag(final Component component, final ComponentTag tag) { if (tag.getType() != XmlTag.TagType.CLOSE) { this.replaceAttributeValue(component, tag); } }