C
- class containing the fieldT
- class of fieldpublic class SormulaField<C,T>
extends java.lang.Object
Constructor and Description |
---|
SormulaField(java.lang.reflect.Field field)
Constructs for a field.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCanonicalGetMethodName()
Gets cannonical "get" method name.
|
java.lang.String |
getCanonicalSetMethodName()
Gets cannonical "set" method name.
|
java.lang.reflect.Field |
getField()
Gets field supplied in constructor.
|
T |
invokeGetMethod(C object)
Gets value from get method of an object using reflection.
|
void |
invokeSetMethod(C object,
T value)
Sets value on object with set method using reflection.
|
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.
|
public SormulaField(java.lang.reflect.Field field) throws ReflectException
field
- java reflection Field that corresponds to class variableReflectException
- 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 T invokeGetMethod(C object) throws ReflectException
object
- object to invoke get method uponReflectException
- if errorpublic void invokeSetMethod(C object, T value) throws ReflectException
object
- object to invoke set method uponvalue
- value to setReflectException
- if errorpublic boolean isScalar()
Collection
and not a Map
isClass(Class)
public boolean isClass(java.lang.Class<?> c)
c
- class to testClass.isAssignableFrom(Class)
public java.lang.String getCanonicalGetMethodName()
public java.lang.String getCanonicalSetMethodName()