public class BeanUtilsPropertyAccessor extends Object implements PropertyAccessor
| Constructor and Description |
|---|
BeanUtilsPropertyAccessor() |
| Modifier and Type | Method and Description |
|---|---|
PropertyAccessor |
accessorWithConversions(ArooaConverter converter)
Provide an accessor that performs conversions.
|
void |
clear() |
BeanOverview |
getBeanOverview(Class<?> forClass)
Provide
org.oddjob.arooo.BeanOverview. |
ArooaClass |
getClassName(Object bean)
Get the
ArooaClass for a bean. |
ArooaConverter |
getConverter() |
Object |
getProperty(Object bean,
String property)
Get a property.
|
<T> T |
getProperty(Object bean,
String property,
Class<T> required)
Get a property of a required type.
|
void |
setIndexedProperty(Object bean,
String name,
int index,
Object value)
Set an indexed property on a bean.
|
void |
setMappedProperty(Object bean,
String name,
String key,
Object value)
Set a mapped property on a bean.
|
void |
setProperty(Object bean,
String name,
Object value)
Set a property on a bean.
|
void |
setSimpleProperty(Object bean,
String name,
Object value)
Set a property on a bean.
|
static void |
validateSimplePropertyName(String name) |
public PropertyAccessor accessorWithConversions(ArooaConverter converter)
PropertyAccessoraccessorWithConversions in interface PropertyAccessorconverter - The converter.public ArooaConverter getConverter()
public void setProperty(Object bean, String name, Object value) throws ArooaPropertyException
setProperty in interface PropertyAccessorbean - The bean. Must not be null.name - The name. Must not be null.value - The value. Can be null.ArooaPropertyExceptionpublic void setSimpleProperty(Object bean, String name, Object value) throws ArooaPropertyException
setSimpleProperty in interface PropertyAccessorbean - The bean. Must not be null.name - The name. Must not be null.value - The value. Can be null.ArooaPropertyExceptionpublic void setMappedProperty(Object bean, String name, String key, Object value) throws ArooaPropertyException
setMappedProperty in interface PropertyAccessorbean - The bean. Must not be null.name - The name. Must not be null.key - The mapped property's key. Must not be null.value - The value. Can be null.PropertyAccessExceptionArooaPropertyExceptionpublic void setIndexedProperty(Object bean, String name, int index, Object value) throws ArooaPropertyException
setIndexedProperty in interface PropertyAccessorbean - The bean. Must not be null.name - The name. Must not be null.index - The indexed property's index. 0 based.value - The value. Can be null.ArooaPropertyExceptionpublic Object getProperty(Object bean, String property) throws ArooaPropertyException
getProperty in interface PropertyAccessorbean - The bean.The - property.ArooaPropertyExceptionpublic <T> T getProperty(Object bean, String property, Class<T> required) throws ArooaPropertyException, ArooaConversionException
getProperty in interface PropertyAccessorbean - The bean.The - property.ArooaPropertyExceptionArooaConversionExceptionpublic static void validateSimplePropertyName(String name) throws IllegalArgumentException
IllegalArgumentExceptionpublic ArooaClass getClassName(Object bean)
PropertyAccessorArooaClass for a bean.getClassName in interface PropertyAccessorpublic BeanOverview getBeanOverview(Class<?> forClass) throws ArooaException
PropertyAccessororg.oddjob.arooo.BeanOverview. Note that this
will provide the overview for the Java class. If using a bean
that might be a dynabean then use
getArooaClass(bean).getBeanOverview() instead.getBeanOverview in interface PropertyAccessorArooaExceptionpublic void clear()