net.sourceforge.stripes.tag
Class StripesTagSupport

java.lang.Object
  extended by net.sourceforge.stripes.tag.StripesTagSupport
All Implemented Interfaces:
JspTag, Tag
Direct Known Subclasses:
HtmlTagSupport, UseActionBeanTag, WizardFieldsTag

public abstract class StripesTagSupport
extends Object
implements Tag

A very basic implementation of the Tag interface that is similar in manner to the standard TagSupport class, but with less clutter.

Author:
Tim Fennell

Field Summary
protected  PageContext pageContext
          Storage for a PageContext during evaluation.
protected  Tag parentTag
          Storage for the parent tag of this tag.
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
StripesTagSupport()
           
 
Method Summary
abstract  int doEndTag()
          Abstract method from the Tag interface.
abstract  int doStartTag()
          Abstract method from the Tag interface.
 PageContext getPageContext()
          Retrieves the pageContext handed to the tag by the container.
 Tag getParent()
          From the Tag interface - allows fetching the parent tag on the JSP.
protected
<T extends Tag>
T
getParentTag(Class<T> tagType)
          Locates the enclosing tag of the type supplied.
 void release()
          No-op implementation of release().
 void setPageContext(PageContext pageContext)
          Called by the Servlet container to set the page context on the tag.
 void setParent(Tag tag)
          From the Tag interface - allows the container to set the parent tag on the JSP.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageContext

protected PageContext pageContext
Storage for a PageContext during evaluation.


parentTag

protected Tag parentTag
Storage for the parent tag of this tag.

Constructor Detail

StripesTagSupport

public StripesTagSupport()
Method Detail

setPageContext

public void setPageContext(PageContext pageContext)
Called by the Servlet container to set the page context on the tag.

Specified by:
setPageContext in interface Tag

getPageContext

public PageContext getPageContext()
Retrieves the pageContext handed to the tag by the container.


setParent

public void setParent(Tag tag)
From the Tag interface - allows the container to set the parent tag on the JSP.

Specified by:
setParent in interface Tag

getParent

public Tag getParent()
From the Tag interface - allows fetching the parent tag on the JSP.

Specified by:
getParent in interface Tag

doStartTag

public abstract int doStartTag()
                        throws JspException
Abstract method from the Tag interface. Abstract because it seems to make the child tags more readable if they implement their own do() methods, even when they just return one of the constants and do nothing else.

Specified by:
doStartTag in interface Tag
Throws:
JspException

doEndTag

public abstract int doEndTag()
                      throws JspException
Abstract method from the Tag interface. Abstract because it seems to make the child tags more readable if they implement their own do() methods, even when they just return one of the constants and do nothing else.

Specified by:
doEndTag in interface Tag
Throws:
JspException

release

public void release()
No-op implementation of release().

Specified by:
release in interface Tag

getParentTag

protected <T extends Tag> T getParentTag(Class<T> tagType)

Locates the enclosing tag of the type supplied. If no enclosing tag of the type supplied can be found anywhere in the ancestry of this tag, null is returned..

Returns:
T Tag of the type supplied, or null if none can be found


© Copyright 2005, Stripes Development Team.