org.formaria.editor.data.pojo
Class PojoProperties

java.lang.Object
  extended by org.formaria.editor.data.pojo.PojoProperties

public class PojoProperties
extends java.lang.Object

A structures begin used to store the pojo properties


Constructor Summary
PojoProperties()
          Creates a new instance of PojoProperties
 
Method Summary
protected  void createKeyTables()
          Create the table containing property names and transient property names
protected  java.lang.Class getCollectionType(java.lang.String propertyName)
          Returns the class whose instances are stored by the specified collection
protected  int getNumProperties()
          Gets the total number of properties
protected  java.lang.Object getProperty(int idx)
          Gets the property value located at the specified index.
 java.lang.reflect.Method getPropertyGetter(java.lang.String propertyName)
          Returns the getter of the specified property.
protected  java.lang.String getPropertyName(int idx)
          Gets the name of the property at the specified index
 java.util.Set getPropertyNames()
          Gets the names of the regular POJO properties
protected  java.lang.reflect.Method getPropertySetter(int idx)
          Gets the setter of the property located at the specified index
 java.lang.reflect.Method getPropertySetter(java.lang.String propertyName)
          Returns the setter of the specified property.
 java.lang.Class getTransientCollectionType(java.lang.String propertyName)
          Returns the class whose instances are stored by the specified transient collection.
 org.formaria.editor.data.pojo.PojoProperties.TransientProperty getTransientProperty(java.lang.String propertyName)
          Gets the transient property details associated with the given property name.
 java.util.Set getTransientPropertyNames()
          Gets the names of the transient properties
 java.lang.Class getTransientPropertyType(java.lang.String propertyName)
          Gets the class whose istance is held by the specified transient property.
protected  void setCollectionType(java.lang.String propertyName, java.lang.Class collectionType)
           
protected  void setPropertyGetter(java.lang.String propertyName, java.lang.reflect.Method propertyValue)
          Maps the specified property name to the specified getter method
protected  void setPropertySetter(java.lang.String propertyName, java.lang.reflect.Method propertyValue)
          Maps the specified property name to the specified setter method
protected  void setTransientCollectionType(java.lang.String propertyName, java.lang.Class collectionType)
          Marks that the specified transient collection is intended to store elements of the specified type.
protected  void setTransientPropertyType(java.lang.String propertyName, java.lang.Class type)
          Sets the type of the specified property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PojoProperties

public PojoProperties()
Creates a new instance of PojoProperties

Method Detail

getPropertyNames

public java.util.Set getPropertyNames()
Gets the names of the regular POJO properties

Returns:
set containing the names

getTransientPropertyNames

public java.util.Set getTransientPropertyNames()
Gets the names of the transient properties

Returns:
set containing the names

getTransientProperty

public org.formaria.editor.data.pojo.PojoProperties.TransientProperty getTransientProperty(java.lang.String propertyName)
Gets the transient property details associated with the given property name.

Parameters:
propertyName - the name of the property
Returns:
the requested property

setPropertyGetter

protected void setPropertyGetter(java.lang.String propertyName,
                                 java.lang.reflect.Method propertyValue)
Maps the specified property name to the specified getter method

Parameters:
propertyName - the name of the property
propertyValue - the getter method of the property

getPropertyGetter

public java.lang.reflect.Method getPropertyGetter(java.lang.String propertyName)
Returns the getter of the specified property.

Parameters:
propertyName - the name of the property whose getter is to be retrieved
Returns:
the getter method

setPropertySetter

protected void setPropertySetter(java.lang.String propertyName,
                                 java.lang.reflect.Method propertyValue)
Maps the specified property name to the specified setter method

Parameters:
propertyName - the name of the property
propertyValue - the setter method of the property

getPropertySetter

public java.lang.reflect.Method getPropertySetter(java.lang.String propertyName)
Returns the setter of the specified property.

Parameters:
property - the name of the property whose setter is to be retrieved
Returns:
the setter method.

setCollectionType

protected void setCollectionType(java.lang.String propertyName,
                                 java.lang.Class collectionType)

getCollectionType

protected java.lang.Class getCollectionType(java.lang.String propertyName)
Returns the class whose instances are stored by the specified collection

Parameters:
propertyName - the name of the property holding a collection
Returns:
the Class object.

setTransientPropertyType

protected void setTransientPropertyType(java.lang.String propertyName,
                                        java.lang.Class type)
Sets the type of the specified property.

Parameters:
propertyName - the name of the property.
type - the class whose istance is held by the property

getTransientPropertyType

public java.lang.Class getTransientPropertyType(java.lang.String propertyName)
Gets the class whose istance is held by the specified transient property.

Parameters:
propertyName - the name of the property whose type is to be retrieved
Returns:
the type of the property

setTransientCollectionType

protected void setTransientCollectionType(java.lang.String propertyName,
                                          java.lang.Class collectionType)
Marks that the specified transient collection is intended to store elements of the specified type.

Parameters:
propertyName - the name of the property holding a collection
collectionType - the type of the collection elements.

getTransientCollectionType

public java.lang.Class getTransientCollectionType(java.lang.String propertyName)
Returns the class whose instances are stored by the specified transient collection.

Parameters:
propertyName - the name of the transient property holding a collection.
Returns:
the Class object.

getPropertyName

protected java.lang.String getPropertyName(int idx)
Gets the name of the property at the specified index

Parameters:
idx - the index of the requested property
Returns:
the name of the property

getProperty

protected java.lang.Object getProperty(int idx)
Gets the property value located at the specified index.

Parameters:
idx - the index of the requested property
Returns:
the getter method of the Class object.

getPropertySetter

protected java.lang.reflect.Method getPropertySetter(int idx)
Gets the setter of the property located at the specified index

Parameters:
idx - the index of the property whose setter is to be returned.
Returns:
the setter method

getNumProperties

protected int getNumProperties()
Gets the total number of properties

Returns:
the number of properties

createKeyTables

protected void createKeyTables()
Create the table containing property names and transient property names