|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagAdapter
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.
Field Summary |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
TagAdapter(SimpleTag adaptee)
Creates a new TagAdapter that wraps the given SimpleTag and returns the parent tag when getParent() is called. |
Method Summary | |
int |
doEndTag()
Must not be called. |
int |
doStartTag()
Must not be called. |
JspTag |
getAdaptee()
Gets the tag that is being adapted to the Tag interface. |
Tag |
getParent()
Returns the parent of this tag, which is always getAdaptee().getParent(). |
void |
release()
Must not be called. |
void |
setPageContext(PageContext pc)
Must not be called. |
void |
setParent(Tag parentTag)
Must not be called. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TagAdapter(SimpleTag adaptee)
adaptee
- The SimpleTag being adapted as a Tag.Method Detail |
public void setPageContext(PageContext pc)
setPageContext
in interface Tag
pc
- ignored.
java.lang.UnsupportedOperationException
- Must not be calledpublic void setParent(Tag parentTag)
setParent
in interface Tag
parentTag
- ignored.
java.lang.UnsupportedOperationException
- Must not be called.public Tag getParent()
getParent
in interface Tag
TagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.Tag, java.lang.Class)
public JspTag getAdaptee()
public int doStartTag() throws JspException
doStartTag
in interface Tag
java.lang.UnsupportedOperationException
- Must not be called
JspException
- never thrownBodyTag
public int doEndTag() throws JspException
doEndTag
in interface Tag
java.lang.UnsupportedOperationException
- Must not be called
JspException
- never thrownpublic void release()
release
in interface Tag
java.lang.UnsupportedOperationException
- Must not be called
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |