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, pageContextEVAL_BODY_AGAINEVAL_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, setValueprotected 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 TagdoStartTag in class TagSupportJspExceptionpublic int doAfterBody()
throws JspException
TagSupportdoAfterBody in interface IterationTagdoAfterBody in class TagSupportJspExceptionpublic LoopTagStatus getLoopStatus()
getLoopStatus in interface LoopTagpublic java.lang.Object getCurrent()
getCurrent in interface LoopTaggetCurrent in interface LoopTagStatuspublic int getIndex()
getIndex in interface LoopTagStatuspublic int getCount()
getCount in interface LoopTagStatuspublic boolean isFirst()
isFirst in interface LoopTagStatuspublic boolean isLast()
isLast in interface LoopTagStatuspublic java.lang.Integer getBegin()
getBegin in interface LoopTagStatuspublic java.lang.Integer getEnd()
getEnd in interface LoopTagStatuspublic java.lang.Integer getStep()
getStep in interface LoopTagStatuspublic static java.util.Iterator getIterator(java.lang.Object items)
throws JspTagException
JspTagException