org.compass.core.util.reflection
Interface ReflectionField

All Known Implementing Classes:
PlainReflectionField

public interface ReflectionField

A wrapper around Field allowing different implementation of it.

Author:
kimchy

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)
           
 

Method Detail

get

Object get(Object obj)
           throws IllegalArgumentException,
                  IllegalAccessException
Throws:
IllegalArgumentException
IllegalAccessException

set

void set(Object obj,
         Object value)
         throws IllegalArgumentException,
                IllegalAccessException
Throws:
IllegalArgumentException
IllegalAccessException

getName

String getName()
Returns the name of the field represented by this Field object.


getDeclaringClass

Class<?> getDeclaringClass()
Returns the Class object representing the class or interface that declares the field represented by this Field object.


getModifiers

int getModifiers()
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.

See Also:
Modifier

getType

Class<?> getType()
Returns a Class object that identifies the declared type for the field represented by this Field object.

Returns:
a Class object identifying the declared type of the field represented by this object

getGenericType

Type getGenericType()
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.

Returns:
a Type object that represents the declared type for the field represented by this Field object
Throws:
GenericSignatureFormatError - if the generic field signature does not conform to the format specified in the Java Virtual Machine Specification, 3rd edition
TypeNotPresentException - if the generic type signature of the underlying field refers to a non-existent type declaration
MalformedParameterizedTypeException - if the generic signature of the underlying field refers to a parameterized type that cannot be instantiated for any reason
Since:
1.5

getField

Field getField()
Returns the wrapped field.



Copyright (c) 2004-2008 The Compass Project.