|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openxava.util.PropertiesManager
public class PropertiesManager
Manages with reflection the properties of a object.
Excludes automatically the property class of Object
and the indexed properties with no indexed access.
| Constructor Summary | |
|---|---|
PropertiesManager()
|
|
PropertiesManager(java.lang.Class theClass)
Constructor from a the class of the object to manage. |
|
PropertiesManager(java.lang.Object object)
Constructor from the object to manage. |
|
| Method Summary | |
|---|---|
java.lang.Object |
executeGet(java.lang.String propertyName)
Gets the value of the indicated property. |
java.util.Map |
executeGets(java.lang.String properties)
Gets a group of property values in a map. |
void |
executeSet(java.lang.String propertyName,
java.lang.Object value)
Update property. |
void |
executeSetFromString(java.lang.String propertyName,
java.lang.Object value)
Update property from a string, making needed conversions. |
void |
executeSets(java.util.Map properties)
Sets property values from a map. |
void |
executeSetsFromStrings(java.util.Map properties)
Sets property values from a map, trying to convert strings to value of valid type for properties. |
boolean |
exists(java.lang.String propertyName)
If the property exists. |
java.lang.Object |
getObject()
Object of which the properties are handled. |
java.lang.String[] |
getPropertiesNames()
Names of all properties managed by this. |
java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.String propertyName)
|
java.lang.String[] |
getReadablesPropertiesNames()
Names of all properties managed by this with getter method. |
java.lang.String[] |
getWritablesPropertiesNames()
Names of all properties managed by this with setter method. |
boolean |
hasGetter(java.lang.String propertyName)
If the property has getter. |
boolean |
hasSetter(java.lang.String propertyName)
If the property has setter. |
void |
setObject(java.lang.Object newObject)
Object of which the properties are handled. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertiesManager()
public PropertiesManager(java.lang.Class theClass)
this.
public PropertiesManager(java.lang.Object object)
object - Object to manage| Method Detail |
|---|
public java.lang.Object executeGet(java.lang.String propertyName)
throws java.lang.reflect.InvocationTargetException,
PropertiesManagerException
propertyName - Property name to obtain its value,
can be qualified (that is: 'customer.address.street' for example)
java.lang.reflect.InvocationTargetException - Exception originated by the original access method
PropertiesManagerException - Some unexpected problem
public java.util.Map executeGets(java.lang.String properties)
throws java.lang.reflect.InvocationTargetException,
PropertiesManagerException
Precondition
properties - Names of properties to get, separated by colon (:).
The properties must to exist in the object. If properties is null
a empty map is returned.
java.lang.reflect.InvocationTargetException - Exception originated by original access method
PropertiesManagerException - Some unexpected problem
public void executeSet(java.lang.String propertyName,
java.lang.Object value)
throws java.lang.reflect.InvocationTargetException,
PropertiesManagerException
Precondition
propertyName - Property name to updatevalue - New value for property. Has to be of compatible type. If value is a Map
and the property type is not a map then convert the map in an object of the property
type.
java.lang.reflect.InvocationTargetException - Excepction originated from original access method
PropertiesManagerException - Any unexpected problem
public void executeSetFromString(java.lang.String propertyName,
java.lang.Object value)
throws java.lang.reflect.InvocationTargetException,
PropertiesManagerException
Precondition
propertyName - Name of property to updatevalue - New value for property. Must to be a compatible type or a string
parseable to a compatible type.
java.lang.reflect.InvocationTargetException - Exception from original access method
PropertiesManagerException - Any unexpected problem
public void executeSets(java.util.Map properties)
throws java.lang.reflect.InvocationTargetException,
PropertiesManagerException
Precondition
properties - Map with String propertyName:Object value.
Null is assumed as empty map
java.lang.reflect.InvocationTargetException - Excepcion from original access method
PropertiesManagerException - Any unexpected method
public void executeSetsFromStrings(java.util.Map properties)
throws java.lang.reflect.InvocationTargetException,
PropertiesManagerException
Precondition
properties - Map with String propertyName:Object value.
Null is assumed as empty map
java.lang.reflect.InvocationTargetException - Excepcion from original access method
PropertiesManagerException - Any unexpected method
public boolean exists(java.lang.String propertyName)
throws PropertiesManagerException
PropertiesManagerException
public java.lang.String[] getPropertiesNames()
throws PropertiesManagerException
this.
PropertiesManagerException
public java.lang.String[] getWritablesPropertiesNames()
throws PropertiesManagerException
this with setter method.
PropertiesManagerException
public java.lang.String[] getReadablesPropertiesNames()
throws PropertiesManagerException
this with getter method.
PropertiesManagerExceptionpublic java.lang.Object getObject()
public java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)
throws PropertiesManagerException
PropertiesManagerExceptionpublic void setObject(java.lang.Object newObject)
public boolean hasGetter(java.lang.String propertyName)
throws PropertiesManagerException
PropertiesManagerException
public boolean hasSetter(java.lang.String propertyName)
throws PropertiesManagerException
PropertiesManagerException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||