public class ReflectionUtil extends Object
| Constructor and Description |
|---|
ReflectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateHierarchyDistance(Class<?> clazz,
Class<?> parent) |
static List<Class> |
extractActualClassTypeArguments(Type javaType)
Makes sense only for
ParameterizedType |
static Class |
extractClass(Type javaType)
for example: Map
|
static List<Method> |
findAllPersistentGetters(Class methodSource) |
static List<Method> |
getAllMethods(Class methodSource)
list all class methods, including inherited and private,
removes inheritance duplicates
|
static String |
getterToField(Method getter)
ex: getCode() -> code,
isTrue() -> true
|
static Object |
invokeField(Field field,
Object onObject) |
static Object |
invokeFieldEvenIfPrivate(Field field,
Object onObject) |
static Object |
invokeGetter(Method getter,
Object onObject) |
static Object |
invokeGetterEvenIfPrivate(Method getter,
Object onObject) |
static boolean |
isGetter(Method m) |
static boolean |
isPersistentGetter(Method m)
true if method is getter and
is not abstract
is not native
doesn't have @Transient
|
public static List<Method> getAllMethods(Class methodSource)
public static boolean isPersistentGetter(Method m)
public static boolean isGetter(Method m)
public static String getterToField(Method getter)
public static Object invokeGetterEvenIfPrivate(Method getter, Object onObject)
public static Object invokeFieldEvenIfPrivate(Field field, Object onObject)
public static List<Class> extractActualClassTypeArguments(Type javaType)
ParameterizedTypeCopyright © 2014. All rights reserved.