1 5 package org.exoplatform.faces.core.component.model; 6 7 import java.util.Collection ; 8 import java.util.Iterator ; 9 15 abstract public class CollectionDataHandler implements DataHandler { 16 protected Collection datas_ ; 17 protected Iterator iterator_ ; 18 19 public CollectionDataHandler() { 20 } 21 22 public CollectionDataHandler setDatas(Collection datas) { 23 datas_ = datas ; 24 return this ; 25 } 26 27 public void begin() { iterator_ = datas_.iterator(); } 28 public void end() { iterator_ = null ; } 29 30 public boolean nextRow() { 31 boolean test = iterator_.hasNext(); 32 if(test) { 33 setCurrentObject(iterator_.next()) ; 34 } 35 return test ; 36 } 37 38 public Object getCurrentObject() { return iterator_.next() ; } 39 public String getCurrentObjectId() { return null ; } 40 } | Popular Tags |