com.caucho.jstl.el
Class ForEachTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.caucho.jstl.el.ForEachTag
All Implemented Interfaces:
java.io.Serializable, LoopTag, LoopTagStatus, IterationTag, JspTag, Tag
Direct Known Subclasses:
ForTokensTag

public class ForEachTag
extends TagSupport
implements IterationTag, LoopTag, LoopTagStatus

See Also:
Serialized Form

Nested Class Summary
static class ForEachTag.ArrayIterator
           
static class ForEachTag.RangeIterator
           
static class ForEachTag.StringIterator
           
 
Field Summary
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
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
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
ForEachTag()
           
 
Method Summary
 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.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, 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
doEndTag, getParent, release, setPageContext, setParent
 

Field Detail

_itemsExpr

protected Expr _itemsExpr

_beginExpr

protected Expr _beginExpr

_endExpr

protected Expr _endExpr

_stepExpr

protected Expr _stepExpr

_var

protected java.lang.String _var

_varStatus

protected java.lang.String _varStatus

_iterator

protected java.util.Iterator _iterator

_begin

protected int _begin

_end

protected int _end

_step

protected int _step

_initialVar

protected java.lang.Object _initialVar

_current

protected java.lang.Object _current

_index

protected int _index

_count

protected int _count
Constructor Detail

ForEachTag

public ForEachTag()
Method Detail

setItems

public void setItems(Expr items)
Sets the collection expression.


setBegin

public void setBegin(Expr begin)
Sets the beginning index.


setEnd

public void setEnd(Expr end)
Sets the ending index.


setStep

public void setStep(Expr step)
Sets the step index.


setVar

public void setVar(java.lang.String var)
Sets the iteration variable.


setVarStatus

public void setVarStatus(java.lang.String var)
Sets the status variable.


doStartTag

public int doStartTag()
               throws JspException
Process the tag.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class TagSupport
Returns:
SKIP_BODY to ignore the body and EVAL_BODY_INCLUDE to evaluate the body.
Throws:
JspException

doAfterBody

public int doAfterBody()
                throws JspException
Description copied from class: TagSupport
Processed to check if the tag should loop. The default behavior returns SKIP_BODY so it does not loop.

Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class TagSupport
Returns:
EVAL_BODY_AGAIN to repeat the body or SKIP_BODY to stop.
Throws:
JspException

getLoopStatus

public LoopTagStatus getLoopStatus()
Returns the status.

Specified by:
getLoopStatus in interface LoopTag

getCurrent

public java.lang.Object getCurrent()
Returns the current object.

Specified by:
getCurrent in interface LoopTag
Specified by:
getCurrent in interface LoopTagStatus

getIndex

public int getIndex()
Returns the index.

Specified by:
getIndex in interface LoopTagStatus

getCount

public int getCount()
Returns the number of objects returned.

Specified by:
getCount in interface LoopTagStatus

isFirst

public boolean isFirst()
Returns true if this is the first item.

Specified by:
isFirst in interface LoopTagStatus

isLast

public boolean isLast()
Returns true if this is the last item.

Specified by:
isLast in interface LoopTagStatus

getBegin

public java.lang.Integer getBegin()
Returns the begin index.

Specified by:
getBegin in interface LoopTagStatus

getEnd

public java.lang.Integer getEnd()
Returns the end index.

Specified by:
getEnd in interface LoopTagStatus

getStep

public java.lang.Integer getStep()
Returns the step index.

Specified by:
getStep in interface LoopTagStatus

getIterator

public static java.util.Iterator getIterator(java.lang.Object items)
                                      throws JspTagException
Throws:
JspTagException