1 5 package org.exoplatform.faces.core.component.model; 6 import java.util.List ; 7 13 abstract public class ListDataHandler implements DataHandler { 14 protected List datas_; 15 protected int currentRow_; 16 17 public ListDataHandler() { 18 19 } 20 21 public ListDataHandler setDatas(List datas) { 22 datas_ = datas; 23 return this; 24 } 25 26 public void begin() { 27 currentRow_ = -1; 28 } 29 30 public void end() { 31 } 32 33 public boolean nextRow() { 34 currentRow_++; 35 if (datas_ != null) { 36 if (currentRow_ < datas_.size()) { 37 setCurrentObject(datas_.get(currentRow_)); 38 return true; 39 } 40 } 41 return false; 42 } 43 44 public int getCurrentRow() { return currentRow_; } 45 46 public Object getCurrentObject() { return datas_.get(currentRow_); } 47 48 public String getCurrentObjectId() { return null; } 49 50 public Object getObject(int index) { return datas_.get(index); } 51 52 public List getDatas() { return datas_ ; } 53 } | Popular Tags |