public class BeanUtilsPropertyAccessor extends java.lang.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(java.lang.Class<?> forClass)
Provide
org.oddjob.arooo.BeanOverview . |
ArooaClass |
getClassName(java.lang.Object bean)
Get the
ArooaClass for a bean. |
ArooaConverter |
getConverter() |
java.lang.Object |
getProperty(java.lang.Object bean,
java.lang.String property)
Get a property.
|
<T> T |
getProperty(java.lang.Object bean,
java.lang.String property,
java.lang.Class<T> required)
Get a property of a required type.
|
void |
setIndexedProperty(java.lang.Object bean,
java.lang.String name,
int index,
java.lang.Object value)
Set an indexed property on a bean.
|
void |
setMappedProperty(java.lang.Object bean,
java.lang.String name,
java.lang.String key,
java.lang.Object value)
Set a mapped property on a bean.
|
void |
setProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Set a property on a bean.
|
void |
setSimpleProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value)
Set a property on a bean.
|
static void |
validateSimplePropertyName(java.lang.String name) |
public PropertyAccessor accessorWithConversions(ArooaConverter converter)
PropertyAccessor
accessorWithConversions
in interface PropertyAccessor
converter
- The converter.public ArooaConverter getConverter()
public void setProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws ArooaPropertyException
setProperty
in interface PropertyAccessor
bean
- The bean. Must not be null.name
- The name. Must not be null.value
- The value. Can be null.ArooaPropertyException
public void setSimpleProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws ArooaPropertyException
setSimpleProperty
in interface PropertyAccessor
bean
- The bean. Must not be null.name
- The name. Must not be null.value
- The value. Can be null.ArooaPropertyException
public void setMappedProperty(java.lang.Object bean, java.lang.String name, java.lang.String key, java.lang.Object value) throws ArooaPropertyException
setMappedProperty
in interface PropertyAccessor
bean
- 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.PropertyAccessException
ArooaPropertyException
public void setIndexedProperty(java.lang.Object bean, java.lang.String name, int index, java.lang.Object value) throws ArooaPropertyException
setIndexedProperty
in interface PropertyAccessor
bean
- 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.ArooaPropertyException
public java.lang.Object getProperty(java.lang.Object bean, java.lang.String property) throws ArooaPropertyException
getProperty
in interface PropertyAccessor
bean
- The bean.The
- property.ArooaPropertyException
public <T> T getProperty(java.lang.Object bean, java.lang.String property, java.lang.Class<T> required) throws ArooaPropertyException, ArooaConversionException
getProperty
in interface PropertyAccessor
bean
- The bean.The
- property.ArooaPropertyException
ArooaConversionException
public static void validateSimplePropertyName(java.lang.String name) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public ArooaClass getClassName(java.lang.Object bean)
PropertyAccessor
ArooaClass
for a bean.getClassName
in interface PropertyAccessor
public BeanOverview getBeanOverview(java.lang.Class<?> forClass) throws ArooaException
PropertyAccessor
org.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 PropertyAccessor
ArooaException
public void clear()