// SampleJavaStore.java package sample; import com.elixirtech.data2.DataException; import com.elixirtech.data2.DataGroup; import com.elixirtech.data2.DataListener; import com.elixirtech.data2.DataRecord; import com.elixirtech.data2.IDataSource; /** * In order to implement a custom DataStore you need to implement * the DataListener interface. This interface will be called from * the Data engine to supply records. For example, if there are * three records then you might receive: *
 * startData
 * processRecord 1
 * processRecord 2
 * processRecord 3
 * endData
 * 
* If the data is grouped, you might receive: *
 * startData
 * startGroup 1
 * processRecord 1
 * processRecord 2
 * endGroup 1
 * startGroup 2
 * processRecord 3
 * endGroup 2
 * endData
 * 
* Calls to startGroup and endGroup may be nested depending on the * number of fields that are grouped. */ public class SampleJavaStore implements DataListener { /** * This method is invoked when the data is ready to be sent * @param The datasource that is supplying the data. */ public void startData(IDataSource src) throws DataException { System.out.println("start data"); } /** * This method is invoked whenever a new group of records * is about to begin. * @param group The group that is about to begin */ public void startGroup(DataGroup group) throws DataException { System.out.println("start group " + group.getLevel() + " : " + group.getName()); } /** * This method is called once for each record sent by the datasource. * @param record The record to be processed * @return True to continue processing records, false to terminate */ public boolean processRecord(DataRecord record) throws DataException { Object[] data = record.getData(); for (int i=0;i