org.zkoss.zk.ui.util
Class ForEachImpl

java.lang.Object
  extended by org.zkoss.zk.ui.util.ForEachImpl
All Implemented Interfaces:
ForEach

public class ForEachImpl
extends java.lang.Object
implements ForEach

An implementation of ForEach.

Note: the use of ForEachImpl is different from ConditionImpl. While you could use the same instance of ConditionImpl for all evaluation, each instance of ForEachImpl can be used only once (drop it after next() returns false).

Author:
tomyeh

Constructor Summary
ForEachImpl(EvaluatorRef evalr, Component comp, java.lang.String expr, java.lang.String begin, java.lang.String end)
          Constructor.
ForEachImpl(EvaluatorRef evalr, Page page, java.lang.String expr, java.lang.String begin, java.lang.String end)
          Constructor.
 
Method Summary
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, 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.
 boolean next()
          Advanced to the next element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForEachImpl

public ForEachImpl(EvaluatorRef evalr,
                   Component comp,
                   java.lang.String expr,
                   java.lang.String begin,
                   java.lang.String end)
Constructor. In most cases, use getInstance(EvaluatorRef, Component, String, String, String) instead of this constructor.

Throws:
java.lang.IllegalArgumentException - if comp or evalr is null
Since:
3.0.0

ForEachImpl

public ForEachImpl(EvaluatorRef evalr,
                   Page page,
                   java.lang.String expr,
                   java.lang.String begin,
                   java.lang.String end)
Constructor. In most cases, use getInstance(EvaluatorRef, Component, String, String, String) instead of this constructor.

Throws:
java.lang.IllegalArgumentException - if page or evalr is null
Since:
3.0.0
Method Detail

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.

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

next

public boolean next()
Description copied from interface: ForEach
Advanced to the next element.

Specified by:
next in interface ForEach
Returns:
false if there is no more element.


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.