| java.lang.Object org.strecks.util.ReflectHelper
ReflectHelper | public class ReflectHelper (Code) | | Class with reflection-related helper methods
author: Phil Zoio |
Method Summary | |
public static boolean | checkGenericType(Class inputClass, Class genericInterface, Class specificType) | public static void | checkParameterTypeLength(Method m, int parameterCount) | public static String | checkSetterMethodName(Method m) | public static T | createInstance(String className, Class<T> type) | public static T | createInstance(Class clazz, Class<T> type) | public static Class> | getBeanPropertyType(Object containingBean, String beanPropertyName) | public static Class | getGenericType(Class c, Class genericInterface) | public static Type[] | getGenericTypes(Class c, Class genericInterface) | public static Method | getGetter(Method setterMethod) | public static Method | getMethod(Object o, String methodName) | public static Method | getMethod(String methodName, Class<? extends Object> clazz) | static ParameterizedType | getParameterizedType(Class genericInterface, Class inputClass) | public static String | getPropertyName(String setterName) | public static Method | getSetter(Method getterMethod) | public static String | getTypeArrayDescription(Type[] types) | public static String | getTypeDescription(Type type) | public static boolean | hasReturnValue(Method method) | public static T | invokeMethod(Object o, String methodName, Class<T> returnType) | public static Object | invokeMethod(Object o, String methodName) | public static Object | invokeMethod(Object o, Method method) | public static T | invokeMethod(Object o, Method method, Class<T> returnType) | public static boolean | isGetter(Method method) | public static boolean | isSetter(Method method) |
checkGenericType | public static boolean checkGenericType(Class inputClass, Class genericInterface, Class specificType)(Code) | | Checks that the input type is parameterized by the class expectedType
Parameters: inputClass - the class being tested Parameters: genericInterface - is the interface that the inputClass implements Parameters: specificType - the expected parameterization type false if the expectedType is not assignable from the actual parameterized type |
checkParameterTypeLength | public static void checkParameterTypeLength(Method m, int parameterCount)(Code) | | Checks that a method has exactly the specified number of parameters
|
checkSetterMethodName | public static String checkSetterMethodName(Method m)(Code) | | Checks whether a particular method begins with "set"
|
getBeanPropertyType | public static Class> getBeanPropertyType(Object containingBean, String beanPropertyName)(Code) | | Fnd the type of a the property of containingBean identified by
beanPropertyName
the type of the bean property as a class Class instance |
getGenericType | public static Class getGenericType(Class c, Class genericInterface)(Code) | | Returns the (single) generic parameterization type fo the input class, for a given interface,
if this can be determined
the parameterization class, if this can be determined, otherwise null |
getGenericTypes | public static Type[] getGenericTypes(Class c, Class genericInterface)(Code) | | Returns the (single) generic parameterization type fo the input class, for a given interface,
if this can be determined
the parameterization class, if this can be determined, otherwise null |
getGetter | public static Method getGetter(Method setterMethod)(Code) | | Gets getter corresponding with setter method
|
getPropertyName | public static String getPropertyName(String setterName)(Code) | | Returns the property name associated with a setter method with the given name
|
getSetter | public static Method getSetter(Method getterMethod)(Code) | | Gets setter corresponding with getter method
|
getTypeArrayDescription | public static String getTypeArrayDescription(Type[] types)(Code) | | |
getTypeDescription | public static String getTypeDescription(Type type)(Code) | | Provides basic information on a particular type
|
hasReturnValue | public static boolean hasReturnValue(Method method)(Code) | | |
invokeMethod | public static T invokeMethod(Object o, String methodName, Class<T> returnType)(Code) | | Invokes the specified method on the specified object
|
invokeMethod | public static Object invokeMethod(Object o, String methodName)(Code) | | Invokes the specified method on the specified object
|
|
|