public class FieldWrapper
extends java.lang.Object
Field class for easy access to all required methods.| Constructor and Description |
|---|
FieldWrapper(FieldStream parent,
java.lang.reflect.Field field) |
| Modifier and Type | Method and Description |
|---|---|
void |
copy(java.lang.Object target)
Copy the value of the
Field to the given target. |
void |
copy(java.lang.Object instance,
java.lang.Object target)
Copy the value of the
Field to the given target with the given owner. |
<T> T |
get()
Get the value of the field.
|
<T> T |
get(java.lang.Object instance)
Get the value of the field with the given instance.
|
ModifierWrapper |
modifier() |
java.lang.String |
name() |
java.lang.Class<?> |
owner() |
FieldStream |
parent() |
java.lang.reflect.Field |
raw() |
void |
set(java.lang.Object value)
Set the value of the
Field. |
void |
set(java.lang.Object instance,
java.lang.Object value)
Set the value of the
Field with the given owner. |
java.lang.Class<?> |
type() |
public FieldWrapper(FieldStream parent, java.lang.reflect.Field field)
public FieldStream parent()
public java.lang.reflect.Field raw()
public java.lang.String name()
public java.lang.Class<?> type()
public java.lang.Class<?> owner()
public ModifierWrapper modifier()
ModifierWrapper of the fieldpublic <T> T get()
T - The type of the fieldjava.lang.IllegalStateException - If the field is not static and no instance is cachedpublic <T> T get(java.lang.Object instance)
T - The type of the fieldinstance - The instance of the ownerpublic void set(java.lang.Object value)
Field.value - The value to set the Field tojava.lang.IllegalStateException - If trying to set a non-static Field if no instance is providedpublic void set(java.lang.Object instance,
java.lang.Object value)
Field with the given owner.instance - The instance of the ownervalue - The value to set the Field topublic void copy(java.lang.Object target)
Field to the given target.target - The target to copy the value topublic void copy(java.lang.Object instance,
java.lang.Object target)
Field to the given target with the given owner.instance - The instance of the ownertarget - The target to copy the value to