com.opensymphony.module.sitemesh.taglib
Class AbstractTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended bycom.opensymphony.module.sitemesh.taglib.AbstractTag
All Implemented Interfaces:
BodyTag, IterationTag, RequestConstants, Serializable, Tag
Direct Known Subclasses:
BodyTag, HeadTag, PropertyTag, TitleTag, UsePageTag

public abstract class AbstractTag
extends BodyTagSupport
implements RequestConstants

Convenience implementation of Tag containing generice methods required by all (or most) taglibs.

Version:
$Revision: 1.4 $
Author:
Joe Walnes
See Also:
Serialized Form

Field Summary
protected  PageContext pageContext
           
protected  Tag parent
           
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id
 
Fields inherited from interface com.opensymphony.module.sitemesh.RequestConstants
DECORATOR, FILTER_APPLIED, PAGE, ROBOT, USING_STREAM
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
 
Constructor Summary
AbstractTag()
           
 
Method Summary
abstract  int doEndTag()
          To be implemented by all empty tags.
 int doStartTag()
          Returns SKIP_BODY.
protected  Writer getOut()
          Get the outputWriter.
protected  Page getPage()
          Return the Page object from the PAGE scope.
 Tag getParent()
           
 void release()
           
 void setPageContext(PageContext pageContext)
           
 void setParent(Tag parent)
           
protected static void trace(Exception e)
          Log exception generated by taglib.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getValue, getValues, removeValue, setId, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageContext

protected PageContext pageContext

parent

protected Tag parent
Constructor Detail

AbstractTag

public AbstractTag()
Method Detail

doEndTag

public abstract int doEndTag()
                      throws JspException
To be implemented by all empty tags.

Specified by:
doEndTag in interface Tag
Throws:
JspException

doStartTag

public int doStartTag()
Returns SKIP_BODY.

Specified by:
doStartTag in interface Tag

release

public void release()
Specified by:
release in interface Tag

getParent

public Tag getParent()
Specified by:
getParent in interface Tag

setParent

public void setParent(Tag parent)
Specified by:
setParent in interface Tag

setPageContext

public void setPageContext(PageContext pageContext)
Specified by:
setPageContext in interface Tag

getPage

protected Page getPage()
Return the Page object from the PAGE scope. If this is found in REQUEST scope instead, it will be moved into PAGE scope - to handle multi-level includes.


trace

protected static void trace(Exception e)
Log exception generated by taglib.


getOut

protected Writer getOut()
Get the outputWriter. This method should be used in preference to pageContext.getOut(), as some charset conversions may need to happen in some servers.

Returns:
the writer for use in the tag

www.opensymphony.com/sitemesh/