Class FieldReflectionAccessor
- java.lang.Object
-
- org.beanio.internal.parser.accessor.PropertyAccessorSupport
-
- org.beanio.internal.parser.accessor.FieldReflectionAccessor
-
- All Implemented Interfaces:
PropertyAccessor
public class FieldReflectionAccessor extends PropertyAccessorSupport implements PropertyAccessor
APropertyAccessor
that uses reflection to access a public field.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description FieldReflectionAccessor(java.lang.reflect.Field field, int constructorArgumentIndex)
Constructs a newFieldReflectionAccessor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getValue(java.lang.Object bean)
Returns the property value from a bean object.void
setValue(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
-
FieldReflectionAccessor
public FieldReflectionAccessor(java.lang.reflect.Field field, int constructorArgumentIndex)
Constructs a newFieldReflectionAccessor
.- Parameters:
field
- the reflectedField
constructorArgumentIndex
- 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:PropertyAccessor
Returns the property value from a bean object.- Specified by:
getValue
in 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:PropertyAccessor
Sets the property value on a bean object.- Specified by:
setValue
in interfacePropertyAccessor
- Parameters:
bean
- the bean object to set the propertyvalue
- the property value
-
-