Package com.ibatis.common.beans
Class ComplexBeanProbe
java.lang.Object
com.ibatis.common.beans.BaseProbe
com.ibatis.common.beans.ComplexBeanProbe
- All Implemented Interfaces:
Probe
StaticBeanProbe provides methods that allow simple, reflective access to JavaBeans style properties. Methods are
provided for all simple types as well as object types.
Examples:
StaticBeanProbe.setObject(object, propertyName, value);
Object value = StaticBeanProbe.getObject(object, propertyName);
-
Constructor Summary
ModifierConstructorDescriptionprotected
Instantiates a new complex bean probe. -
Method Summary
Modifier and TypeMethodDescriptionGets an Object property from a beanprotected Object
getProperty
(Object object, String name) Gets the property.getPropertyTypeForGetter
(Object object, String name) Returns the class that the getter will return when reading a property value.getPropertyTypeForSetter
(Object object, String name) Returns the class that the setter expects to receive as a parameter when setting a property value.String[]
getReadablePropertyNames
(Object object) Returns an array of the readable properties exposed by a beanString[]
getWriteablePropertyNames
(Object object) Returns an array of the writeable properties exposed by a beanboolean
hasReadableProperty
(Object object, String propertyName) Checks to see if a bean has a readable property be a given nameboolean
hasWritableProperty
(Object object, String propertyName) Checks to see if a bean has a writable property be a given namevoid
Sets the value of a bean property to an Objectprotected void
setProperty
(Object object, String name, Object value) Sets the property.Methods inherited from class com.ibatis.common.beans.BaseProbe
getIndexedProperty, getIndexedType, setIndexedProperty
-
Constructor Details
-
ComplexBeanProbe
protected ComplexBeanProbe()Instantiates a new complex bean probe.
-
-
Method Details
-
getReadablePropertyNames
Returns an array of the readable properties exposed by a bean- Specified by:
getReadablePropertyNames
in classBaseProbe
- Parameters:
object
- The bean- Returns:
- The properties
-
getWriteablePropertyNames
Returns an array of the writeable properties exposed by a bean- Specified by:
getWriteablePropertyNames
in classBaseProbe
- Parameters:
object
- The bean- Returns:
- The properties
-
getPropertyTypeForSetter
Returns the class that the setter expects to receive as a parameter when setting a property value.- Parameters:
object
- The bean to checkname
- The name of the property- Returns:
- The type of the property
-
getPropertyTypeForGetter
Returns the class that the getter will return when reading a property value.- Parameters:
object
- The bean to checkname
- The name of the property- Returns:
- The type of the property
-
getObject
Gets an Object property from a bean- Parameters:
object
- The beanname
- The property name- Returns:
- The property value (as an Object)
-
setObject
Sets the value of a bean property to an Object- Parameters:
object
- The bean to changename
- The name of the property to setvalue
- The new value to set
-
hasWritableProperty
Checks to see if a bean has a writable property be a given name- Parameters:
object
- The bean to checkpropertyName
- The property to check for- Returns:
- True if the property exists and is writable
-
hasReadableProperty
Checks to see if a bean has a readable property be a given name- Parameters:
object
- The bean to checkpropertyName
- The property to check for- Returns:
- True if the property exists and is readable
-
getProperty
Description copied from class:BaseProbe
Gets the property.- Specified by:
getProperty
in classBaseProbe
- Parameters:
object
- the objectname
- the property- Returns:
- the property
-
setProperty
Description copied from class:BaseProbe
Sets the property.- Specified by:
setProperty
in classBaseProbe
- Parameters:
object
- the objectname
- the propertyvalue
- the value
-