|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.data.DataSource
org.formaria.data.pojo.PojoDataSource
public class PojoDataSource
A data source for working with POJOs. When the application is loaded the
datasources are instantiated and in the case of a PojoDataSource the
PojoRoot instance specified by the root element is
instantiated and configured. The configuration project involves traversing
the class hierarchy and setting up PojoModel nodes or proxies for each class
in the pojo hierarchy. The configuration can specify naming overrides if the
names established by reflection are not suitable
Copyright (c) Formaria Ltd., 2008
License: see license.txt
| Field Summary | |
|---|---|
protected java.util.Hashtable |
adapters
|
protected java.util.Hashtable |
overrides
|
protected PojoContext |
pojoContext
|
protected DataModel |
pojoRootModel
|
| Fields inherited from class org.formaria.data.DataSource |
|---|
currentProject |
| Constructor Summary | |
|---|---|
PojoDataSource(Project project)
Creates a new instance of PojoDataSource |
|
| Method Summary | |
|---|---|
protected PojoAdapter |
createAdapter(java.lang.Class pojoClass)
Creates and returns a new instance of PojoAdapter |
protected PojoModel |
createPojoModel(DataModel parent,
java.lang.Object pojo)
Creates and returns a new instance of PojoModel |
protected PojoModel |
createPojoModel(DataModel parent,
java.lang.String subPath)
Creates and returns a new instance of PojoModel |
protected PojoAdapter |
createProxyAdapter(java.lang.reflect.Proxy proxy)
Creates and returns a new instance of PojoAdapter |
protected void |
customizeProperty(PojoAdapter adapter,
XmlElement propertyElement)
|
PojoAdapter |
getAdapter(java.lang.Object pojo)
|
protected XmlElement |
getOverrideXml(PojoAdapter adapter)
Gets the xml element describing overrides of the class being adapted by the specified adapter. |
PojoContext |
getPojoContext()
Returns the pojo context object |
protected PojoContext |
instantiatePojoContext(java.lang.String className,
java.lang.ClassLoader classLoader)
Creates and returns new PojoContext object |
void |
loadTable(XmlElement source,
DataModel model)
Recursively load the model data |
protected void |
overrideAdapter(PojoAdapter adapter)
Override the adapter specification loaded via reflection and add the customization specified by the configuration |
| Methods inherited from class org.formaria.data.DataSource |
|---|
outputModel, outputModel, outputModel, read, read, readDataSource, setUseValueAsId, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PojoContext pojoContext
protected DataModel pojoRootModel
protected java.util.Hashtable overrides
protected java.util.Hashtable adapters
| Constructor Detail |
|---|
public PojoDataSource(Project project)
project - the owner project| Method Detail |
|---|
public PojoContext getPojoContext()
protected PojoContext instantiatePojoContext(java.lang.String className,
java.lang.ClassLoader classLoader)
throws java.lang.Exception
className - the name of the class whose instance
should be returnedclassLoader - class loader object to load the
specified class definition
java.lang.Exception
public void loadTable(XmlElement source,
DataModel model)
loadTable in class DataSourcesource - the source elementmodel - the model for the source elementpublic PojoAdapter getAdapter(java.lang.Object pojo)
protected PojoAdapter createAdapter(java.lang.Class pojoClass)
PojoAdapter
pojoClass - pojoClass class to be adapted
by the returned adapter
protected PojoAdapter createProxyAdapter(java.lang.reflect.Proxy proxy)
PojoAdapter
pojoClass - pojoClass class to be adapted
by the returned adapter
protected PojoModel createPojoModel(DataModel parent,
java.lang.String subPath)
PojoModel
parent - the parent model of the node
which is to be createdsubpath - String consisting of pojo properties,
which must be in the format: propertyName(arguments...)[idx]
protected PojoModel createPojoModel(DataModel parent,
java.lang.Object pojo)
PojoModel
parent - the parent model node
protected XmlElement getOverrideXml(PojoAdapter adapter)
adapter - the adapter object
protected void overrideAdapter(PojoAdapter adapter)
adapter - the adapter being customized
protected void customizeProperty(PojoAdapter adapter,
XmlElement propertyElement)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||