Class AttributeMap

All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, IValueMap

public final class AttributeMap extends ValueMap
Map of values, extending ValueMap with methods for generating (HTML) markup attributes.
Since:
1.2.6
Author:
Eelco Hillenius
See Also:
  • Constructor Details

  • Method Details

    • putAttribute

      public boolean putAttribute(String key, boolean value)
      Put a boolean attribute, removing it if value is false or using the key as value otherwise, i.e. value="value".
      Parameters:
      key - key of attribute
      value -
      Returns:
      previous value
    • putAttribute

      public String putAttribute(String key, CharSequence value)
      Put a string attribute, removing it if the string is empty (nor null).
      Parameters:
      key - key of attribute
      value -
      Returns:
      previous value
    • toString

      public String toString()
      Representation as encoded markup attributes.
      Overrides:
      toString in class ValueMap
      Returns:
      String representation of this ValueMap consistent with the tag-attribute style of markup elements. For example: a="x" b="y" c="z".
      See Also:
    • toCharSequence

      Representation as encoded markup attributes.
      See Also: