java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.jstl.core.LoopTagSupport
All Implemented Interfaces:
LoopTag, TryCatchFinally, IterationTag, Serializable
Base support class to facilitate implementation of iteration tags.
Since most iteration tags will behave identically with respect to actual iterative behavior, JSTL provides this base support class to facilitate implementation. Many iteration tags will extend this and merely implement the hasNext() and next() methods to provide contents for the handler to iterate over.
In particular, this base class provides support for:
In providing support for these tasks, LoopTagSupport contains certain control variables that act to modify the iteration. Accessors are provided for these control variables when the variables represent information needed or wanted at translation time (e.g., var, varStatus). For other variables, accessors cannot be provided here since subclasses may differ on their implementations of how those accessors are received. For instance, one subclass might accept a String and convert it into an object of a specific type by using an expression evaluator; others might accept objects directly. Still others might not want to expose such information to outside control.
Shawn
- BayernField Summary | ||
---|---|---|
protected int | begin | Starting index ('begin' attribute) |
protected int | end | Ending index of the iteration ('end' attribute). A value of -1 internally indicates 'no end specified', although accessors for the core JSTL tags do not allow this value to be supplied directly by the user. |
protected int | step | Iteration step ('step' attribute) |
protected boolean | beginSpecified | Boolean flag indicating whether 'begin' was specified. |
protected boolean | endSpecified | Boolean flag indicating whether 'end' was specified. |
protected boolean | stepSpecified | Boolean flag indicating whether 'step' was specified. |
protected String | itemId | Attribute-exposing control |
protected String | statusId | |
protected ValueExpression | deferredExpression | The deferred expression if any |
Fields inherited from javax.servlet.jsp.tagext.TagSupport: |
---|
id, pageContext |
Constructor: |
---|
|
Method from javax.servlet.jsp.jstl.core.LoopTagSupport Summary: |
---|
doAfterBody, doCatch, doFinally, doStartTag, getCurrent, getDelims, getLoopStatus, hasNext, next, prepare, release, setVar, setVarStatus, validateBegin, validateEnd, validateStep |
Methods from javax.servlet.jsp.tagext.TagSupport: |
---|
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.servlet.jsp.jstl.core.LoopTagSupport Detail: |
---|
|
|
These attributes are intended to support scripting variables with NESTED scope, so we don't want to pollute attribute space by leaving them lying around. |
|
|
|
|
Returns information concerning the availability of more items over which to iterate. This method must be provided by concrete subclasses of LoopTagSupport to assist the iterative logic provided by the supporting base class. See next for more information about the purpose and expectations behind this tag. |
Returns the next object over which the tag should iterate. This method must be provided by concrete subclasses of LoopTagSupport to inform the base logic about what objects it should iterate over. It is expected that this method will generally be backed by an Iterator, but this will not always be the case. In particular, if retrieving the next object raises the possibility of an exception being thrown, this method allows that exception to propagate back to the JSP container as a JspTagException; a standalone Iterator would not be able to do this. (This explains why LoopTagSupport does not simply call for an Iterator from its subtags.) |
Prepares for a single tag invocation. Specifically, allows subclasses to prepare for calls to hasNext() and next(). Subclasses can assume that prepare() will be called once for each invocation of doStartTag() in the superclass. |
|
|
|
|
|
|