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