Package org.zkoss.web.servlet.dsp.action
Class ForEach
- java.lang.Object
-
- org.zkoss.web.servlet.dsp.action.AbstractAction
-
- org.zkoss.web.servlet.dsp.action.ForEach
-
- All Implemented Interfaces:
Action
public class ForEach extends AbstractAction
Iterators thru a collection/array of items.- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description ForEach()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBegin()Returns the index of the item at which the iteration begins.intgetEnd()Returns the index of the item at which the iteration ends (inclusive).java.lang.ObjectgetItems()Returns the attribute items.java.lang.StringgetVar()Returns the variable name used to iterate thru items.java.lang.StringgetVarStatus()Returns the variable name used to hold the current iteration status, an instance ofLoopStatus.booleanisTrim()Returns whether to trim the result.voidrender(ActionContext ac, boolean nested)Processes the action and renders the output toActionContext.getOut().voidsetBegin(int beg)Sets the index of the item at which the iteration begins.voidsetEnd(int end)Sets the index of the item at which the iteration ends (inclusive).voidsetItems(java.lang.Object items)Sets the attribute items.voidsetTrim(boolean trim)Sets whether to trim the result.voidsetVar(java.lang.String var)Sets the variable name used to iterate thru items.voidsetVarStatus(java.lang.String varStatus)Sets the variable name used to hold the current iteration status.java.lang.StringtoString()-
Methods inherited from class org.zkoss.web.servlet.dsp.action.AbstractAction
append, append, append, getIf, getUnless, isEffective, setIf, setUnless, toScope
-
-
-
-
Method Detail
-
getVar
public java.lang.String getVar()
Returns the variable name used to iterate thru items.
-
setVar
public void setVar(java.lang.String var)
Sets the variable name used to iterate thru items.
-
getVarStatus
public java.lang.String getVarStatus()
Returns the variable name used to hold the current iteration status, an instance ofLoopStatus.
-
setVarStatus
public void setVarStatus(java.lang.String varStatus)
Sets the variable name used to hold the current iteration status.
-
getItems
public java.lang.Object getItems()
Returns the attribute items.
-
setItems
public void setItems(java.lang.Object items)
Sets the attribute items.
-
getBegin
public int getBegin()
Returns the index of the item at which the iteration begins.
-
setBegin
public void setBegin(int beg)
Sets the index of the item at which the iteration begins.Default: 0.
-
getEnd
public int getEnd()
Returns the index of the item at which the iteration ends (inclusive).
-
setEnd
public void setEnd(int end)
Sets the index of the item at which the iteration ends (inclusive).Default: Integer.MAX_VALUE.
-
isTrim
public boolean isTrim()
Returns whether to trim the result.
-
setTrim
public void setTrim(boolean trim)
Sets whether to trim the result.Default: true.
-
render
public void render(ActionContext ac, boolean nested) throws DspException, java.io.IOException
Description copied from interface:ActionProcesses the action and renders the output toActionContext.getOut().nested- whether there is any nested content.- Throws:
DspExceptionjava.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-