javax.servlet.jsp.tagext

Class TagData

Implemented Interfaces:
Cloneable

public class TagData
extends java.lang.Object
implements 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

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 this TagData instance is being used at translation-time.

Constructor Summary

TagData(Hashtable attrs)
Constructor for a TagData If you already have the attributes in a hashtable, use this constructor.
TagData(atts[][] )
Constructor for a TagData For simplicity and speed, we are just using primitive types.

Method Summary

Object
getAttribute(String attName)
String
getAttributeString(String attName)
java.util.Enumeration
getAttributes()
Enumerates the attributes
String
getId()
void
setAttribute(String attName, Object value)
Set the value of this attribute to be

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 this TagData instance is being 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.


TagData

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

Method Details

getAttribute

public Object getAttribute(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.


getAttributeString

public String getAttributeString(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


getId

public String getId()

Returns:
the value of the id attribute or null


setAttribute

public void setAttribute(String attName,
                         Object value)
Set the value of this attribute to be


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