com.gentlyweb.utils
Class DynamicGetter

java.lang.Object
  extended by com.gentlyweb.utils.DynamicGetter

public class DynamicGetter
extends java.lang.Object

This class is used to perform access into a Java object using a String value with a specific notation. This class differs from the Getter class in that instead of creating the chain of methods when the getter is instantiated it will instead get the actual method from the object passed in.


Constructor Summary
DynamicGetter(java.lang.String ref, java.lang.Object obj)
          Get the getter associated with the named reference.
 
Method Summary
 java.lang.Class getBaseClass()
           
 java.lang.Class getType()
          Get the class of the type of object we would return from the getValue(Object) method.
 java.lang.Object getValue(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicGetter

public DynamicGetter(java.lang.String ref,
                     java.lang.Object obj)
              throws java.lang.IllegalArgumentException,
                     java.lang.IllegalAccessException,
                     java.lang.reflect.InvocationTargetException
Get the getter associated with the named reference. Return null if there isn't one, or if we can't access it.

Parameters:
ref - The reference for the getter.
obj - The Object to build up the getter from.
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
Method Detail

getBaseClass

public java.lang.Class getBaseClass()

getType

public java.lang.Class getType()
Get the class of the type of object we would return from the getValue(Object) method.

Returns:
The class.

getValue

public java.lang.Object getValue(java.lang.Object obj)
                          throws java.lang.IllegalAccessException,
                                 java.lang.reflect.InvocationTargetException
Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException