Class MethodReflectionAccessor
- java.lang.Object
-
- org.beanio.internal.parser.accessor.PropertyAccessorSupport
-
- org.beanio.internal.parser.accessor.MethodReflectionAccessor
-
- All Implemented Interfaces:
PropertyAccessor
public class MethodReflectionAccessor extends PropertyAccessorSupport implements PropertyAccessor
APropertyAccessorthat uses reflection to get and set a bean value.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description MethodReflectionAccessor(java.beans.PropertyDescriptor descriptor, int constructorArgumentIndex)Constructs a newReflectionAccessor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetValue(java.lang.Object bean)Returns the property value from a bean object.voidsetValue(java.lang.Object bean, java.lang.Object value)Sets the property value on a bean object.-
Methods inherited from class org.beanio.internal.parser.accessor.PropertyAccessorSupport
getConstructorArgumentIndex, isConstructorArgument, setConstructorArgumentIndex
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.beanio.internal.parser.PropertyAccessor
getConstructorArgumentIndex, isConstructorArgument
-
-
-
-
Constructor Detail
-
MethodReflectionAccessor
public MethodReflectionAccessor(java.beans.PropertyDescriptor descriptor, int constructorArgumentIndex)Constructs a newReflectionAccessor.- Parameters:
descriptor- the PropertyDescriptor describing the bean propertyconstructorArgumentIndex- the constructor argument index, or -1 if not a constructor argument
-
-
Method Detail
-
getValue
public java.lang.Object getValue(java.lang.Object bean)
Description copied from interface:PropertyAccessorReturns the property value from a bean object.- Specified by:
getValuein interfacePropertyAccessor- Parameters:
bean- the bean object to get the property from- Returns:
- the property value
-
setValue
public void setValue(java.lang.Object bean, java.lang.Object value)Description copied from interface:PropertyAccessorSets the property value on a bean object.- Specified by:
setValuein interfacePropertyAccessor- Parameters:
bean- the bean object to set the propertyvalue- the property value
-
-