Package com.gentlyweb.utils
Class DynamicGetter
- java.lang.Object
-
- 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 theGetter
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
Constructors Constructor Description DynamicGetter(java.lang.String ref, java.lang.Object obj)
Get the getter associated with the named reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class
getBaseClass()
java.lang.Class
getType()
Get the class of the type of object we would return from thegetValue(Object)
method.java.lang.Object
getValue(java.lang.Object obj)
-
-
-
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 thegetValue(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
-
-