jodd.servlet.tag
Class IteratorTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by jodd.servlet.tag.IteratorTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

public class IteratorTag
extends javax.servlet.jsp.tagext.SimpleTagSupport

Iterator tag for iterating collections.

See Also:
IteratorStatus

Field Summary
protected  int count
           
protected  int from
           
protected  java.lang.Object items
           
protected  IteratorStatus iteratorStatus
           
protected  int modulus
           
protected  java.lang.String scope
           
protected  java.lang.String status
           
protected  java.lang.String var
           
 
Constructor Summary
IteratorTag()
           
 
Method Summary
protected  int calculateTo(int from, int count, int size)
          Calculates 'TO'.
 void doTag()
           
protected  void iterateArray(java.lang.Object[] array, int from, int count, javax.servlet.jsp.PageContext pageContext)
          Iterates arrays.
protected  void iterateCollection(java.util.Collection collection, int from, int count, javax.servlet.jsp.PageContext pageContext)
          Iterates collection.
 void setCount(int count)
          Sets count as total number of items to iterate.
 void setFrom(int from)
          Sets starting index.
 void setItems(java.lang.Object items)
          Specifies item collection.
 void setModulus(int modulus)
          Specifies modulus value for the iterator status
 void setScope(java.lang.String scope)
          Sets scope for all variables.
 void setStatus(java.lang.String status)
          Specifies status variable name.
 void setVar(java.lang.String var)
          Specifies variable name that will be used for item during iteration.
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

protected java.lang.Object items

var

protected java.lang.String var

status

protected java.lang.String status

modulus

protected int modulus

scope

protected java.lang.String scope

from

protected int from

count

protected int count

iteratorStatus

protected IteratorStatus iteratorStatus
Constructor Detail

IteratorTag

public IteratorTag()
Method Detail

setItems

public void setItems(java.lang.Object items)
Specifies item collection.


setVar

public void setVar(java.lang.String var)
Specifies variable name that will be used for item during iteration.


setStatus

public void setStatus(java.lang.String status)
Specifies status variable name. If omitted, status will not be used.


setModulus

public void setModulus(int modulus)
Specifies modulus value for the iterator status


setScope

public void setScope(java.lang.String scope)
Sets scope for all variables.


setFrom

public void setFrom(int from)
Sets starting index.


setCount

public void setCount(int count)
Sets count as total number of items to iterate.


doTag

public void doTag()
           throws javax.servlet.jsp.JspException
Specified by:
doTag in interface javax.servlet.jsp.tagext.SimpleTag
Overrides:
doTag in class javax.servlet.jsp.tagext.SimpleTagSupport
Throws:
javax.servlet.jsp.JspException

calculateTo

protected int calculateTo(int from,
                          int count,
                          int size)
Calculates 'TO'.


iterateCollection

protected void iterateCollection(java.util.Collection collection,
                                 int from,
                                 int count,
                                 javax.servlet.jsp.PageContext pageContext)
                          throws javax.servlet.jsp.JspException
Iterates collection.

Throws:
javax.servlet.jsp.JspException

iterateArray

protected void iterateArray(java.lang.Object[] array,
                            int from,
                            int count,
                            javax.servlet.jsp.PageContext pageContext)
                     throws javax.servlet.jsp.JspException
Iterates arrays.

Throws:
javax.servlet.jsp.JspException


Copyright © 2003-2012 Jodd Team