com.ricebridge.xmlman
Class StringArrayRecordProvider

java.lang.Object
  extended bycom.ricebridge.xmlman.RecordProviderSupport
      extended bycom.ricebridge.xmlman.StringArrayRecordProvider
All Implemented Interfaces:
RecordProvider
Direct Known Subclasses:
BackgroundTest.DelayedStringArrayRecordProvider

public class StringArrayRecordProvider
extends RecordProviderSupport

Simple implementation of RecordProvider that provides data records for saving from a List of String[] arrays.

This class is used to implement the save(*,RecordSpec,List) methods in XmlManager. It simply reads the next data record from the List of String[] arrays, maintaining an internal index of the current record.

StringArrayRecordProvider is designed to be subclassed. You can change the default implementation by calling the setStringArrayRecordProviderClass method of XmlManagerStore, and providing a subclass of StringArrayRecordProvider. XmlManagerStore can be accessed using XmlManager.getXmlManagerStore().

The Source Code of this Java class is available under a BSD-style license.


Field Summary
protected  List iData
          List of String[].
protected  int iRecordIndex
          Index of current record in List.
 
Fields inherited from class com.ricebridge.xmlman.RecordProviderSupport
iFieldNames
 
Constructor Summary
StringArrayRecordProvider()
          Create uninitialised for use with setData(java.util.List).
StringArrayRecordProvider(List pData)
          Create with data records as List of String[].
 
Method Summary
protected  boolean hasNextRecordImpl()
          Check if there are any more records.
protected  String[] nextRecordImpl()
          Return next data record as a String[] array.
 void setData(List pData)
          Set data records to save as List of String[].
protected  void startProcessImpl()
          Start the saving process.
 
Methods inherited from class com.ricebridge.xmlman.RecordProviderSupport
endProcess, endProcessImpl, hasNextRecord, nextRecord, setFieldNames, setFieldNamesImpl, setXmlSpec, setXmlSpecImpl, startProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iData

protected List iData
List of String[].


iRecordIndex

protected int iRecordIndex
Index of current record in List.

Constructor Detail

StringArrayRecordProvider

public StringArrayRecordProvider()
Create uninitialised for use with setData(java.util.List).


StringArrayRecordProvider

public StringArrayRecordProvider(List pData)
Create with data records as List of String[].

Method Detail

setData

public void setData(List pData)
Set data records to save as List of String[].


startProcessImpl

protected void startProcessImpl()
Start the saving process.

Overrides:
startProcessImpl in class RecordProviderSupport
See Also:
RecordProviderSupport.startProcess(), RecordProvider.startProcess()

hasNextRecordImpl

protected boolean hasNextRecordImpl()
Check if there are any more records.

Specified by:
hasNextRecordImpl in class RecordProviderSupport
See Also:
RecordProviderSupport.hasNextRecord(), RecordProvider.hasNextRecord()

nextRecordImpl

protected String[] nextRecordImpl()
Return next data record as a String[] array.

Specified by:
nextRecordImpl in class RecordProviderSupport
See Also:
RecordProviderSupport.nextRecord(), RecordProvider.nextRecord()


Copyright © 2004-2005 Ricebridge