public final class Reflection extends Object
| Modifier and Type | Method and Description |
|---|---|
static List<Annotation> |
allAnnotations(AnnotatedElement e) |
static <T extends Annotation> |
allAnnotationsByType(AnnotatedElement e,
Class<T> type) |
static List<Field> |
allDeclaredFieldsOf(Class<?> type) |
static List<AnnotatedType> |
annotatedComponentTypes(AnnotatedType annotatedType) |
static Object |
defaultValueOf(Class<? extends Annotation> annotationType,
String attribute) |
static <T> Constructor<T> |
findConstructor(Class<T> type,
Class<?>... parameterTypes) |
static <T> Constructor<T> |
findDeclaredConstructor(Class<T> type,
Class<?>... parameterTypes) |
static Field |
findField(Class<?> type,
String fieldName) |
static Method |
findMethod(Class<?> target,
String methodName,
Class<?>... argTypes) |
static <T> T |
instantiate(Class<T> clazz) |
static <T> T |
instantiate(Constructor<T> ctor,
Object... args) |
static Object |
invoke(Method method,
Object target,
Object... args) |
static Class<?> |
maybeWrap(Class<?> clazz) |
static RuntimeException |
reflectionException(Exception ex) |
static void |
setField(Field field,
Object target,
Object value,
boolean suppressProtection) |
static Method |
singleAbstractMethodOf(Class<?> rawClass) |
static <T> Constructor<T> |
singleAccessibleConstructor(Class<T> type) |
static Set<org.javaruntype.type.Type<?>> |
supertypes(org.javaruntype.type.Type<?> bottom) |
public static <T> Constructor<T> findConstructor(Class<T> type, Class<?>... parameterTypes)
public static <T> Constructor<T> findDeclaredConstructor(Class<T> type, Class<?>... parameterTypes)
public static <T> Constructor<T> singleAccessibleConstructor(Class<T> type)
public static <T> T instantiate(Class<T> clazz)
public static <T> T instantiate(Constructor<T> ctor, Object... args)
public static Set<org.javaruntype.type.Type<?>> supertypes(org.javaruntype.type.Type<?> bottom)
public static Object defaultValueOf(Class<? extends Annotation> annotationType, String attribute)
public static List<Annotation> allAnnotations(AnnotatedElement e)
public static <T extends Annotation> List<T> allAnnotationsByType(AnnotatedElement e, Class<T> type)
public static Method findMethod(Class<?> target, String methodName, Class<?>... argTypes)
public static void setField(Field field, Object target, Object value, boolean suppressProtection)
public static RuntimeException reflectionException(Exception ex)
public static List<AnnotatedType> annotatedComponentTypes(AnnotatedType annotatedType)
Copyright © 2019. All rights reserved.