public class ForEachTag extends TagSupport implements IterationTag, LoopTag, LoopTagStatus
Modifier and Type | Class and Description |
---|---|
static class |
ForEachTag.ArrayIterator |
static class |
ForEachTag.RangeIterator |
static class |
ForEachTag.StringIterator |
Modifier and Type | Field and Description |
---|---|
protected int |
_begin |
protected Expr |
_beginExpr |
protected int |
_count |
protected java.lang.Object |
_current |
protected int |
_end |
protected Expr |
_endExpr |
protected int |
_index |
protected java.lang.Object |
_initialVar |
protected Expr |
_itemsExpr |
protected java.util.Iterator |
_iterator |
protected int |
_step |
protected Expr |
_stepExpr |
protected java.lang.String |
_var |
protected java.lang.String |
_varStatus |
id, pageContext
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
ForEachTag() |
Modifier and Type | Method and Description |
---|---|
int |
doAfterBody()
Processed to check if the tag should loop.
|
int |
doStartTag()
Process the tag.
|
java.lang.Integer |
getBegin()
Returns the begin index.
|
int |
getCount()
Returns the number of objects returned.
|
java.lang.Object |
getCurrent()
Returns the current object.
|
java.lang.Integer |
getEnd()
Returns the end index.
|
int |
getIndex()
Returns the index.
|
static java.util.Iterator |
getIterator(java.lang.Object items) |
LoopTagStatus |
getLoopStatus()
Returns the status.
|
java.lang.Integer |
getStep()
Returns the step index.
|
boolean |
isFirst()
Returns true if this is the first item.
|
boolean |
isLast()
Returns true if this is the last item.
|
void |
setBegin(Expr begin)
Sets the beginning index.
|
void |
setEnd(Expr end)
Sets the ending index.
|
void |
setItems(Expr items)
Sets the collection expression.
|
void |
setStep(Expr step)
Sets the step index.
|
void |
setVar(java.lang.String var)
Sets the iteration variable.
|
void |
setVarStatus(java.lang.String var)
Sets the status variable.
|
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
protected Expr _itemsExpr
protected Expr _beginExpr
protected Expr _endExpr
protected Expr _stepExpr
protected java.lang.String _var
protected java.lang.String _varStatus
protected java.util.Iterator _iterator
protected int _begin
protected int _end
protected int _step
protected java.lang.Object _initialVar
protected java.lang.Object _current
protected int _index
protected int _count
public void setItems(Expr items)
public void setBegin(Expr begin)
public void setEnd(Expr end)
public void setStep(Expr step)
public void setVar(java.lang.String var)
public void setVarStatus(java.lang.String var)
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
public int doAfterBody() throws JspException
TagSupport
doAfterBody
in interface IterationTag
doAfterBody
in class TagSupport
JspException
public LoopTagStatus getLoopStatus()
getLoopStatus
in interface LoopTag
public java.lang.Object getCurrent()
getCurrent
in interface LoopTag
getCurrent
in interface LoopTagStatus
public int getIndex()
getIndex
in interface LoopTagStatus
public int getCount()
getCount
in interface LoopTagStatus
public boolean isFirst()
isFirst
in interface LoopTagStatus
public boolean isLast()
isLast
in interface LoopTagStatus
public java.lang.Integer getBegin()
getBegin
in interface LoopTagStatus
public java.lang.Integer getEnd()
getEnd
in interface LoopTagStatus
public java.lang.Integer getStep()
getStep
in interface LoopTagStatus
public static java.util.Iterator getIterator(java.lang.Object items) throws JspTagException
JspTagException