org.formaria.editor.data.pojo
Class PojoModelEx

java.lang.Object
  extended by org.formaria.aria.data.DataModel
      extended by org.formaria.editor.data.pojo.PojoModelVis
          extended by org.formaria.editor.data.pojo.PojoModelEx
All Implemented Interfaces:
ModelVis, TreeNodeCaption
Direct Known Subclasses:
PersistentPojoModelEx, PojoIteratorEx

public class PojoModelEx
extends PojoModelVis

DataModel supporting properties with arguments. The first child of this node is a model node representing finder arguments, if there are any.

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
static int GETTER_ATTRIBUTE
           
protected  boolean hasParameters
           
protected static java.util.Observable invocationErrorNotifier
           
protected  boolean invocationOk
           
protected  boolean isTransient
           
static int NUM_FIXED_ATTRIBUTE
           
protected  PojoMethodArgs pojoMethodArgs
           
protected  java.lang.String propertyName
           
static int SETTER_ATTRIBUTE
           
static int TRANSIENT_ATTRIBUTE
           
 
Fields inherited from class org.formaria.editor.data.pojo.PojoModelVis
adapter, ATTRIB_COMBO, ATTRIB_FREETEXT, ATTRIB_NEDITABLE, dataSource, getterSig, hashcode, ID_ATTRIBUTE, idAttrib, pojo, pojoClass, pojoCollection, pojoGetter, pojoSetter, setterSig, VALUE_ATTRIBUTE, valueAttrib
 
Fields inherited from class org.formaria.aria.data.DataModel
parentModel, tagName
 
Constructor Summary
protected PojoModelEx(DataModel pn, java.lang.Class clazz, java.lang.String propName, PojoDataSourceEx ds)
          Creates a new instance of PojoModelEx
protected PojoModelEx(DataModel pn, java.lang.reflect.Method gtr, java.lang.reflect.Method str, java.lang.String propName, PojoDataSourceEx ds)
          Creates a new instance of PojoModelEx
protected PojoModelEx(DataModel pn, java.lang.Object p, PojoDataSourceEx ds)
          Creates a new instance of PojoModelEx
 
Method Summary
 DataModel get(int i)
          Gets the DataModel object located at the i position.
 java.lang.Object get(java.lang.String element)
          Gets the value located at the specified path
 java.lang.String[] getAttribAvailableValues(int i)
           
 java.lang.String getAttribName(int i)
          Retrieve the name of the attribute at the specified index
 boolean getAttribRuntime(int i)
          Indicates whether the attribute will be available in the run-time mode.
 int getAttribType(int i)
           
 java.lang.Object getAttribValue(int i)
          Retrieve the value of the attribute at the specified index and return it.
 java.lang.String getAttribValueAsString(int i)
          Returns the value of the attribute converted to a String at the specified index
 java.util.Vector getBindingAttributes()
          Gets the list of this collection elemement's properties.
 java.lang.String getBindingPath()
          Gets the runtime binding path of this model node
 java.lang.String getId()
          Gets the id of this node
static java.util.Observable getInvocationErrorNotifier()
          Gets a method invocation error notifier
 int getNumAttributes()
          Gets the number of attributes
 int getNumChildren()
          Gets the number of children of this model node
 java.lang.Class[] getParameterTypes()
          Gets the method parameter types.
protected  java.lang.Object[] getParameterValues()
          Retrieves the method parameter values
 java.lang.Object getPojo()
          Gets pojo wrapped by this model node
 java.lang.Class getPojoClass()
           
 java.lang.String getPropertyName()
           
 boolean hasParameters()
           
 boolean isAttribEditable(int i)
           
 boolean isCollection()
          Indicates whether this model node wraps a collection.
 boolean isCollectionElement()
          Indicates whether this model node is wrapping collection's element
 boolean isTransient()
          Indicates whether the "transient" property of this mode is set.
protected  void notifyObservers(java.lang.Exception ex)
           
protected  void obtainPropertyValue()
          Obtains the underlying property value
 boolean parametersSet()
          Indicates whether all finder arguments values were set.
 void setAttribValue(int i, java.lang.Object value)
          Sets the attribute value
 void setTransient(boolean state)
          Sets the "transient" property of this model node.
 
Methods inherited from class org.formaria.editor.data.pojo.PojoModelVis
append, append, get, getAdapter, getAttribute, getAttribValueAsDouble, getAttribValueAsDouble, getAttribValueAsInt, getCaption, getProperties, getValueAsDouble, getValueAsInt, getValueAsString, hashCode, isDirty, set, set, setAttribValue, setCaption, setDirty, setId, setPojo, setPojoClass, setPojoGetter, setPojoSetter
 
Methods inherited from class org.formaria.aria.data.DataModel
addModelListener, clear, fireModelUpdated, getParent, getTagName, hasAutoId, hasAutoId, prefixOutputPath, removeChildren, reset, resetAttributes, setNumAttributes, setNumChildren, setParent, setTagName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GETTER_ATTRIBUTE

public static final int GETTER_ATTRIBUTE
See Also:
Constant Field Values

SETTER_ATTRIBUTE

public static final int SETTER_ATTRIBUTE
See Also:
Constant Field Values

TRANSIENT_ATTRIBUTE

public static final int TRANSIENT_ATTRIBUTE
See Also:
Constant Field Values

NUM_FIXED_ATTRIBUTE

public static final int NUM_FIXED_ATTRIBUTE
See Also:
Constant Field Values

hasParameters

protected boolean hasParameters

pojoMethodArgs

protected PojoMethodArgs pojoMethodArgs

propertyName

protected java.lang.String propertyName

invocationOk

protected boolean invocationOk

isTransient

protected boolean isTransient

invocationErrorNotifier

protected static java.util.Observable invocationErrorNotifier
Constructor Detail

