org.japano.pagenode.jstl.core
Class ForEach

java.lang.Object
  extended by org.japano.PageNode
      extended by org.japano.pagenode.jstl.core.ForEach
All Implemented Interfaces:
javax.servlet.jsp.jstl.core.LoopTagStatus
Direct Known Subclasses:
ForTokens

public class ForEach
extends PageNode
implements javax.servlet.jsp.jstl.core.LoopTagStatus

Foreach implementation.

Version:
$Id: ForEach.java,v 1.9 2005/10/03 14:55:14 fforw Exp $ SourceForge.net Logo
Author:
Sven Helmberger ( sven dot helmberger at gmx dot de )

Nested Class Summary
 
Nested classes/interfaces inherited from class org.japano.PageNode
PageNode.Output
 
Field Summary
protected  int begin
          Holds value of property begin.
protected  boolean beginSet
           
protected  int count
           
protected  java.lang.Object current
           
protected  java.lang.String delimiter
           
protected  int end
          Holds value of property end.
protected  int endOfRun
           
protected  boolean endSet
           
protected  boolean first
           
 java.lang.Integer iBegin
           
 java.lang.Integer iEnd
           
protected  int index
           
 java.lang.Integer iStep
           
protected  java.lang.Object items
          Holds value of property items.
protected  boolean itemsSet
           
protected  boolean last
           
protected  int step
          Holds value of property step.
protected  java.lang.String var
          Holds value of property var.
protected  java.lang.String varStatus
          Holds value of property varStatus.
 
Fields inherited from class org.japano.PageNode
children, context, EMPTY, nodeId, parent
 
Constructor Summary
ForEach()
           
 
Method Summary
 void generate(Buffer out)
          Generates this node The base implementation just calls PageNode.generateChildren(Buffer)
 void generateChildren(Buffer out)
          Dumps all child nodes of this node.
 java.lang.Integer getBegin()
          Returns the begin value.
 int getCount()
          Returns the current count.
 java.lang.Object getCurrent()
          Returns the current object.
 java.lang.Integer getEnd()
          Returns the end value.
 int getIndex()
          Returns the current index.
 java.lang.Integer getStep()
          Returns the step value.
 boolean isFirst()
          Returns true if the current iteration is the first.
 boolean isLast()
          Returns true if the current iteration is the last.
protected  void iterate(java.util.Iterator iterator, Buffer out)
           
 void setBegin(int begin)
          If items specified: Iteration begins at the item located at the specified index.
 void setEnd(int end)
          If items specified: Iteration ends at the item located at the specified index (inclusive).
 void setItems(java.lang.Object items)
          Collection of items to iterate over.
 void setStep(int step)
          Iteration will only process every step items of the collection, starting with the first one.
 void setVar(java.lang.String var)
          Name of the exported scoped variable for the current item of the iteration.
 void setVarStatus(java.lang.String varStatus)
          Name of the exported scoped variable for the status of the iteration.
 
Methods inherited from class org.japano.PageNode
findChildren, findParent, findRootNode, getChildren, getContext, getNodeId, getParent, init, recInit, release, setChildren, setContext, setNodeId, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beginSet

protected boolean beginSet

endSet

protected boolean endSet

first

protected boolean first

last

protected boolean last

iStep

public java.lang.Integer iStep

iBegin

public java.lang.Integer iBegin

iEnd

public java.lang.Integer iEnd

items

protected java.lang.Object items
Holds value of property items.


itemsSet

protected boolean itemsSet

begin

protected int begin
Holds value of property begin.


end

protected int end
Holds value of property end.


step

protected int step
Holds value of property step.


var

protected java.lang.String var
Holds value of property var.


varStatus

protected java.lang.String varStatus
Holds value of property varStatus.


delimiter

protected java.lang.String delimiter

count

protected int count

index

protected int index

current

protected java.lang.Object current

endOfRun

protected int endOfRun
Constructor Detail

ForEach

public ForEach()
Method Detail

setItems

public void setItems(java.lang.Object items)
Collection of items to iterate over.


setBegin

public void setBegin(int begin)
If items specified: Iteration begins at the item located at the specified index. First item of the collection has index 0. If items not specified: Iteration begins with index set at the value specified.


setEnd

public void setEnd(int end)
If items specified: Iteration ends at the item located at the specified index (inclusive).
If items not specified: Iteration ends when index reaches the value specified.


setStep

public void setStep(int step)
Iteration will only process every step items of the collection, starting with the first one.


setVar

public void setVar(java.lang.String var)
Name of the exported scoped variable for the current item of the iteration. This scoped variable has nested visibility. Its type depends on the object of the underlying collection.


setVarStatus

public void setVarStatus(java.lang.String varStatus)
Name of the exported scoped variable for the status of the iteration. Object exported is of type javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility.


generate

public void generate(Buffer out)
Description copied from class: PageNode
Generates this node The base implementation just calls PageNode.generateChildren(Buffer)

Overrides:
generate in class PageNode

iterate

protected void iterate(java.util.Iterator iterator,
                       Buffer out)

generateChildren

public void generateChildren(Buffer out)
Description copied from class: PageNode
Dumps all child nodes of this node.

Overrides:
generateChildren in class PageNode

getCurrent

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

Specified by:
getCurrent in interface javax.servlet.jsp.jstl.core.LoopTagStatus

getIndex

public int getIndex()
Returns the current index.

Specified by:
getIndex in interface javax.servlet.jsp.jstl.core.LoopTagStatus

getCount

public int getCount()
Returns the current count. The count starts at 1 and increases with every iteration by 1 regardless of step value.

Specified by:
getCount in interface javax.servlet.jsp.jstl.core.LoopTagStatus

getStep

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

Specified by:
getStep in interface javax.servlet.jsp.jstl.core.LoopTagStatus

isLast

public boolean isLast()
Returns true if the current iteration is the last.

Specified by:
isLast in interface javax.servlet.jsp.jstl.core.LoopTagStatus

isFirst

public boolean isFirst()
Returns true if the current iteration is the first.

Specified by:
isFirst in interface javax.servlet.jsp.jstl.core.LoopTagStatus

getEnd

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

Specified by:
getEnd in interface javax.servlet.jsp.jstl.core.LoopTagStatus

getBegin

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

Specified by:
getBegin in interface javax.servlet.jsp.jstl.core.LoopTagStatus