org.compass.core.util.reflection.plain
Class PlainReflectionField

java.lang.Object
  extended by org.compass.core.util.reflection.plain.PlainReflectionField
All Implemented Interfaces:
ReflectionField

public class PlainReflectionField
extends Object
implements ReflectionField

A plain implemenation of ReflectionField that simply delegates operations to Field.

Author:
kimchy

Constructor Summary
PlainReflectionField(Field field)
           
 
Method Summary
 Object get(Object obj)
           
 Class<?> getDeclaringClass()
          Returns the Class object representing the class or interface that declares the field represented by this Field object.
 Field getField()
          Returns the wrapped field.
 Type getGenericType()
          Returns a Type object that represents the declared type for the field represented by this Field object.
 int getModifiers()
          Returns the Java language modifiers for the field represented by this Field object, as an integer.
 String getName()
          Returns the name of the field represented by this Field object.
 Class<?> getType()
          Returns a Class object that identifies the declared type for the field represented by this Field object.
 void set(Object obj, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainReflectionField

public PlainReflectionField(Field field)
Method Detail

get

public Object get(Object obj)
           throws IllegalArgumentException,
                  IllegalAccessException
Specified by:
get in interface ReflectionField
Throws:
IllegalArgumentException
IllegalAccessException

set

public void set(Object obj,
                Object value)
         throws IllegalArgumentException,
                IllegalAccessException
Specified by:
set in interface ReflectionField
Throws:
IllegalArgumentException
IllegalAccessException

getName

public String getName()
Description copied from interface: ReflectionField
Returns the name of the field represented by this Field object.

Specified by:
getName in interface ReflectionField

getDeclaringClass

public Class<?> getDeclaringClass()
Description copied from interface: ReflectionField
Returns the Class object representing the class or interface that declares the field represented by this Field object.

Specified by:
getDeclaringClass in interface ReflectionField

getModifiers

public int getModifiers()
Description copied from interface: ReflectionField
Returns the Java language modifiers for the field represented by this Field object, as an integer. The Modifier class should be used to decode the modifiers.

Specified by:
getModifiers in interface ReflectionField
See Also:
Modifier

getType

public Class<?> getType()
Description copied from interface: ReflectionField
Returns a Class object that identifies the declared type for the field represented by this Field object.

Specified by:
getType in interface ReflectionField
Returns:
a Class object identifying the declared type of the field represented by this object

getGenericType

public Type getGenericType()
Description copied from interface: ReflectionField
Returns a Type object that represents the declared type for the field represented by this Field object.

If the Type is a parameterized type, the Type object returned must accurately reflect the actual type parameters used in the source code.

If an the type of the underlying field is a type variable or a parameterized type, it is created. Otherwise, it is resolved.

Specified by:
getGenericType in interface ReflectionField
Returns:
a Type object that represents the declared type for the field represented by this Field object

getField

public Field getField()
Description copied from interface: ReflectionField
Returns the wrapped field.

Specified by:
getField in interface ReflectionField


Copyright (c) 2004-2008 The Compass Project.