Class AttributeMap
java.lang.Object
org.pentaho.reporting.libraries.xmlns.common.AttributeMap
- All Implemented Interfaces:
Serializable, Cloneable
A attribute map holding <namspace;name>-value pairs.
- Author:
- Thomas Morgner
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AttributeMap(AttributeMap copy) Creates a new attibute map using the given parameter as source for the initial values. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a copy of this map.getAttribute(String namespace, String attribute) Returns the attribute value for the given namespace and attribute-name.getAttributes(String namespace) Returns all attributes of the given namespace as unmodifable map.getFirstAttribute(String attribute) Looks up all namespaces and returns the value from the first namespace that has this attribute defined.String[]Returns all names for the given namespace that have values in this map.String[]Returns all namespaces that have values in this map.setAttribute(String namespace, String attribute, Object value) Defines the attribute for the given namespace and attribute name.
-
Constructor Details
-
AttributeMap
public AttributeMap()Default constructor. -
AttributeMap
Creates a new attibute map using the given parameter as source for the initial values.- Parameters:
copy- the attribute map that should be copied.
-
-
Method Details
-
clone
-
setAttribute
Defines the attribute for the given namespace and attribute name.- Parameters:
namespace- the namespace under which the value should be stored.attribute- the attribute name under which the value should be stored within the namespace.value- the value.- Returns:
- the previously stored value at that position.
-
getAttribute
-
getFirstAttribute
Looks up all namespaces and returns the value from the first namespace that has this attribute defined. As the order of the namespaces is not defined, this returns a random value and the namespace used is undefined if more than one namespace contains the same attribute.- Parameters:
attribute- the the attribute name.- Returns:
- the object from the first namespace that carries this attribute or null, if none of the namespaces has such an attribute defined.
-
getAttributes
-
getNames
-
getNameSpaces
Returns all namespaces that have values in this map.- Returns:
- the namespaces stored in this map.
-