Movatterモバイル変換


[0]ホーム

URL:


         


Class TagSupport

java.lang.Object  |  +--javax.servlet.jsp.tagext.TagSupport
All Implemented Interfaces:
IterationTag, java.io.Serializable,Tag
Direct Known Subclasses:
BodyTagSupport

public classTagSupport
extends java.lang.Object
implementsIterationTag, java.io.Serializable

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.

See Also:
Serialized Form

id
           
pageContext
           
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE,EVAL_PAGE,SKIP_BODY,SKIP_PAGE
 
TagSupport()
          Default constructor, all subclasses are required to define only a public constructor with the same signature, and to call the superclass constructor.
 
doAfterBody()
          Default processing for a body
doEndTag()
          Default processing of the end tag returning EVAL_PAGE.
doStartTag()
          Default processing of the start tag, returning SKIP_BODY.
findAncestorWithClass(Tag from, java.lang.Class klass)
          Find the instance of a given class type that is closest to a given instance.
getId()
          The value of the id attribute of this tag; or null.
getParent()
          The Tag instance most closely enclosing this tag instance.
getValue(java.lang.String k)
          Get a the value associated with a key.
getValues()
          Enumerate the values kept by this tag handler.
release()
          Release state.
removeValue(java.lang.String k)
          Remove a value associated with a key.
setId(java.lang.String id)
          Set the id attribute for this tag.
setPageContext(PageContext pageContext)
          Set the page context.
setParent(Tag t)
          Set the nesting tag of this tag.
setValue(java.lang.String k, java.lang.Object o)
          Associate a value with a String key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

id

protected java.lang.Stringid

pageContext

protectedPageContextpageContext

TagSupport

publicTagSupport()
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

public static finalTagfindAncestorWithClass(Tag from,                                              java.lang.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. 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.
klass - The subclass of Tag or interface to be matched

doStartTag

public intdoStartTag()               throwsJspException
Default processing of the start tag, returning SKIP_BODY.
Specified by:
doStartTag in interfaceTag
See Also:
Tag.doStartTag()

doEndTag

public intdoEndTag()             throwsJspException
Default processing of the end tag returning EVAL_PAGE.
Specified by:
doEndTag in interfaceTag
See Also:
Tag.doEndTag()

doAfterBody

public intdoAfterBody()                throwsJspException
Default processing for a body
Specified by:
doAfterBody in interfaceIterationTag
Returns:
SKIP_BODY
See Also:
IterationTag.doAfterBody()

release

public voidrelease()
Release state.
Specified by:
release in interfaceTag
See Also:
Tag.release()

setParent

public voidsetParent(Tag t)
Set the nesting tag of this tag.
Specified by:
setParent in interfaceTag
Parameters:
t - The parent Tag.
See Also:
Tag.setParent(Tag)

getParent

publicTaggetParent()
The Tag instance most closely enclosing this tag instance.
Specified by:
getParent in interfaceTag
See Also:
Tag.getParent()

setId

public voidsetId(java.lang.String id)
Set the id attribute for this tag.
Parameters:
id - The String for the id.

getId

public java.lang.StringgetId()
The value of the id attribute of this tag; or null.

setPageContext

public voidsetPageContext(PageContext pageContext)
Set the page context.
Specified by:
setPageContext in interfaceTag
Parameters:
pageContenxt - The PageContext.
See Also:
Tag.setPageContext(javax.servlet.jsp.PageContext)

setValue

public voidsetValue(java.lang.String k,                     java.lang.Object o)
Associate a value with a String key.
Parameters:
k - The key String.
o - The value to associate.

getValue

public java.lang.ObjectgetValue(java.lang.String k)
Get a the value associated with a key.
Parameters:
k - The string key.

removeValue

public voidremoveValue(java.lang.String k)
Remove a value associated with a key.
Parameters:
k - The string key.

getValues

public java.util.EnumerationgetValues()
Enumerate the values kept by this tag handler.

         


[8]ページ先頭

©2009-2025 Movatter.jp