|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ricebridge.xmlman.RecordListenerSupport
Helper class for implementing the RecordListener interface.
Use of this class will help ensure future compatibility with any XML Manager API changes.
Subclasses should implement the *Impl methods (for example, handleRecordImpl)
rather than the declared interface methods such as handleRecord.
See the RecordListener 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 associated with this RecordListener. |
| Constructor Summary | |
RecordListenerSupport()
|
|
| Method Summary | |
void |
endProcess()
Helper implementation of RecordListener.endProcess. |
protected void |
endProcessImpl()
Implement this method to receive notification that the saving of XML data has ended. |
BadRecord |
handleRecord(String[] pRecord,
long pRecordNumber)
Helper implementation of RecordListener.handleRecord. |
protected abstract BadRecord |
handleRecordImpl(String[] pRecord,
long pRecordNumber)
Implement this method to receive record data as it parsed. |
void |
setFieldNames(String[] pFieldNames)
Helper implementation of RecordListener.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 RecordListener.setXmlSpec. |
protected void |
setXmlSpecImpl(XmlSpec pXmlSpec)
Implement this method to receive the current XmlSpec settings. |
void |
startProcess()
Helper implementation of RecordListener.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 |
protected String[] iFieldNames
RecordSpec object associated with this RecordListener.
NOTE: may be empty.
| Constructor Detail |
public RecordListenerSupport()
| Method Detail |
public void setXmlSpec(XmlSpec pXmlSpec)
RecordListener.setXmlSpec.
Subclasses should implement setXmlSpecImpl.
setXmlSpec in interface RecordListenerpXmlSpec - XmlSpec objectpublic void setFieldNames(String[] pFieldNames)
RecordListener.setFieldNames.
Subclasses should implement setFieldNamesImpl.
setFieldNames in interface RecordListenerpFieldNames - String[] of field namespublic void startProcess()
RecordListener.startProcess.
Subclasses should implement startProcessImpl.
startProcess in interface RecordListener
public BadRecord handleRecord(String[] pRecord,
long pRecordNumber)
RecordListener.handleRecord.
Subclasses should implement handleRecordImpl.
handleRecord in interface RecordListenerpRecord - record data as a String[]pRecordNumber - current count of records
BadRecord if there was a problem, null otherwisepublic void endProcess()
RecordListener.endProcess.
Subclasses should implement endProcessImpl.
endProcess in interface RecordListener
protected void setXmlSpecImpl(XmlSpec pXmlSpec)
throws Exception
XmlSpec settings.
This method is optional for subclasses, as an empty implementation is provided here.
pXmlSpec - XML specification
ExceptionsetXmlSpec(com.ricebridge.xmlman.XmlSpec),
RecordListener.setXmlSpec(com.ricebridge.xmlman.XmlSpec)
protected void setFieldNamesImpl(String[] pFieldNames)
throws Exception
The default implementation stores the field names in the iFieldNames member variable.
This method is optional for subclasses, as an implementation is provided here.
pFieldNames - data record field names
ExceptionsetFieldNames(java.lang.String[]),
RecordListener.setFieldNames(java.lang.String[])
protected void startProcessImpl()
throws Exception
This method is optional for subclasses, as an empty implementation is provided here.
ExceptionstartProcess(),
RecordListener.startProcess()
protected abstract BadRecord handleRecordImpl(String[] pRecord,
long pRecordNumber)
throws Exception
The record number is specific to each RecordSpec.
This method must be implemented by subclasses.
pRecord - record data as a String[]pRecordNumber - current count of records
ExceptionhandleRecord(java.lang.String[], long),
RecordListener.handleRecord(java.lang.String[], long)
protected void endProcessImpl()
throws Exception
This method is optional for subclasses, as an empty implementation is provided here.
ExceptionendProcess(),
RecordListener.endProcess()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||