java.lang.Object
com.aoapps.taglib.MutableGlobalAttributes
- All Implemented Interfaces:
Freezable<GlobalAttributes>,GlobalAttributes
public class MutableGlobalAttributes
extends Object
implements GlobalAttributes, Freezable<GlobalAttributes>
Builder for
GlobalAttributes instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds the data with the provided HTML attribute name and value, replacing any attribute that already exists.Adds all the data with the provided HTML attribute names and values, replacing any attributes that already exist.freeze()Gets an immutable, thread-safe instance.getClazz()Getter required.getData()Gets the HTML data attributes or an empty map when there are none.getDir()getId()getStyle()removeData(Iterable<String> attrNames) Removes the data with the provided HTML attribute names.removeData(String attrName) Removes the data with the provided HTML attribute name.Replaces all the data with the provided HTML attribute names and values.
-
Constructor Details
-
MutableGlobalAttributes
public MutableGlobalAttributes() -
MutableGlobalAttributes
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceGlobalAttributes
-
setId
-
getClazz
Description copied from interface:GlobalAttributesGetter required. Because without it, we get the exception:Unable to find setter method for attribute: class
- Specified by:
getClazzin interfaceGlobalAttributes
-
setClazz
-
getData
Description copied from interface:GlobalAttributesGets the HTML data attributes or an empty map when there are none.- Specified by:
getDatain interfaceGlobalAttributes
-
setData
Replaces all the data with the provided HTML attribute names and values. Entries will anullvalue are not added.- Throws:
IllegalArgumentException- WhenattrNameis not valid- See Also:
-
addData
Adds all the data with the provided HTML attribute names and values, replacing any attributes that already exist. Entries with anullvalue will remove any existing attribute.- Throws:
IllegalArgumentException- WhenattrNameis not valid
-
addData
public MutableGlobalAttributes addData(String attrName, Object value) throws IllegalArgumentException Adds the data with the provided HTML attribute name and value, replacing any attribute that already exists. When value isnull, will remove an existing attribute.- Throws:
IllegalArgumentException- WhenattrNameis not valid- See Also:
-
removeData
Removes the data with the provided HTML attribute names. -
removeData
Removes the data with the provided HTML attribute name. -
getDir
- Specified by:
getDirin interfaceGlobalAttributes
-
setDir
- Throws:
IllegalArgumentException
-
getStyle
- Specified by:
getStylein interfaceGlobalAttributes
-
setStyle
-
freeze
Gets an immutable, thread-safe instance.- Specified by:
freezein interfaceFreezable<GlobalAttributes>- Returns:
- The instance or
ImmutableGlobalAttributes.EMPTYwhen empty. - See Also:
-
