|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.xoetrope.data.XDataSource
net.xoetrope.optional.data.pojo.XPojoDataSource
public class XPojoDataSource
A data source for working with POJOs. When the application is loaded the
datasources are instantiated and in the case of a XPojoDataSource the
XPojoRoot instance specified by the root
element is
instantiated and configured. The configuration project involves traversing
the class hierarchy and setting up XPojoModel 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) Xoetrope Ltd., 2001-2006
License: see license.txt
Field Summary | |
---|---|
protected java.util.Hashtable |
adapters
|
protected java.util.Hashtable |
overrides
|
protected XPojoContext |
pojoContext
|
protected XModel |
pojoRootModel
|
Fields inherited from class net.xoetrope.data.XDataSource |
---|
currentProject |
Constructor Summary | |
---|---|
XPojoDataSource(XProject project)
Creates a new instance of XPojoDataSource |
Method Summary | |
---|---|
protected XPojoAdapter |
createAdapter(java.lang.Class pojoClass)
Creates and returns a XPojoAdpater |
protected XPojoModel |
createPojoModel(XModel parent,
java.lang.Object pojo)
Creates and returns a new instance of XPojoModel |
protected XPojoModel |
createPojoModel(XModel parent,
java.lang.String subPath)
Creates and returns a new instance of XPojoModel |
protected void |
customizeProperty(XPojoAdapter adapter,
XmlElement propertyElement)
|
XPojoAdapter |
getAdapter(java.lang.Object pojo)
Gets the adapter for the specified POJO |
XPojoContext |
getPojoContext()
Returns the pojo context object |
protected XPojoContext |
instantiatePojoContext(java.lang.String className,
java.lang.ClassLoader classLoader)
Creates and returns new XPojoContext object |
void |
loadTable(XmlElement source,
XModel model)
Recursively load the model data |
protected void |
overrideAdapter(XPojoAdapter adapter)
Override the adapter specification loaded via reflection and add the customization specified by the configuration |
Methods inherited from class net.xoetrope.data.XDataSource |
---|
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 XPojoContext pojoContext
protected XModel pojoRootModel
protected java.util.Hashtable overrides
protected java.util.Hashtable adapters
Constructor Detail |
---|
public XPojoDataSource(XProject project)
project
- the owner projectMethod Detail |
---|
public XPojoContext getPojoContext()
protected XPojoContext instantiatePojoContext(java.lang.String className, java.lang.ClassLoader classLoader) throws java.lang.Exception
className
- the name of the class, the instance of which
should be returnedclassLoader
- class loader object to load the
specified class definition
java.lang.Exception
public void loadTable(XmlElement source, XModel model)
loadTable
in class XDataSource
source
- the source elementmodel
- the model for the source elementpublic XPojoAdapter getAdapter(java.lang.Object pojo)
pojo
- the object for which the adapter is
to be returned
protected XPojoAdapter createAdapter(java.lang.Class pojoClass)
XPojoAdpater
pojoClass
- pojoClass class to be adapted
by the returned adapter
protected XPojoModel createPojoModel(XModel parent, java.lang.String subPath)
parent
- the parent model of the model node
which is to be createdsubpath
- String consisting of pojo properties,
must be in the format: propertyName(arguments...)[idx]
protected XPojoModel createPojoModel(XModel parent, java.lang.Object pojo)
XPojoModel
parent
- the parent model node
protected void overrideAdapter(XPojoAdapter adapter)
adapter
- the adapter being customizedprotected void customizeProperty(XPojoAdapter adapter, XmlElement propertyElement)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |