|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.data.DataSource
org.formaria.editor.data.pojo.PojoDataSourceEx
public class PojoDataSourceEx
A data source for working with POJOs in the data visualiser.
Copyright (c) Formaria Ltd., 2001-2007, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.
| Field Summary | |
|---|---|
protected java.util.Hashtable |
adapters
|
protected static java.lang.String[] |
GETTER_PREFIXES
|
protected java.util.ArrayList |
modelListeners
|
protected java.util.Hashtable |
overrides
|
protected java.lang.Object |
pojoContext
|
protected DataModel |
pojoRootModel
|
protected PropertiesRetriever |
propertiesRetriever
|
protected static java.lang.String[] |
SETTER_PREFIXES
|
| Fields inherited from class org.formaria.data.DataSource |
|---|
currentProject |
| Constructor Summary | |
|---|---|
PojoDataSourceEx(Project project)
Creates new instance of PojoDataSource |
|
| Method Summary | |
|---|---|
PojoModelVis |
adaptPojo(java.lang.Class pojoClass,
java.lang.String propertyName,
DataModel parentNode)
Adapts the transient pojo of the specified type. |
PojoModelVis |
adaptPojo(java.lang.reflect.Method getter,
java.lang.reflect.Method setter,
java.lang.String propertyName,
DataModel parentNode)
Adapts the POJO returned by method invoked on a parent
object. |
PojoModelVis |
adaptPojo(java.lang.Object pojo,
DataModel parentNode)
Adapt a POJO for use in the model, applying any overrides to the POJO's API defined in the data source's configuration file (by default pojo.xml) |
protected PojoAdapterEx |
createAdapter(java.lang.Class pojoClass)
Creates a new instance of PojoAdapterEx |
protected void |
customizeProperty(PojoAdapterEx adapter,
XmlElement propertyElement)
|
PojoAdapterEx |
getAdapter(java.lang.Class pojoClass)
Gets the adapter for the specified class |
protected static java.lang.String |
getDispValue(java.lang.Object pojo)
Gets the pojo caption that will appear in the visualiser tree node. |
java.lang.Object |
getPojoContext()
Returns the pojo context object. |
protected ProjectClassLoader |
getProjectClassLoader()
Returns the class loader being used to load current project's classes. |
PropertiesRetriever |
getPropertiesRetriever()
Returns the finder arguments values holder. |
static boolean |
getterSupported(java.lang.reflect.Method method,
boolean prefixes)
Determines whether the passed getter is supported |
void |
loadTable(XmlElement source,
DataModel model)
Recursively load the model data |
protected void |
overrideAdapter(PojoAdapterEx adapter)
Overrides the adapter, adds the customization specified by the configuration. |
static boolean |
setterSupported(java.lang.reflect.Method method,
boolean prefixes)
Determines whether the passed setter method is supported |
| 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 static final java.lang.String[] GETTER_PREFIXES
protected static final java.lang.String[] SETTER_PREFIXES
protected PropertiesRetriever propertiesRetriever
protected java.lang.Object pojoContext
protected DataModel pojoRootModel
protected java.util.Hashtable overrides
protected java.util.Hashtable adapters
protected java.util.ArrayList modelListeners
| Constructor Detail |
|---|
public PojoDataSourceEx(Project project)
project - the owning project| Method Detail |
|---|
public PropertiesRetriever getPropertiesRetriever()
public java.lang.Object getPojoContext()
public PojoAdapterEx getAdapter(java.lang.Class pojoClass)
pojoClass - the class whose adapter is
to be returned
protected PojoAdapterEx createAdapter(java.lang.Class pojoClass)
pojoClass - the class to be adaptedprotected void overrideAdapter(PojoAdapterEx adapter)
adapter - the adapter to be customized
protected void customizeProperty(PojoAdapterEx adapter,
XmlElement propertyElement)
public PojoModelVis adaptPojo(java.lang.Object pojo,
DataModel parentNode)
pojo - the object being adaptedparentNode - the parent model node
public PojoModelVis adaptPojo(java.lang.reflect.Method getter,
java.lang.reflect.Method setter,
java.lang.String propertyName,
DataModel parentNode)
method invoked on a parent
object.
parentNode - parent model nodemethod - the Method that returns the pojo which is to be adapted
public PojoModelVis adaptPojo(java.lang.Class pojoClass,
java.lang.String propertyName,
DataModel parentNode)
pojoClass - the type of the underlying pojopropertyName - the name of the transient propertyparentNode - parent model node
public static boolean getterSupported(java.lang.reflect.Method method,
boolean prefixes)
method - the Method to be checkedprefixes - indicates whether the getter prefixes should be checked
public static boolean setterSupported(java.lang.reflect.Method method,
boolean prefixes)
method - the method to be queriedprefixes - indicates whether the getter prefixes should be checked
protected static java.lang.String getDispValue(java.lang.Object pojo)
pojo - Object
protected ProjectClassLoader getProjectClassLoader()
public void loadTable(XmlElement source,
DataModel model)
loadTable in class DataSourcesource - the source elementmodel - the model node for the source element
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||