public class ForEachTag extends LoopTagSupport
Support for the XML library's <forEach> tag.
LoopTagSupport
,
Serialized Formbegin, beginSpecified, deferredExpression, end, endSpecified, itemId, statusId, step, stepSpecified
Constructor and Description |
---|
ForEachTag() |
Modifier and Type | Method and Description |
---|---|
Node |
getContext() |
protected boolean |
hasNext()
Returns information concerning the availability of more items
over which to iterate.
|
protected Object |
next()
Returns the next object over which the tag should iterate.
|
protected void |
prepare()
Prepares for a single tag invocation.
|
void |
release()
Releases any resources this LoopTagSupport may have (or inherit).
|
void |
setBegin(int begin) |
void |
setEnd(int end) |
void |
setSelect(String select) |
void |
setStep(int step) |
doAfterBody, doCatch, doFinally, doStartTag, getCurrent, getDelims, getLoopStatus, setVar, setVarStatus, validateBegin, validateEnd, validateStep
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
protected void prepare() throws javax.servlet.jsp.JspTagException
LoopTagSupport
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.
prepare
in class LoopTagSupport
javax.servlet.jsp.JspTagException
protected boolean hasNext() throws javax.servlet.jsp.JspTagException
LoopTagSupport
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.
hasNext
in class LoopTagSupport
javax.servlet.jsp.JspTagException
LoopTagSupport.next()
protected Object next() throws javax.servlet.jsp.JspTagException
LoopTagSupport
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.)
next
in class LoopTagSupport
javax.servlet.jsp.JspTagException
- for other, unexpected exceptionspublic void release()
LoopTagSupport
release
in interface javax.servlet.jsp.tagext.Tag
release
in class LoopTagSupport
public void setSelect(String select)
public void setBegin(int begin) throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException
public void setEnd(int end) throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException
public void setStep(int step) throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException
public Node getContext() throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException
Copyright © 2016 JBoss by Red Hat. All rights reserved.