|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ricebridge.xmlman.RecordProviderSupport
com.ricebridge.xmlman.TableModelRecordProvider
An implementation of RecordProvider that provides data records for saving
from a TableModel object.
This class is used to implement the
saveTableModel(*,RecordSpec,TableModel)
methods in XmlManager.
It simply reads the next data record from the specified TableModel,
maintaining an internal index of the current record.
TableModelRecordProvider is designed to be subclassed. You can change the default implementation by calling the
setTableModelRecordProviderClass method of
XmlManagerStore, and providing a subclass of TableModelRecordProvider.
XmlManagerStore can be accessed using XmlManager.getXmlManagerStore().
The Source Code of this Java class is available under a BSD-style license.
| Field Summary | |
protected int |
iFieldCount
Number of data fields in record, determined by number of columns in table. |
protected boolean |
iFirstRecord
Indicate that internal state is at the first record. |
protected String[] |
iHeaders
Table headers. |
protected long |
iRecordIndex
Index of current record. |
protected boolean |
iSaveHeaders
Save the table headers as first data record. |
protected TableModel |
iTableModel
TableModel containing source data. |
static String |
PROP_TableModel_saveHeaders
Output headers as first data record (name for XmlSpec.setProperty: TableModel.saveHeaders). |
| Fields inherited from class com.ricebridge.xmlman.RecordProviderSupport |
iFieldNames |
| Constructor Summary | |
TableModelRecordProvider()
Create uninitialised for use with setTableModel. |
|
TableModelRecordProvider(TableModel pTableModel)
Create initialised. |
|
| Method Summary | |
protected boolean |
hasNextRecordImpl()
Check if there are any more records. |
protected String[] |
nextRecordImpl()
Return next data record as a String[] array. |
void |
setTableModel(TableModel pTableModel)
Set the TableModel providing data to save. |
protected void |
setXmlSpecImpl(XmlSpec pXmlSpec)
Handle property settings for saving TableModels. |
protected void |
startProcessImpl()
Start the saving process. |
| Methods inherited from class com.ricebridge.xmlman.RecordProviderSupport |
endProcess, endProcessImpl, hasNextRecord, nextRecord, setFieldNames, setFieldNamesImpl, setXmlSpec, startProcess |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String PROP_TableModel_saveHeaders
XmlSpec.setProperty: TableModel.saveHeaders).
protected TableModel iTableModel
TableModel containing source data.
protected boolean iSaveHeaders
setXmlSpecImpl.
protected String[] iHeaders
protected boolean iFirstRecord
protected int iFieldCount
protected long iRecordIndex
| Constructor Detail |
public TableModelRecordProvider()
setTableModel.
public TableModelRecordProvider(TableModel pTableModel)
setTableModel for details.
pTableModel - TableModel providing data| Method Detail |
public void setTableModel(TableModel pTableModel)
TableModel providing data to save.
The default number of fields per record is taken from
TableModel.getColumnCount()
and the headers (output as the first record when the TableModel.saveHeaders property is true),
are taken from TableModel.getColumnName(int).
pTableModel - TableModel providing dataprotected void setXmlSpecImpl(XmlSpec pXmlSpec)
TableModels.
You can change these using XmlSpec.
setXmlSpecImpl in class RecordProviderSupportpXmlSpec - XML specificationRecordListener.setXmlSpec(com.ricebridge.xmlman.XmlSpec),
PROP_TableModel_saveHeadersprotected void startProcessImpl()
startProcessImpl in class RecordProviderSupportRecordProviderSupport.startProcess(),
RecordProvider.startProcess()protected boolean hasNextRecordImpl()
hasNextRecordImpl in class RecordProviderSupportRecordProviderSupport.hasNextRecord(),
RecordProvider.hasNextRecord()protected String[] nextRecordImpl()
String[] array.
nextRecordImpl in class RecordProviderSupportRecordProviderSupport.nextRecord(),
RecordProvider.nextRecord()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||