public class FieldInstance
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.reflect.Field |
field
Field
|
protected java.lang.Object |
instance
Instance
|
| Constructor and Description |
|---|
FieldInstance(java.lang.Object instance,
java.lang.String fieldName)
Construct a new field instance.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get()
Get the value of the field instance.
|
java.lang.reflect.Field |
getField()
Get the field.
|
java.lang.Object |
getInstance()
Get the instance.
|
void |
set(java.lang.Object value)
Set the value of the field instance
|
protected final java.lang.reflect.Field field
protected final java.lang.Object instance
public FieldInstance(java.lang.Object instance,
java.lang.String fieldName)
throws java.lang.NoSuchFieldException
instance - The instance object the given field belongs to.fieldName - The name of the field to find in the instance.NullArgumentException - Instance or fieldName is null.java.lang.NoSuchFieldExceptionpublic final java.lang.reflect.Field getField()
public final java.lang.Object getInstance()
public final java.lang.Object get()
throws java.lang.IllegalAccessException
java.lang.IllegalAccessException - Failed to get field value.public final void set(java.lang.Object value)
throws java.lang.IllegalAccessException
value - Field value.java.lang.IllegalAccessException - Failed to set field value.