|
Devsphere.com |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.servlet.jsp.tagext.TagSupport
|
+--javax.servlet.jsp.tagext.BodyTagSupport
|
+--com.devsphere.xml.taglib.support.tag.CommonSupport
|
+--com.devsphere.xml.taglib.process.tag.ProcessSupport
This class provides support for XML processing tag handlers. It provides methods for looping over a sequence of SAX events.
| Field Summary | |
protected ProcessSupport |
ancestor
The tag handler of the nearest ancestor tag |
protected EventSupport |
event
The event handled by this object |
protected Handler |
handler
The event handler |
protected int |
indentLevel
The indent level of the tag |
| Fields inherited from class com.devsphere.xml.taglib.support.tag.CommonSupport |
cachedDebug, cachedLogger, DEBUG_ATTR, DEFAULT_DEBUG, DEFAULT_RESTORE_VALUE, DEFAULT_SCOPE, LOGGER_ATTR, originalValues |
| Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
bodyContent |
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext |
| 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 | |
ProcessSupport()
|
|
| Method Summary | |
protected abstract boolean |
continueLoop()
Subclasses must implement this method and return true
if the event loop should be continued. |
int |
doAfterBody()
Calls continueLoop(). |
int |
doEndTag()
Returns EVAL_PAGE. |
void |
doFinally()
Calls finalizeLoop() |
int |
doStartTag()
Calls initLoop() and then startLoop(). |
protected void |
finalizeLoop()
Subclasses may override this method if they need to execute some operations after the event loop is finished. |
protected boolean |
getEvent()
Gets the current parsing event and returns true if this isn't null. |
protected void |
init()
Initializes the fields of this tag handler. |
protected void |
initLoop()
Initializes the event loop, finding the nearest ancestor tag so that the current tag can be validated and handled within its context. |
protected void |
logEvent()
Logs an event if the debug flag is true. |
protected void |
logEvent(java.lang.String status)
Logs an event if the debug flag is true. |
protected boolean |
removeEvent()
Tries to removes the current parsing event in order to make room for another event. |
protected abstract boolean |
startLoop()
Subclasses must implement this method and return true
if the event loop should be started. |
protected void |
validate(CommonSupport ancestor)
Verify if the handled tag was placed in the right context. |
| Methods inherited from class com.devsphere.xml.taglib.support.tag.CommonSupport |
checkVarName, checkVarScope, doCatch, eval, evalBoolean, evalDouble, evalInt, evalString, export, export, getAllowedAncestors, getDebug, getLogger, getTagName, log, log, log, restore |
| Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.jsp.tagext.Tag |
getParent, setPageContext, setParent |
| Field Detail |
protected ProcessSupport ancestor
protected Handler handler
protected EventSupport event
protected int indentLevel
| Constructor Detail |
public ProcessSupport()
| Method Detail |
protected void init()
init in class CommonSupport
protected void validate(CommonSupport ancestor)
throws javax.servlet.jsp.JspException
JspException if
ancestor is null,
but the allowed ancestors list is not empty or
ancestor is not null,
but the allowed ancestors list is empty or
ancestor tag
is not found in the allowed ancestors list
returned by getAllowedAncestors() or
validate in class CommonSupportancestor - the tag handler of an ancestor whose name
is searched in the list of allowed ancestors
javax.servlet.jsp.JspException - to signal a tag validation errorprotected boolean getEvent()
null.
true if an event is available for processingprotected boolean removeEvent()
true if the event was removedprotected void logEvent()
true.
protected void logEvent(java.lang.String status)
true.
status - a string describing the status of the event
protected void initLoop()
throws javax.servlet.jsp.JspException
javax.servlet.jsp.JspException - to signal a tag validation error
protected abstract boolean startLoop()
throws javax.servlet.jsp.JspException
true
if the event loop should be started.
true if the event loop should be started
javax.servlet.jsp.JspException - to signal an error
protected abstract boolean continueLoop()
throws javax.servlet.jsp.JspException
true
if the event loop should be continued.
true if the event loop should be continued
javax.servlet.jsp.JspException - to signal an errorprotected void finalizeLoop()
public int doStartTag()
throws javax.servlet.jsp.JspException
initLoop() and then startLoop().
If the latter returns true, this method returns
EVAL_BODY_INCLUDE so that the body of the tag is evaluated
getting the chance to process one or more parsing events.
Otherwise it returns SKIP_BODY.
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.BodyTagSupportEVAL_BODY_INCLUDE or SKIP_BODY
depending on the value returned by startLoop()
javax.servlet.jsp.JspException - to signal an error
public int doAfterBody()
throws javax.servlet.jsp.JspException
continueLoop(). If that returns true,
this method returns EVAL_BODY_AGAIN so that the body of
the tag is re-evaluated getting the chance to process new events.
Otherwise it returns SKIP_BODY.
doAfterBody in interface javax.servlet.jsp.tagext.IterationTagdoAfterBody in class javax.servlet.jsp.tagext.BodyTagSupportEVAL_BODY_AGAIN or SKIP_BODY
depending on the value returned by continueLoop()
javax.servlet.jsp.JspException - to signal an error
public int doEndTag()
throws javax.servlet.jsp.JspException
EVAL_PAGE.
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.BodyTagSupportEVAL_PAGE.
javax.servlet.jsp.JspExceptionpublic void doFinally()
finalizeLoop()
doFinally in interface javax.servlet.jsp.tagext.TryCatchFinallydoFinally in class CommonSupport
|
Devsphere.com |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||