ewe.reflect
Class Field

java.lang.Object
  extended byewe.reflect.Field
All Implemented Interfaces:
Member

public class Field
extends Object
implements Member

This is used to access static and instance fields in objects.


Field Summary
protected  Class declaringClass
           
protected  String fieldName
           
 String fullType
           
protected  int modifiers
           
 Reflect reflect
           
static Wrapper wrapper
           
 int wrapperType
           
 
Fields inherited from interface ewe.reflect.Member
DECLARED, PUBLIC
 
Method Summary
 void copyValue(Object from, Object to)
           
 Class getDeclaringClass()
           
 Class getFieldType()
          Return the type of the field as a Class.
 int getModifiers()
           
 String getName()
           
 String getType()
          Return the type of the field as a Java encoded type string.
 Wrapper getValue(Object from, Wrapper dest)
          Get the value of the field.
 void makeWrapperCompatible(Wrapper w)
           
 void setValue(Object to, Wrapper value)
          Set the value of the field.
 Field toJavaField()
           
 String toString()
          Return a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 

Field Detail

wrapperType

public int wrapperType

fullType

public String fullType

modifiers

protected int modifiers

declaringClass

protected Class declaringClass

reflect

public Reflect reflect

fieldName

protected String fieldName

wrapper

public static Wrapper wrapper
Method Detail

getName

public String getName()
Specified by:
getName in interface Member

toString

public String toString()
Description copied from class: Object
Return a String representation of this object.

Overrides:
toString in class Object
Returns:
a String representing this object.

getType

public String getType()
Return the type of the field as a Java encoded type string.

Specified by:
getType in interface Member

getFieldType

public Class getFieldType()
Return the type of the field as a Class.


getValue

public Wrapper getValue(Object from,
                        Wrapper dest)
Get the value of the field.

Parameters:
from - The object to retrieve the field value from, or null for static fields.
dest - An optional destination wrapper value. If it is null then a new one will be created and returned.
Returns:
A wrapper containing the value in the Field. If this returns null then the Field was not public.

setValue

public void setValue(Object to,
                     Wrapper value)
Set the value of the field. This throws a RuntimeException is the field is not public.

Parameters:
to - The object to set the field value to, or null for static fields.
value - The value to set.

copyValue

public void copyValue(Object from,
                      Object to)

makeWrapperCompatible

public void makeWrapperCompatible(Wrapper w)

getModifiers

public int getModifiers()
Specified by:
getModifiers in interface Member

getDeclaringClass

public Class getDeclaringClass()
Specified by:
getDeclaringClass in interface Member

toJavaField

public Field toJavaField()