org.jboss.util
Class FieldInstance

java.lang.Object
  extended byorg.jboss.util.FieldInstance

public class FieldInstance
extends java.lang.Object

A FieldInstance refers to a specific reflected field on an object.


Field Summary
protected  java.lang.reflect.Field field
          Field
protected  java.lang.Object instance
          Instance
 
Constructor Summary
FieldInstance(java.lang.Object instance, java.lang.String fieldName)
          Construct a new field instance.
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

field

protected final java.lang.reflect.Field field
Field


instance

protected final java.lang.Object instance
Instance

Constructor Detail

FieldInstance

public FieldInstance(java.lang.Object instance,
                     java.lang.String fieldName)
              throws java.lang.NoSuchFieldException
Construct 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 (src) - 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.IllegalAccessException
Get 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.IllegalAccessException
Set the value of the field instance

Parameters:
value - Field value.
Throws:
java.lang.IllegalAccessException - Failed to set field value.