Class AttributeMap

    • Constructor Detail

      • AttributeMap

        public AttributeMap()
        Constructs an empty AttributeMap.
      • AttributeMap

        public AttributeMap​(Map<String,​Object> map)
        Copy constructor.
        Parameters:
        map - a Map to be copied
    • Method Detail

      • 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:
        Strings.escapeMarkup(CharSequence)