com.ricebridge.xmlman
Class ResultSetRecordListener

java.lang.Object
  extended bycom.ricebridge.xmlman.RecordListenerSupport
      extended bycom.ricebridge.xmlman.ResultSetRecordListener
All Implemented Interfaces:
RecordListener
Direct Known Subclasses:
BackgroundTest.DelayedResultSetRecordListener, PerformanceTest.MeasureResultSetRecordListener

public class ResultSetRecordListener
extends RecordListenerSupport

Implementation of RecordListener that stores data records as a ResultSet.

This class is used to implement the loadResultSet(*,RecordSpec) methods in XmlManager. It uses the XmlResultSet class to provide data using a ResultSet interface.

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

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


Field Summary
protected  XmlResultSet iResultSet
          XmlResultSet is an implementation of ResultSet.
static String PROP_ResultSet_dataHasHeaders
          First record specifies header names (name for XmlSpec.setProperty: ResultSet.dataHasHeaders).
 
Fields inherited from class com.ricebridge.xmlman.RecordListenerSupport
iFieldNames
 
Constructor Summary
ResultSetRecordListener()
          Constructor with no parameters required for creating new objects in XmlManagerStore.newResultSetRecordListener.
 
Method Summary
 ResultSet getResultSet()
          Get the data records as a ResultSet.
protected  BadRecord handleRecordImpl(String[] pRecord, long pRecordNumber)
          Store the data record String[].
protected  void setFieldNamesImpl(String[] pFieldNames)
          Set the field names of the XPath expressions.
protected  void setXmlSpecImpl(XmlSpec pXmlSpec)
          Handle property settings for loading ResultSets.
 String toString()
          Return a textual description suitable for debugging.
 
Methods inherited from class com.ricebridge.xmlman.RecordListenerSupport
endProcess, endProcessImpl, handleRecord, setFieldNames, setXmlSpec, startProcess, startProcessImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_ResultSet_dataHasHeaders

public static final String PROP_ResultSet_dataHasHeaders
First record specifies header names (name for XmlSpec.setProperty: ResultSet.dataHasHeaders).

See Also:
Constant Field Values

iResultSet

protected XmlResultSet iResultSet
XmlResultSet is an implementation of ResultSet.

Constructor Detail

ResultSetRecordListener

public ResultSetRecordListener()
Constructor with no parameters required for creating new objects in XmlManagerStore.newResultSetRecordListener.

Method Detail

getResultSet

public ResultSet getResultSet()
Get the data records as a ResultSet.

Returns:
ResultSet instance

toString

public String toString()
Return a textual description suitable for debugging.


setXmlSpecImpl

protected void setXmlSpecImpl(XmlSpec pXmlSpec)
Handle property settings for loading ResultSets.

You can change these using XmlSpec.

Overrides:
setXmlSpecImpl in class RecordListenerSupport
Parameters:
pXmlSpec - XML specification
See Also:
RecordListener.setXmlSpec(com.ricebridge.xmlman.XmlSpec), PROP_ResultSet_dataHasHeaders

setFieldNamesImpl

protected void setFieldNamesImpl(String[] pFieldNames)
Set the field names of the XPath expressions.

These will be used as the table column headers.

Overrides:
setFieldNamesImpl in class RecordListenerSupport
Parameters:
pFieldNames - data record field names
See Also:
RecordListener.setFieldNames(java.lang.String[])

handleRecordImpl

protected BadRecord handleRecordImpl(String[] pRecord,
                                     long pRecordNumber)
Store the data record String[].

Specified by:
handleRecordImpl in class RecordListenerSupport
Parameters:
pRecord - record data as a String[]
pRecordNumber - current count of records
See Also:
RecordListener.handleRecord(java.lang.String[], long)


Copyright © 2004-2005 Ricebridge