Spec-Zone .ru
спецификации, руководства, описания, API


javax.servlet.jsp.tagext
Class TagData

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagData
All Implemented Interfaces:
java.lang.Cloneable

public class TagData
extends java.lang.Object
implements java.lang.Cloneable

The (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.


Field Summary
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 TagData instances are used at translation-time).
 
Constructor Summary
TagData(java.util.Hashtable<java.lang.String,java.lang.Object> attrs)
          Constructor for a TagData.
TagData(java.lang.Object[][] atts)
          Constructor for TagData.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String attName)
          The value of the attribute.
 java.util.Enumeration<java.lang.String> getAttributes()
          Enumerates the attributes.
 java.lang.String getAttributeString(java.lang.String attName)
          Get the value for a given attribute.
 java.lang.String getId()
          The value of the tag's id attribute.
 void setAttribute(java.lang.String attName, java.lang.Object value)
          Set the value of an attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST_TIME_VALUE

public static final 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 TagData instances are used at translation-time).

Constructor Detail

TagData

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

Parameters:
atts - the static attribute and values. May be null.

TagData

public TagData(java.util.Hashtable<java.lang.String,java.lang.Object> 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.
Method Detail

getId

public java.lang.String getId()
The value of the tag's id attribute.

Returns:
the value of the tag's id attribute, or null if no such attribute was specified.

getAttribute

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.

Parameters:
attName - the name of the attribute
Returns:
the attribute's value

setAttribute

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

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

getAttributeString

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

Parameters:
attName - the name of the attribute
Returns:
the attribute value string
Throws:
java.lang.ClassCastException - if attribute value is not a String

getAttributes

public java.util.Enumeration<java.lang.String> getAttributes()
Enumerates the attributes.

Returns:
An enumeration of the attributes in a TagData


Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41

free hit counter