PojoModelEx

protected PojoModelEx(DataModel pn,
                      java.lang.reflect.Method gtr,
                      java.lang.reflect.Method str,
                      java.lang.String propName,
                      PojoDataSourceEx ds)
Creates a new instance of PojoModelEx

Parameters:
ds - the data source object
p - parent POJO
fm - finder method
propName - the name of the pojo property to be wrapped
pm - the parent model node

PojoModelEx

protected PojoModelEx(DataModel pn,
                      java.lang.Class clazz,
                      java.lang.String propName,
                      PojoDataSourceEx ds)
Creates a new instance of PojoModelEx

Parameters:
pn - parent model node
clazz - the class of the underlying POJO
propName - the name of the POJO property to be wrapped
ds - the data source object that's been used to load this model node

PojoModelEx

protected PojoModelEx(DataModel pn,
                      java.lang.Object p,
                      PojoDataSourceEx ds)
Creates a new instance of PojoModelEx

Parameters:
ds - data source object
p - POJO to be wrapped by this object
pn - parent model node
Method Detail

getPojoClass

public java.lang.Class getPojoClass()
Overrides:
getPojoClass in class PojoModelVis

isTransient

public boolean isTransient()
Indicates whether the "transient" property of this mode is set.


setTransient

public void setTransient(boolean state)
Sets the "transient" property of this model node.

Parameters:
state - new state of the "transient" property

obtainPropertyValue

protected void obtainPropertyValue()
Obtains the underlying property value


notifyObservers

protected void notifyObservers(java.lang.Exception ex)

get

public DataModel get(int i)
Gets the DataModel object located at the i position.

Overrides:
get in class PojoModelVis
Parameters:
i - position of the node
Returns:
DataModel object

get

public java.lang.Object get(java.lang.String element)
Gets the value located at the specified path

Overrides:
get in class DataModel
Parameters:
element - the path
Returns:
the value of the PojoModel

getNumChildren

public int getNumChildren()
Gets the number of children of this model node

Overrides:
getNumChildren in class DataModel
Returns:
the number of children

hasParameters

public boolean hasParameters()

parametersSet

public boolean parametersSet()
Indicates whether all finder arguments values were set.

Returns:
true if arguments values were set or the finder method is argumentless, false otherwise.

getParameterValues

protected java.lang.Object[] getParameterValues()
Retrieves the method parameter values

Returns:
Table containing values of the parameters

getPropertyName

public java.lang.String getPropertyName()

getParameterTypes

public java.lang.Class[] getParameterTypes()
Gets the method parameter types.

Returns:
Table containing types of the parameters

getBindingAttributes

public java.util.Vector getBindingAttributes()
Gets the list of this collection elemement's properties.

Specified by:
getBindingAttributes in interface ModelVis
Overrides:
getBindingAttributes in class PojoModelVis
Returns:
Vector containing binding attributes that this model node can provide

isCollectionElement

public boolean isCollectionElement()
Indicates whether this model node is wrapping collection's element

Returns:
true if this node wraps collection's element, false otherwise

isCollection

public boolean isCollection()
Indicates whether this model node wraps a collection.


getPojo

public java.lang.Object getPojo()
Gets pojo wrapped by this model node

Returns:
pojo

getBindingPath

public java.lang.String getBindingPath()
Gets the runtime binding path of this model node

Specified by:
getBindingPath in interface ModelVis
Overrides:
getBindingPath in class PojoModelVis
Returns:
the runtime binding path

getNumAttributes

public int getNumAttributes()
Description copied from class: PojoModelVis
Gets the number of attributes

Overrides:
getNumAttributes in class PojoModelVis
Returns:
the number of attributes

getAttribName

public java.lang.String getAttribName(int i)
Description copied from class: DataModel
Retrieve the name of the attribute at the specified index

Overrides:
getAttribName in class PojoModelVis
Parameters:
i - The index of the attributeNames array whose value we want
Returns:
The string value of the attributeNames array at position i

getAttribValue

public java.lang.Object getAttribValue(int i)
Description copied from class: DataModel
Retrieve the value of the attribute at the specified index and return it.

Overrides:
getAttribValue in class PojoModelVis
Parameters:
i - The index of the attributeValues array whose value we want
Returns:
The string value of the attributeValues array at position i

setAttribValue

public void setAttribValue(int i,
                           java.lang.Object value)
Description copied from class: DataModel
Sets the attribute value

Overrides:
setAttribValue in class PojoModelVis
Parameters:
i - The index of the attributeValues array whose value we want
value - the value object

getAttribValueAsString

public java.lang.String getAttribValueAsString(int i)
Returns the value of the attribute converted to a String at the specified index

Overrides:
getAttribValueAsString in class PojoModelVis
Parameters:
i - the index of the attribute
Returns:
String value of the attribute

getId

public java.lang.String getId()
Gets the id of this node

Overrides:
getId in class PojoModelVis
Returns:
the id

getInvocationErrorNotifier

public static java.util.Observable getInvocationErrorNotifier()
Gets a method invocation error notifier

Returns:
the notifier

getAttribRuntime

public boolean getAttribRuntime(int i)
Description copied from class: PojoModelVis
Indicates whether the attribute will be available in the run-time mode.

Overrides:
getAttribRuntime in class PojoModelVis
Parameters:
i - the index of the attribute
Returns:
true if the attribute will be available in the runtime mode, false otherwise

isAttribEditable

public boolean isAttribEditable(int i)
Overrides:
isAttribEditable in class PojoModelVis

getAttribType

public int getAttribType(int i)
Overrides:
getAttribType in class PojoModelVis

getAttribAvailableValues

public java.lang.String[] getAttribAvailableValues(int i)
Overrides:
getAttribAvailableValues in class PojoModelVis