public class ReflectHelper extends Object
| Constructor and Description |
|---|
ReflectHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Constructor |
findConstructor(Class<?> clazz,
Object... args) |
static Method |
findMethod(Class<?> clazz,
String name,
Object... args) |
static Method[] |
findMethodsWithName(Class<?> clazz,
String name,
int noOfParams) |
static Method |
findMethodWithName(Class<?> clazz,
String name,
int noOfParams) |
static <A extends Annotation> |
getAnnotation(Class<?> clazz,
Class<A> annotationClass) |
static List<Class<?>> |
getClassChain(Class<?> clazz) |
static Object |
getEntityId(javax.persistence.EntityManager em,
Object entity) |
static Class<?> |
getEntityIdType(javax.persistence.EntityManager em,
Class<?> entityClass) |
static String |
getGetterName(String field) |
static Class<?> |
getProxiedClass(Class<?> clazz) |
static String |
getSetterName(String field) |
static Class<?> |
getTypeParameter(Class<?> clazz) |
static <T> Class<T> |
getTypeParameter(Class<?> clazz,
int idx) |
static Type[] |
getTypeParameters(Class<?> clazz) |
static Boolean |
hasAnnotation(Class<?> clazz,
Class<? extends Annotation> annotationClass) |
static Object |
invokeMethod(Class<?> clazz,
String name,
Object obj,
Object... args) |
static Object |
invokeMethod(Method method,
Object obj,
Object... args) |
static Object |
newInstance(Class<?> clazz,
Object... args) |
public static Constructor findConstructor(Class<?> clazz, Object... args) throws NoSuchMethodException
NoSuchMethodExceptionpublic static Class<?> getEntityIdType(javax.persistence.EntityManager em, Class<?> entityClass)
public static Method findMethod(Class<?> clazz, String name, Object... args) throws NoSuchMethodException
NoSuchMethodExceptionpublic static Method findMethodWithName(Class<?> clazz, String name, int noOfParams) throws NoSuchMethodException
NoSuchMethodExceptionpublic static Method[] findMethodsWithName(Class<?> clazz, String name, int noOfParams) throws NoSuchMethodException
NoSuchMethodExceptionpublic static Object invokeMethod(Class<?> clazz, String name, Object obj, Object... args)
public static <A extends Annotation> A getAnnotation(Class<?> clazz, Class<A> annotationClass)
public static Boolean hasAnnotation(Class<?> clazz, Class<? extends Annotation> annotationClass)
Copyright © 2018. All rights reserved.