public class ReflectionFieldAccess extends java.lang.Object implements FieldAccess
FieldAccess using reflection.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.reflect.Field |
field |
| Constructor and Description |
|---|
ReflectionFieldAccess(java.lang.reflect.Field field) |
| Modifier and Type | Method and Description |
|---|---|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationClass)
Get an annotation of the field.
|
int |
getModifiers() |
java.lang.String |
getName() |
java.lang.Class<?> |
getType() |
java.lang.Object |
getValue(java.lang.Object instance)
Get the value of the field from the given instance.
|
void |
setValue(java.lang.Object instance,
java.lang.Object value)
Set the value of the field for the given instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcastValuepublic ReflectionFieldAccess(java.lang.reflect.Field field)
public java.lang.String getName()
getName in interface FieldAccessField.getName()public int getModifiers()
getModifiers in interface FieldAccessField.getModifiers()public java.lang.Class<?> getType()
getType in interface FieldAccessField.getType()public java.lang.Object getValue(java.lang.Object instance)
FieldAccessgetValue in interface FieldAccessinstance - The instance to get the value fromField.get(Object)public void setValue(java.lang.Object instance,
java.lang.Object value)
FieldAccesssetValue in interface FieldAccessinstance - The instance to set the value forvalue - The value to setField.set(Object, Object)public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
FieldAccessgetAnnotation in interface FieldAccessT - The type of the annotationannotationClass - The class of the annotationAccessibleObject.getDeclaredAnnotation(Class)