Package org.zkoss.zk.ui.util
Class ForEachImpl
- java.lang.Object
-
- org.zkoss.zk.ui.util.ForEachImpl
-
- All Implemented Interfaces:
ForEach
public class ForEachImpl extends java.lang.Object implements ForEach
An implementation ofForEach
.Note: the use of
ForEachImpl
is different fromConditionImpl
. While you could use the same instance ofConditionImpl
for all evaluation, each instance ofForEachImpl
can be used only once (drop it afternext()
returns false).- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description ForEachImpl(EvaluatorRef evalr, Component comp, java.lang.String expr, java.lang.String begin, java.lang.String end)
Constructor.ForEachImpl(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end)
Constructor.ForEachImpl(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end, ExValue step)
Constructor.ForEachImpl(EvaluatorRef evalr, Page page, java.lang.String expr, java.lang.String begin, java.lang.String end)
Constructor.ForEachImpl(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end)
Constructor.ForEachImpl(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end, ExValue step)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ForEach
getInstance(EvaluatorRef evalr, Component comp, java.lang.String expr, java.lang.String begin, java.lang.String end)
Returns an instance that represents the iterator for the specified collection, or null if expr is null or empty.static ForEach
getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end)
Returns an instance that represents the iterator for the specified collection.static ForEach
getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end, ExValue step)
Returns an instance that represents the iterator for the specified collection.static ForEach
getInstance(EvaluatorRef evalr, Page page, java.lang.String expr, java.lang.String begin, java.lang.String end)
Returns an instance that represents the iterator for the specified collection, or null if expr is null or empty.static ForEach
getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end)
Returns an instance that represents the iterator for the specified collection, or null if expr is null or empty.static ForEach
getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end, ExValue step)
Returns an instance that represents the iterator for the specified collection, or null if expr is null or empty.boolean
next()
Advanced to the next element.
-
-
-
Constructor Detail
-
ForEachImpl
public ForEachImpl(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end, ExValue step)
Constructor. In most cases, usegetInstance(EvaluatorRef, Component, ExValue[], ExValue, ExValue, ExValue)
instead of this constructor.- Throws:
java.lang.IllegalArgumentException
- if comp or evalr is null- Since:
- 8.0.0
-
ForEachImpl
public ForEachImpl(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end, ExValue step)
Constructor. In most cases, usegetInstance(EvaluatorRef, Component, ExValue[], ExValue, ExValue, ExValue)
instead of this constructor.- Throws:
java.lang.IllegalArgumentException
- if page or evalr is null- Since:
- 8.0.0
-
ForEachImpl
public ForEachImpl(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end)
Constructor. In most cases, usegetInstance(EvaluatorRef, Component, ExValue[], ExValue, ExValue)
instead of this constructor.- Throws:
java.lang.IllegalArgumentException
- if comp or evalr is null- Since:
- 3.0.6
-
ForEachImpl
public ForEachImpl(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end)
Constructor. In most cases, usegetInstance(EvaluatorRef, Component, ExValue[], ExValue, ExValue)
instead of this constructor.- Throws:
java.lang.IllegalArgumentException
- if page or evalr is null- Since:
- 3.0.6
-
ForEachImpl
public ForEachImpl(EvaluatorRef evalr, Component comp, java.lang.String expr, java.lang.String begin, java.lang.String end)
Constructor. In most cases, usegetInstance(EvaluatorRef, Component, String, String, String)
instead of this constructor.- Throws:
java.lang.IllegalArgumentException
- if comp or evalr is null- Since:
- 3.0.0
- See Also:
ForEachImpl(EvaluatorRef, Component, ExValue[], ExValue, ExValue)
-
ForEachImpl
public ForEachImpl(EvaluatorRef evalr, Page page, java.lang.String expr, java.lang.String begin, java.lang.String end)
Constructor. In most cases, usegetInstance(EvaluatorRef, Component, String, String, String)
instead of this constructor.- Throws:
java.lang.IllegalArgumentException
- if page or evalr is null- Since:
- 3.0.0
- See Also:
ForEachImpl(EvaluatorRef, Page, ExValue[], ExValue, ExValue)
-
-
Method Detail
-
getInstance
public static ForEach getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end)
Returns an instance that represents the iterator for the specified collection.- Parameters:
expr
- an array of expressions. There are two formats.- length == 1: it iterates thru the content of expr[0]. For example, if expr[0] is an array, all items in this array will be iterated.
- length > 1, it will iterate thru expr[0]
- length == 0 or expr is null, null is returned
- Since:
- 3.0.6
-
getInstance
public static ForEach getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end)
Returns an instance that represents the iterator for the specified collection, or null if expr is null or empty.- Parameters:
expr
- an array of expressions. There are two formats.- length == 1: it iterates thru the content of expr[0]. For example, if expr[0] is an array, all items in this array will be iterated.
- length > 1, it will iterate thru expr[0]
- length == 0 or expr is null, null is returned
- Since:
- 3.0.6
-
getInstance
public static ForEach getInstance(EvaluatorRef evalr, Component comp, ExValue[] expr, ExValue begin, ExValue end, ExValue step)
Returns an instance that represents the iterator for the specified collection.- Parameters:
expr
- an array of expressions. There are two formats.- length == 1: it iterates thru the content of expr[0]. For example, if expr[0] is an array, all items in this array will be iterated.
- length > 1, it will iterate thru expr[0]
- length == 0 or expr is null, null is returned
- Since:
- 8.0.0
-
getInstance
public static ForEach getInstance(EvaluatorRef evalr, Page page, ExValue[] expr, ExValue begin, ExValue end, ExValue step)
Returns an instance that represents the iterator for the specified collection, or null if expr is null or empty.- Parameters:
expr
- an array of expressions. There are two formats.- length == 1: it iterates thru the content of expr[0]. For example, if expr[0] is an array, all items in this array will be iterated.
- length > 1, it will iterate thru expr[0]
- length == 0 or expr is null, null is returned
- Since:
- 8.0.0
-
getInstance
public static ForEach getInstance(EvaluatorRef evalr, Component comp, java.lang.String expr, java.lang.String begin, java.lang.String end)
Returns an instance that represents the iterator for the specified collection, or null if expr is null or empty.- Parameters:
expr
- an EL expression that shall return a collection of objects.- See Also:
getInstance(EvaluatorRef, Component, ExValue[], ExValue, ExValue)
-
getInstance
public static ForEach getInstance(EvaluatorRef evalr, Page page, java.lang.String expr, java.lang.String begin, java.lang.String end)
Returns an instance that represents the iterator for the specified collection, or null if expr is null or empty.- Parameters:
expr
- an EL expression that shall return a collection of objects.- Since:
- 3.0.0
- See Also:
getInstance(EvaluatorRef, Page, ExValue[], ExValue, ExValue)
-
-