|
|||||||||||
| 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.BeanRecordProvider
Simple implementation of RecordProvider that provides data records for saving
a List of Java Beans.
This class is used to implement the saveBeans(*,RecordSpec,BeanSpec)
methods in XmlManager.
Data records are created from Java Bean objects by calling the property get methods
of the objects in accordance with the Java Beans specification. Ordinary, boolean and indexed properties are supported.
See the BeanSpec documentation for more information.
BeanRecordProvider is designed to be subclassed. You can change the default implementation by calling the
setBeanRecordProviderClass method of
XmlManagerStore, and providing a subclass of BeanRecordProvider.
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 |
iBeanIndex
Index of current bean in List. |
protected List |
iBeans
List of Beans. |
protected BeanSpec |
iBeanSpec
BeanSpec specification object defining the properties of the beans to save. |
protected boolean |
iUseDefault
If a data field is invalid, use the default value of the property for that field data type. |
static String |
PROP_Bean_useDefault
Specify that invalid data fields have the default value for their data type (name for XmlSpec.setProperty: Bean.useDefault). |
| Fields inherited from class com.ricebridge.xmlman.RecordProviderSupport |
iFieldNames |
| Constructor Summary | |
BeanRecordProvider()
Create uninitialised for use with setBeans(java.util.List). |
|
BeanRecordProvider(List pData)
Create using a List of Java Beans to save. |
|
| Method Summary | |
boolean |
hasNextRecordImpl()
Check if there are any beans left. |
String[] |
nextRecordImpl()
Return data fields of next bean as a String[] array. |
void |
setBeans(List pBeans)
Set the Java Beans to save. |
void |
setBeanSpec(BeanSpec pBeanSpec)
Set the BeanSpec object that defines the beans to save. |
protected void |
setXmlSpecImpl(XmlSpec pXmlSpec)
Handle property settings for saving Java Beans. |
void |
startProcessImpl()
Start the load 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_Bean_useDefault
XmlSpec.setProperty: Bean.useDefault).
protected List iBeans
List of Beans.
protected int iBeanIndex
List.
protected BeanSpec iBeanSpec
BeanSpec specification object defining the properties of the beans to save.
protected boolean iUseDefault
| Constructor Detail |
public BeanRecordProvider()
setBeans(java.util.List).
public BeanRecordProvider(List pData)
List of Java Beans to save.
| Method Detail |
public void setBeans(List pBeans)
public void setBeanSpec(BeanSpec pBeanSpec)
BeanSpec object that defines the beans to save.
The BeanSpec object contains the definitions of the
bean properties and performs the conversion from internal Java data types to String values.
pBeanSpec - BeanSpec definition of beans to saveprotected void setXmlSpecImpl(XmlSpec pXmlSpec)
You can change these using XmlSpec.
setXmlSpecImpl in class RecordProviderSupportpXmlSpec - XML specificationRecordListener.setXmlSpec(com.ricebridge.xmlman.XmlSpec),
PROP_Bean_useDefaultpublic void startProcessImpl()
Performs some sanity checks on the saving setup.
startProcessImpl in class RecordProviderSupportRecordProviderSupport.startProcess(),
RecordProvider.startProcess()public boolean hasNextRecordImpl()
hasNextRecordImpl in class RecordProviderSupportRecordProviderSupport.hasNextRecord(),
RecordProvider.hasNextRecord()public 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 | ||||||||||