TagDatapublic class TagData extends Object implements CloneableThe (translation-time only) attribute/value information for a tag instance.
TagData is only used as an argument to the isValid, validate, and
getVariableInfo methods of TagExtraInfo, which are invoked at
translation time. |
Fields Summary |
---|
public static final Object | REQUEST_TIME_VALUEDistinguished value for an attribute to indicate its value
is a request-time expression (which is not yet available because
TagData instances are used at translation-time). | private Hashtable | attributes |
Constructors Summary |
---|
public TagData(Object[] atts)Constructor for TagData.
A typical constructor may be
static final Object[][] att = {{"connection", "conn0"}, {"id", "query0"}};
static final TagData td = new TagData(att);
All values must be Strings except for those holding the
distinguished object REQUEST_TIME_VALUE.
if (atts == null) {
attributes = new Hashtable<String, Object>();
} else {
attributes = new Hashtable<String, Object>(atts.length);
}
if (atts != null) {
for (int i = 0; i < atts.length; i++) {
attributes.put((String)atts[i][0], atts[i][1]);
}
}
| public TagData(Hashtable attrs)Constructor for a TagData.
If you already have the attributes in a hashtable, use this
constructor.
this.attributes = attrs;
|
Methods Summary |
---|
public java.lang.Object | getAttribute(java.lang.String attName)The value of the attribute.
If a static value is specified for an attribute that accepts a
request-time attribute expression then that static value is returned,
even if the value is provided in the body of a <jsp:attribute> action.
The distinguished object REQUEST_TIME_VALUE is only returned if
the value is specified as a request-time attribute expression
or via the <jsp:attribute> action with a body that contains
dynamic content (scriptlets, scripting expressions, EL expressions,
standard actions, or custom actions). Returns null if the attribute
is not set.
return attributes.get(attName);
| public java.lang.String | getAttributeString(java.lang.String attName)Get the value for a given attribute.
Object o = attributes.get(attName);
if (o == null) {
return null;
} else {
return (String) o;
}
| public java.util.Enumeration | getAttributes()Enumerates the attributes.
return attributes.keys();
| public java.lang.String | getId()The value of the tag's id attribute.
return getAttributeString(TagAttributeInfo.ID);
| public void | setAttribute(java.lang.String attName, java.lang.Object value)Set the value of an attribute.
attributes.put(attName, value);
|
|