com.ricebridge.xmlman
Class RecordProviderSupport

java.lang.Object
  extended bycom.ricebridge.xmlman.RecordProviderSupport
All Implemented Interfaces:
RecordProvider
Direct Known Subclasses:
BeanRecordProvider, PerformanceTestFileMaker.RandomValueRecordProvider, ResultSetRecordProvider, SaveRecordProviderTest.SimpleRecordProvider, StringArrayRecordProvider, StringListRecordProvider, TableModelRecordProvider

public abstract class RecordProviderSupport
extends Object
implements RecordProvider

Helper class for implementing the RecordProvider interface.

Use of this class will help ensure future compatibility with any XML Manager API changes. Subclasses should implement the *Impl methods (for example, hasNextRecordImpl) rather than the declared interface methods such as hasNextRecord. See the RecordProvider interface documentation for a description of the calling sequence of the methods in this class.

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


Field Summary
protected  String[] iFieldNames
          Record specification field names, if specified in the RecordSpec object.
 
Constructor Summary
RecordProviderSupport()
           
 
Method Summary
 void endProcess()
          Helper implementation of RecordProvider.endProcess.
protected  void endProcessImpl()
          Implement this method to receive notification that the saving of XML data has ended.
 boolean hasNextRecord()
          Helper implementation of RecordProvider.hasNextRecord.
protected abstract  boolean hasNextRecordImpl()
          Return true if there are more data records to save.
 String[] nextRecord()
          Helper implementation of RecordProvider.nextRecord.
protected abstract  String[] nextRecordImpl()
          Indicates that the next data record is to be saved.
 void setFieldNames(String[] pFieldNames)
          Helper implementation of RecordProvider.setFieldNames.
protected  void setFieldNamesImpl(String[] pFieldNames)
          Implement this method to obtain the record specification field names, if available.
 void setXmlSpec(XmlSpec pXmlSpec)
          Helper implementation of RecordProvider.setXmlSpec.
protected  void setXmlSpecImpl(XmlSpec pXmlSpec)
          Implement this method to receive the current XmlSpec settings.
 void startProcess()
          Helper implementation of RecordProvider.startProcess.
protected  void startProcessImpl()
          Implement this method to receive notification that the saving of XML data is about to start.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iFieldNames

protected String[] iFieldNames
Record specification field names, if specified in the RecordSpec object. NOTE: may be empty.

Constructor Detail

RecordProviderSupport

public RecordProviderSupport()
Method Detail

setXmlSpec

public void setXmlSpec(XmlSpec pXmlSpec)
Helper implementation of RecordProvider.setXmlSpec. Subclasses should implement setXmlSpecImpl.

Specified by:
setXmlSpec in interface RecordProvider
Parameters:
pXmlSpec - XmlSpec object

setFieldNames

public void setFieldNames(String[] pFieldNames)
Helper implementation of RecordProvider.setFieldNames. Subclasses should implement setFieldNamesImpl.

Specified by:
setFieldNames in interface RecordProvider
Parameters:
pFieldNames - String[] of field names

startProcess

public void startProcess()
Helper implementation of RecordProvider.startProcess. Subclasses should implement startProcessImpl.

Specified by:
startProcess in interface RecordProvider

hasNextRecord

public boolean hasNextRecord()
Helper implementation of RecordProvider.hasNextRecord. Sub classes should implement hasNextRecordImpl.

Specified by:
hasNextRecord in interface RecordProvider

nextRecord

public String[] nextRecord()
Helper implementation of RecordProvider.nextRecord. Sub classes should implement nextRecordImpl.

Specified by:
nextRecord in interface RecordProvider

endProcess

public void endProcess()
Helper implementation of RecordProvider.endProcess. Subclasses should implement endProcessImpl.

Specified by:
endProcess in interface RecordProvider

setXmlSpecImpl

protected void setXmlSpecImpl(XmlSpec pXmlSpec)
Implement this method to receive the current XmlSpec settings.

This method is optional for subclasses, as an empty implementation is provided here.

Parameters:
pXmlSpec - XML specification
See Also:
setXmlSpec(com.ricebridge.xmlman.XmlSpec), RecordProvider.setXmlSpec(com.ricebridge.xmlman.XmlSpec)

setFieldNamesImpl

protected void setFieldNamesImpl(String[] pFieldNames)
Implement this method to obtain the record specification field names, if available.

The default implementation stores the field names in the iFieldNames member variable. This method is optional for subclasses, as an implementation is provided here.

Parameters:
pFieldNames - record field names
See Also:
setFieldNames(java.lang.String[]), RecordProvider.setFieldNames(java.lang.String[])

startProcessImpl

protected void startProcessImpl()
Implement this method to receive notification that the saving of XML data is about to start.

This method is optional for subclasses, as an empty implementation is provided here.

See Also:
startProcess(), RecordProvider.startProcess()

hasNextRecordImpl

protected abstract boolean hasNextRecordImpl()
Return true if there are more data records to save.

This method must be implemented by subclasses.

See Also:
hasNextRecord(), RecordProvider.hasNextRecord()

nextRecordImpl

protected abstract String[] nextRecordImpl()
Indicates that the next data record is to be saved.

This method must be implemented by subclasses.

See Also:
nextRecord(), RecordProvider.nextRecord()

endProcessImpl

protected void endProcessImpl()
Implement this method to receive notification that the saving of XML data has ended.

This method is optional for subclasses, as an empty implementation is provided here.

See Also:
endProcess(), RecordProvider.endProcess()


Copyright © 2004-2005 Ricebridge