|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vinculumtech.platform.util.ReflectionHelper
The ReflectionHelper class is the root of all Java reflection queries and invocations.
This class caches java.lang.reflect.Field and java.lang.reflect.Method instances. Additionally it wraps all
failures in PlatformException
instances.
Method Summary | |
static java.lang.Class |
classForName(java.lang.String name)
|
static java.lang.reflect.Method |
findAccessorMethodFor(java.lang.Class type,
boolean isGetter,
java.lang.String fieldName,
int numArgs,
boolean isList,
boolean isMap)
|
static java.lang.reflect.Field |
findFieldNamed(java.util.List fields,
java.lang.String fieldName)
|
static java.lang.Class |
findInterfaceAssignableTo(java.lang.Class interfaceType,
java.lang.Class classType)
|
static java.lang.reflect.Method |
findMethod(java.lang.String methodName,
java.lang.Class targetClass)
|
static java.lang.reflect.Method |
findMethod(java.lang.String methodName,
java.lang.Class targetClass,
java.lang.Class[] argTypes)
|
static java.util.List |
getAllInstanceFields(java.lang.Class type,
java.lang.Class baseType)
Upto but not including the base type, use null for baseType if you want Object fields. |
static java.lang.Object |
getInstanceFieldValue(java.lang.Object source,
java.lang.String fieldName)
|
static java.lang.Object |
getInstanceFieldValue(java.lang.Object source,
java.lang.String fieldName,
boolean isList,
boolean isMap)
|
static java.lang.Object |
getStaticFieldValue(java.lang.Class type,
java.lang.String fieldName)
|
static java.lang.Object |
getStaticFieldValue(java.lang.String objectType,
java.lang.String fieldName)
|
static java.lang.Object |
invoke(java.lang.String methodName,
java.lang.Object target)
|
static java.lang.Object |
invoke(java.lang.String methodName,
java.lang.Object target,
java.lang.Class[] argTypes,
java.lang.Object[] args)
If target is an instance of Class, then the static method will be invoked on the class. |
static boolean |
isPrimitive(java.lang.String name)
|
static boolean |
isPrimitiveObject(java.lang.String name)
|
static java.lang.Object |
newInstance(java.lang.Class type)
|
static java.lang.Object |
newInstance(java.lang.Class type,
java.lang.String arg)
|
static java.lang.Object |
newInstance(java.lang.String className)
|
static java.lang.Object |
newInstance(java.lang.String className,
java.lang.String arg)
|
static java.lang.Class |
primitiveForName(java.lang.String name)
Returns null if the given name is not a primitive type. |
static java.lang.Class |
primitiveObjectForName(java.lang.String name)
|
static void |
putInstanceFieldValue(java.lang.Object source,
java.lang.String fieldName,
java.lang.Object value,
boolean isList,
boolean isMap)
|
static void |
putInstanceFieldValue(java.lang.Object source,
java.lang.String fieldName,
java.lang.Object value,
boolean isList,
boolean isMap,
boolean isStrict)
|
static void |
setInstanceFieldValue(java.lang.Object destination,
java.lang.String fieldName,
java.lang.Object value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final boolean isPrimitive(java.lang.String name)
public static final boolean isPrimitiveObject(java.lang.String name)
public static final java.lang.Class primitiveForName(java.lang.String name)
name
-
public static final java.lang.Class primitiveObjectForName(java.lang.String name)
public static final java.lang.Class classForName(java.lang.String name)
public static final java.lang.Object newInstance(java.lang.String className)
public static final java.lang.Object newInstance(java.lang.Class type)
public static final java.lang.Object newInstance(java.lang.String className, java.lang.String arg)
public static final java.lang.Object newInstance(java.lang.Class type, java.lang.String arg)
public static final java.lang.reflect.Method findMethod(java.lang.String methodName, java.lang.Class targetClass) throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public static final java.lang.reflect.Method findMethod(java.lang.String methodName, java.lang.Class targetClass, java.lang.Class[] argTypes) throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public static final java.lang.reflect.Method findAccessorMethodFor(java.lang.Class type, boolean isGetter, java.lang.String fieldName, int numArgs, boolean isList, boolean isMap) throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public static final java.lang.Object invoke(java.lang.String methodName, java.lang.Object target) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
public static final java.lang.Object invoke(java.lang.String methodName, java.lang.Object target, java.lang.Class[] argTypes, java.lang.Object[] args) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
public static final java.lang.Object getStaticFieldValue(java.lang.String objectType, java.lang.String fieldName)
public static final java.lang.Object getStaticFieldValue(java.lang.Class type, java.lang.String fieldName)
public static final java.lang.Object getInstanceFieldValue(java.lang.Object source, java.lang.String fieldName)
public static final void setInstanceFieldValue(java.lang.Object destination, java.lang.String fieldName, java.lang.Object value)
public static final java.lang.Object getInstanceFieldValue(java.lang.Object source, java.lang.String fieldName, boolean isList, boolean isMap)
public static final void putInstanceFieldValue(java.lang.Object source, java.lang.String fieldName, java.lang.Object value, boolean isList, boolean isMap)
public static final void putInstanceFieldValue(java.lang.Object source, java.lang.String fieldName, java.lang.Object value, boolean isList, boolean isMap, boolean isStrict)
public static final java.lang.reflect.Field findFieldNamed(java.util.List fields, java.lang.String fieldName)
public static final java.util.List getAllInstanceFields(java.lang.Class type, java.lang.Class baseType)
public static final java.lang.Class findInterfaceAssignableTo(java.lang.Class interfaceType, java.lang.Class classType)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |