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