org.apache.commons.jelly.tags.core
Class ForEachTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.core.ForEachTag
All Implemented Interfaces:
Tag

public class ForEachTag
extends TagSupport

A tag which performs an iteration over the results of an XPath expression

Version:
$Revision: 1.22 $
Author:
James Strachan

Field Summary
private  int begin
          The starting index value
private  int end
          The ending index value
private  int index
          The iteration index
private  java.lang.String indexVar
          If specified then the current index counter will be defined as the given variable name.
private  Expression items
          Holds the variable name to export for the item being iterated over.
private static org.apache.commons.logging.Log log
          The Log to which logging calls will be made.
private  int step
          The index increment step
private  java.lang.String var
          If specified then the current item iterated through will be defined as the given variable name.
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
ForEachTag()
           
 
Method Summary
 void doTag(XMLOutput output)
          Evaluates this tag after all the tags properties have been initialized.
 void setBegin(int begin)
          Sets the starting index value
 void setEnd(int end)
          Sets the ending index value
 void setIndexVar(java.lang.String indexVar)
          Sets the variable name to export the current index counter to
 void setItems(Expression items)
          Sets the expression used to iterate over
 void setStep(int step)
          Sets the index increment step
 void setVar(java.lang.String var)
          Sets the variable name to export for the item being iterated over
 void setVarStatus(java.lang.String var)
          Sets the variable name to export the current index to.
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isTrim, setBody, setContext, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
The Log to which logging calls will be made.


items

private Expression items
Holds the variable name to export for the item being iterated over.


var

private java.lang.String var
If specified then the current item iterated through will be defined as the given variable name.


indexVar

private java.lang.String indexVar
If specified then the current index counter will be defined as the given variable name.


begin

private int begin
The starting index value


end

private int end
The ending index value


step

private int step
The index increment step


index

private int index
The iteration index

Constructor Detail

ForEachTag

public ForEachTag()
Method Detail

doTag

public void doTag(XMLOutput output)
           throws MissingAttributeException,
                  JellyTagException
Description copied from interface: Tag
Evaluates this tag after all the tags properties have been initialized.

Throws:
MissingAttributeException
JellyTagException

setItems

public void setItems(Expression items)
Sets the expression used to iterate over


setVar

public void setVar(java.lang.String var)
Sets the variable name to export for the item being iterated over


setIndexVar

public void setIndexVar(java.lang.String indexVar)
Sets the variable name to export the current index counter to


setBegin

public void setBegin(int begin)
Sets the starting index value


setEnd

public void setEnd(int end)
Sets the ending index value


setStep

public void setStep(int step)
Sets the index increment step


setVarStatus

public void setVarStatus(java.lang.String var)
Sets the variable name to export the current index to. This does the same thing as #setIndexVar(), but is consistent with the JSTL syntax.