C
- class containing the fieldT
- class of fieldpublic abstract class RowField<C,T>
extends java.lang.Object
Constructor and Description |
---|
RowField(java.lang.reflect.Field field)
Constructs for a field.
|
Modifier and Type | Method and Description |
---|---|
abstract T |
get(C object)
Gets value from get method of an object using reflection.
|
java.lang.reflect.Field |
getField()
Gets field supplied in constructor.
|
boolean |
isArray()
Gets field array type.
|
boolean |
isBooleanMethod()
Reports boolean return type of field.
|
boolean |
isClass(java.lang.Class<?> c)
Tests if field is instance of class.
|
boolean |
isCollection()
Gets field
Collection inheritance. |
boolean |
isMap()
Gets field
Map inheritance. |
boolean |
isScalar()
Reports if field is scalar.
|
static <C,T> RowField<C,T> |
newInstance(FieldAccessType fieldAccessType,
java.lang.reflect.Field field)
Factory method to create concrete
RowField subclass instance for a field. |
abstract void |
set(C object,
T value)
Sets value on object with set method using reflection.
|
public RowField(java.lang.reflect.Field field) throws ReflectException
field
- java reflection Field that corresponds to class variableReflectException
- if errorpublic static <C,T> RowField<C,T> newInstance(FieldAccessType fieldAccessType, java.lang.reflect.Field field) throws ReflectException
RowField
subclass instance for a field.C
- class containing the fieldT
- class of fieldfieldAccessType
- direct or method accessfield
- field to accessMethodAccessField
or DirectAccessField
ReflectException
- if errorpublic java.lang.reflect.Field getField()
public boolean isArray()
public boolean isCollection()
Collection
inheritance.collection
public boolean isMap()
Map
inheritance.Map
public boolean isBooleanMethod()
public boolean isScalar()
Collection
and not a Map
isClass(Class)
public boolean isClass(java.lang.Class<?> c)
c
- class to testClass.isAssignableFrom(Class)
public abstract T get(C object) throws ReflectException
object
- instance of field to getReflectException
- if errorpublic abstract void set(C object, T value) throws ReflectException
object
- instance of field to set new valuevalue
- new value of field instanceReflectException
- if error