Package javax.servlet.jsp.tagext
Class TagData
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagData
-
- All Implemented Interfaces:
java.lang.Cloneable
public class TagData extends java.lang.Object implements java.lang.Cloneable
Tag instance attribute(s)/value(s); often this data is fully static in the case where none of the attributes have runtime expresssions as their values. Thus this class is intended to expose an immutable interface to a set of immutable attribute/value pairs. This class is cloneable so implementations can create a static instance and then just clone it before adding the request-time expressions.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Object
REQUEST_TIME_VALUE
Distinguished value for an attribute to indicate its value is a request-time expression which is not yet available because this TagData instance is being used at translation-time.
-
Constructor Summary
Constructors Constructor Description TagData(java.lang.Object[][] atts)
Constructor for a TagData For simplicity and speed, we are just using primitive types.TagData(java.util.Hashtable attrs)
Constructor for a TagData If you already have the attributes in a hashtable, use this constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getAttribute(java.lang.String attName)
java.util.Enumeration
getAttributes()
Enumerates the attributesjava.lang.String
getAttributeString(java.lang.String attName)
java.lang.String
getId()
void
setAttribute(java.lang.String attName, java.lang.Object value)
Set the value of this attribute to be
-
-
-
Constructor Detail
-
TagData
public TagData(java.lang.Object[][] atts)
Constructor for a TagData For simplicity and speed, we are just using primitive types. A typical constructor may be static final Object[][] att = {{"connection", "conn0"}, {"id", "query0"}}; static final TagData td = new TagData(att); In an implementation that uses the clonable approach sketched above all values must be Strings except for those holding the distinguished object REQUEST_TIME_VALUE.- Parameters:
atts
- the static attribute and values. May be null.
-
TagData
public TagData(java.util.Hashtable attrs)
Constructor for a TagData If you already have the attributes in a hashtable, use this constructor.
-
-
Method Detail
-
getId
public java.lang.String getId()
- Returns:
- the value of the id attribute or null
-
getAttribute
public java.lang.Object getAttribute(java.lang.String attName)
- Returns:
- the attribute's value object. Returns the distinguished object REQUEST_TIME_VALUE if the value is request time and we are using TagData at translation time. Returns null if the attribute is not set.
-
setAttribute
public void setAttribute(java.lang.String attName, java.lang.Object value)
Set the value of this attribute to be
-
getAttributeString
public java.lang.String getAttributeString(java.lang.String attName)
- Returns:
- the attribute value string
-
getAttributes
public java.util.Enumeration getAttributes()
Enumerates the attributes- Returns:
- An enumeration of the attributes in a TagData
-
-