public class MethodReflectionAccessor extends PropertyAccessorSupport implements PropertyAccessor
PropertyAccessor
that uses reflection to get and set a bean value.Constructor and Description |
---|
MethodReflectionAccessor(PropertyDescriptor descriptor,
int constructorArgumentIndex)
Constructs a new ReflectionAccessor.
|
Modifier and Type | Method and Description |
---|---|
Object |
getValue(Object bean)
Returns the property value from a bean object.
|
void |
setValue(Object bean,
Object value)
Sets the property value on a bean object.
|
getConstructorArgumentIndex, isConstructorArgument, setConstructorArgumentIndex
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConstructorArgumentIndex, isConstructorArgument
public MethodReflectionAccessor(PropertyDescriptor descriptor, int constructorArgumentIndex)
descriptor
- the PropertyDescriptor describing the bean propertyconstructorArgumentIndex
- the constructor argument index, or -1 if not a constructor argumentpublic Object getValue(Object bean)
PropertyAccessor
getValue
in interface PropertyAccessor
bean
- the bean object to get the property frompublic void setValue(Object bean, Object value)
PropertyAccessor
setValue
in interface PropertyAccessor
bean
- the bean object to set the propertyvalue
- the property value