| |
|
| java.lang.Object javax.servlet.jsp.tagext.TagSupport
All known Subclasses: javax.servlet.jsp.tagext.BodyTagSupport,
TagSupport | public class TagSupport implements IterationTag,Serializable(Code) | | A base class for defining new tag handlers implementing Tag.
The TagSupport class is a utility class intended to be used as
the base class for new tag handlers. The TagSupport class
implements the Tag and IterationTag interfaces and adds additional
convenience methods including getter methods for the properties in
Tag. TagSupport has one static method that is included to
facilitate coordination among cooperating tags.
Many tag handlers will extend TagSupport and only redefine a
few methods.
|
Constructor Summary | |
public | TagSupport() Default constructor, all subclasses are required to define only
a public constructor with the same signature, and to call the
superclass constructor. |
Method Summary | |
public int | doAfterBody() Default processing for a body. | public int | doEndTag() Default processing of the end tag returning EVAL_PAGE. | public int | doStartTag() Default processing of the start tag, returning SKIP_BODY. | final public static Tag | findAncestorWithClass(Tag from, Class klass) Find the instance of a given class type that is closest to a given
instance.
This method uses the getParent method from the Tag
interface.
This method is used for coordination among cooperating tags.
The current version of the specification only provides one formal
way of indicating the observable type of a tag handler: its
tag handler implementation class, described in the tag-class
subelement of the tag element. | public String | getId() The value of the id attribute of this tag; or null. | public Tag | getParent() The Tag instance most closely enclosing this tag instance. | public Object | getValue(String k) Get a the value associated with a key.
Parameters: k - The string key. | public Enumeration | getValues() Enumerate the keys for the values kept by this tag handler. | public void | release() Release state. | public void | removeValue(String k) Remove a value associated with a key. | public void | setId(String id) Set the id attribute for this tag. | public void | setPageContext(PageContext pageContext) Set the page context. | public void | setParent(Tag t) Set the nesting tag of this tag. | public void | setValue(String k, Object o) Associate a value with a String key. |
id | protected String id(Code) | | The value of the id attribute of this tag; or null.
|
TagSupport | public TagSupport()(Code) | | Default constructor, all subclasses are required to define only
a public constructor with the same signature, and to call the
superclass constructor.
This constructor is called by the code generated by the JSP
translator.
|
findAncestorWithClass | final public static Tag findAncestorWithClass(Tag from, Class klass)(Code) | | Find the instance of a given class type that is closest to a given
instance.
This method uses the getParent method from the Tag
interface.
This method is used for coordination among cooperating tags.
The current version of the specification only provides one formal
way of indicating the observable type of a tag handler: its
tag handler implementation class, described in the tag-class
subelement of the tag element. This is extended in an
informal manner by allowing the tag library author to
indicate in the description subelement an observable type.
The type should be a subtype of the tag handler implementation
class or void.
This addititional constraint can be exploited by a
specialized container that knows about that specific tag library,
as in the case of the JSP standard tag library.
When a tag library author provides information on the
observable type of a tag handler, client programmatic code
should adhere to that constraint. Specifically, the Class
passed to findAncestorWithClass should be a subtype of the
observable type.
Parameters: from - The instance from where to start looking. Parameters: klass - The subclass of Tag or interface to be matched the nearest ancestor that implements the interfaceor is an instance of the class specified |
getId | public String getId()(Code) | | The value of the id attribute of this tag; or null.
the value of the id attribute, or null |
getParent | public Tag getParent()(Code) | | The Tag instance most closely enclosing this tag instance.
See Also: Tag.getParent the parent tag instance or null |
getValue | public Object getValue(String k)(Code) | | Get a the value associated with a key.
Parameters: k - The string key. The value associated with the key, or null. |
getValues | public Enumeration getValues()(Code) | | Enumerate the keys for the values kept by this tag handler.
An enumeration of all the keys for the values set,or null or an empty Enumeration if no values have been set. |
removeValue | public void removeValue(String k)(Code) | | Remove a value associated with a key.
Parameters: k - The string key. |
setId | public void setId(String id)(Code) | | Set the id attribute for this tag.
Parameters: id - The String for the id. |
setParent | public void setParent(Tag t)(Code) | | Set the nesting tag of this tag.
Parameters: t - The parent Tag. See Also: Tag.setParent(Tag) |
setValue | public void setValue(String k, Object o)(Code) | | Associate a value with a String key.
Parameters: k - The key String. Parameters: o - The value to associate. |
|
|
|