com.ricebridge.xmlman
Class StringListRecordProvider

java.lang.Object
  extended bycom.ricebridge.xmlman.RecordProviderSupport
      extended bycom.ricebridge.xmlman.StringListRecordProvider
All Implemented Interfaces:
RecordProvider
Direct Known Subclasses:
BackgroundTest.DelayedStringListRecordProvider, CallSequenceTest.SequenceRecordProvider

public class StringListRecordProvider
extends RecordProviderSupport

Implementation of RecordProvider that provides data records for saving from a List of Lists of Strings.

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

StringListRecordProvider is designed to be subclassed. You can change the default implementation by calling the setStringListRecordProviderClass method of XmlManagerStore, and providing a subclass of StringListRecordProvider. 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
StringListRecordProvider()
          Create uninitialised for use with setData(java.util.List).
StringListRecordProvider(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

StringListRecordProvider

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


StringListRecordProvider

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

Method Detail

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()

setData

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



Copyright © 2004-2005 Ricebridge