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