org.apache.beehive.netui.tags.databinding.base
Class StructuredBaseTag
Object
TagSupport
BodyTagSupport
AbstractClassicTag
StructuredBaseTag
- All Implemented Interfaces:
- Serializable, BodyTag, IterationTag, JspTag, Tag, INetuiTag
- Direct Known Subclasses:
- RepeaterComponent
public abstract class StructuredBaseTag
- extends AbstractClassicTag
A base tag for NetUI Databinding tags that are work in a repeating
context. This tag encapsulates code that is common across may of the NetUI tags
which are diretly contained in the @see org.apache.beehive.netui.tags.databinding.repeater.Repeater
and @see org.apache.beehive.netui.tags.databinding.grid.Grid tags.
This tag provides commonly used features such as buffering of content, a simple
mechanism for verifying a tag's parent structure, and verifying the attributes
set on a tag instance.
Tags that extend this base class participate in sometimes complex rendering
cycles of repeating tags. As a result, as the containing tag evalutes its
body, it treats the lifecycle of this evaluation as a state machine. The
direct child tags which extend this class often need to know the state of the
parent tag. There are two convenience methods that are invoked by this
tag's @see doStartTag() and @see doEndTag methods that pass the current
state of the parent to the child tags. The @see renderStartTag and @see renderEndTag
can return any values that the @see javax.servlet.jsp.tagext.TagSupport#doStartTag(int)
and the @see javax.servlet.jsp.tagext.TagSupport#doEndTag(int) calls can
return.
- See Also:
- Serialized Form
Fields inherited from class BodyTagSupport |
bodyContent |
Fields inherited from class TagSupport |
id, pageContext |
Fields inherited from interface BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface IterationTag |
EVAL_BODY_AGAIN |
Fields inherited from interface Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Methods inherited from class AbstractClassicTag |
addTagIdMapping, applyNamingChain, getErrorsReport, getNamingChain, getNextId, getScriptReporter, getTagName, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, renderAttribute, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write |
Methods inherited from class BodyTagSupport |
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Tag |
getParent, setPageContext, setParent |
EMPTY_STRING
protected static final String EMPTY_STRING
- See Also:
- Constant Field Values
StructuredBaseTag
public StructuredBaseTag()
addContent
public void addContent(String content)
- Add content to the content that is being buffered by this tag. All tags write their body
content to this content buffer, which is rendered at the end of the tag's lifecycle if
no fatal errors have occurred during this tag's lifecycle.
- Parameters:
content
- content that this tag should render.
getContent
public String getContent()
- Get the content which should be rendered by this tag.
- Returns:
- the content String if there is content; null otherwise
doStartTag
public int doStartTag()
throws JspException
- Starts a tag's lifecycle. This method performs several operations before
invoking the @see renderStartTag(int) method. In order, these stages are:
- @see verifyStructure()
- @see prepare()
- @see verifyAttributes()
- @see renderStartTag(int)
The benefit of this lifecycle is that it provides a structure for component
tags that are immediately nested inside of repeating tags.
Any errors that occur before calling @see renderStartTag(int) are reported
in the page.
- Specified by:
doStartTag
in interface Tag
- Overrides:
doStartTag
in class BodyTagSupport
- Returns:
- the value returned from calling @see renderStartTag(int), which can be
any value that can be returned from the @see javax.servlet.jsp.tagext.TagSupport
class. If an error occurs, the tag returns SKIP_BODY.
- Throws:
JspException
doEndTag
public int doEndTag()
throws JspException
- Ends a tag's lifecycle. This call is a wrapper around the @see renderEndTag(int) call
that allows a tag directly contained in a repeating tag to act based on the state
of the parent.
- Specified by:
doEndTag
in interface Tag
- Overrides:
doEndTag
in class BodyTagSupport
- Returns:
- EVAL_PAGE
- Throws:
JspException
- if an error that occurred that could not be reported to the page
localRelease
protected void localRelease()
- Reset all of the fields of this tag.
- Overrides:
localRelease
in class AbstractClassicTag
getCurrentRenderState
protected abstract int getCurrentRenderState()
renderStartTag
protected abstract int renderStartTag(int state)
throws JspException
- Throws:
JspException
renderEndTag
protected abstract int renderEndTag(int state)
throws JspException
- Throws:
JspException
getValidContainerType
protected abstract Class getValidContainerType()
prepare
protected void prepare()
throws JspException
- Throws:
JspException
verifyAttributes
protected void verifyAttributes()
throws JspException
- Throws:
JspException