Package org.jboss.util
Class FieldInstance
- java.lang.Object
-
- org.jboss.util.FieldInstance
-
public class FieldInstance extends java.lang.ObjectA FieldInstance refers to a specific reflected field on an object.- Version:
- $Revision$
-
-
Constructor Summary
Constructors Constructor Description FieldInstance(java.lang.Object instance, java.lang.String fieldName)Construct a new field instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget()Get the value of the field instance.java.lang.reflect.FieldgetField()Get the field.java.lang.ObjectgetInstance()Get the instance.voidset(java.lang.Object value)Set the value of the field instance
-
-
-
Constructor Detail
-
FieldInstance
public FieldInstance(java.lang.Object instance, java.lang.String fieldName) throws java.lang.NoSuchFieldExceptionConstruct a new field instance.- Parameters:
instance- The instance object the given field belongs to.fieldName- The name of the field to find in the instance.- Throws:
NullArgumentException- Instance or fieldName is null.java.lang.NoSuchFieldException
-
-
Method Detail
-
getField
public final java.lang.reflect.Field getField()
Get the field.- Returns:
- Field.
-
getInstance
public final java.lang.Object getInstance()
Get the instance.- Returns:
- Instance.
-
get
public final java.lang.Object get() throws java.lang.IllegalAccessExceptionGet the value of the field instance.- Returns:
- Field value.
- Throws:
java.lang.IllegalAccessException- Failed to get field value.
-
set
public final void set(java.lang.Object value) throws java.lang.IllegalAccessExceptionSet the value of the field instance- Parameters:
value- Field value.- Throws:
java.lang.IllegalAccessException- Failed to set field value.
-
-