javax.servlet.jsp.tagext

Class TagData

Implemented Interfaces:
Cloneable

public class TagData
extends java.lang.Object
implements Cloneable

The (translation-time only) attribute/value information for a tag instance.

TagData is only used as an argument to the isValid and getVariableInfo methods of TagExtraInfo, which are invoked at translation time.

Field Summary

static Object
REQUEST_TIME_VALUE
Distinguished 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).

Constructor Summary

TagData(Hashtable attrs)
Constructor for a TagData.
TagData(atts[][] )
Constructor for TagData.

Method Summary

Object
getAttribute(String attName)
The value of the attribute.
String
getAttributeString(String attName)
Get the value for a given attribute.
java.util.Enumeration
getAttributes()
Enumerates the attributes.
String
getId()
The value of the id attribute, if available.
void
setAttribute(String attName, Object value)
Set the value of an attribute.

Field Details

REQUEST_TIME_VALUE

public static final Object REQUEST_TIME_VALUE
Distinguished 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).

Constructor Details

TagData

public TagData(Hashtable attrs)
Constructor for a TagData. If you already have the attributes in a hashtable, use this constructor.

Parameters:
attrs - A hashtable to get the values from.


TagData

public TagData(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.

Parameters:

Method Details

getAttribute

public Object getAttribute(String attName)
The value of the attribute. Returns the distinguished object REQUEST_TIME_VALUE if the value is request time. Returns null if the attribute is not set.

Returns:
the attribute's value object


getAttributeString

public String getAttributeString(String attName)
Get the value for a given attribute.

Returns:
the attribute value string


getAttributes

public java.util.Enumeration getAttributes()
Enumerates the attributes.

Returns:
An enumeration of the attributes in a TagData


getId

public String getId()
The value of the id attribute, if available.

Returns:
the value of the id attribute or null


setAttribute

public void setAttribute(String attName,
                         Object value)
Set the value of an attribute.

Parameters:
attName - the name of the attribute
value - the value.


Copyright © 1999-2001 The Apache Software Foundation. All Rights Reserved.