Home » apache-tomcat-6.0.26-src » javax » servlet » jsp » tagext » [javadoc | source]
javax.servlet.jsp.tagext
public class: TagAdapter [javadoc | source]
java.lang.Object
   javax.servlet.jsp.tagext.TagAdapter

All Implemented Interfaces:
    Tag

Wraps any SimpleTag and exposes it using a Tag interface. This is used to allow collaboration between classic Tag handlers and SimpleTag handlers.

Because SimpleTag does not extend Tag, and because Tag.setParent() only accepts a Tag instance, a classic tag handler (one that implements Tag) cannot have a SimpleTag as its parent. To remedy this, a TagAdapter is created to wrap the SimpleTag parent, and the adapter is passed to setParent() instead. A classic Tag Handler can call getAdaptee() to retrieve the encapsulated SimpleTag instance.

Constructor:
 public TagAdapter(SimpleTag adaptee) 
    Creates a new TagAdapter that wraps the given SimpleTag and returns the parent tag when getParent() is called.
    Parameters:
    adaptee - The SimpleTag being adapted as a Tag.
Method from javax.servlet.jsp.tagext.TagAdapter Summary:
doEndTag,   doStartTag,   getAdaptee,   getParent,   release,   setPageContext,   setParent
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.servlet.jsp.tagext.TagAdapter Detail:
 public int doEndTag() throws JspException 
    Must not be called.
 public int doStartTag() throws JspException 
    Must not be called.
 public JspTag getAdaptee() 
    Gets the tag that is being adapted to the Tag interface. This should be an instance of SimpleTag in JSP 2.0, but room is left for other kinds of tags in future spec versions.
 public Tag getParent() 
    Returns the parent of this tag, which is always getAdaptee().getParent(). This will either be the enclosing Tag (if getAdaptee().getParent() implements Tag), or an adapter to the enclosing Tag (if getAdaptee().getParent() does not implement Tag).
 public  void release() 
    Must not be called.
 public  void setPageContext(PageContext pc) 
    Must not be called.
 public  void setParent(Tag parentTag) 
    Must not be called. The parent of this tag is always getAdaptee().getParent().