public class ReflectHelper extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
ReflectHelper.ClassDecision |
static class |
ReflectHelper.MethodParameter |
static interface |
ReflectHelper.Processor |
| 限定符和类型 | 字段和说明 |
|---|---|
static ReflectHelper.ClassDecision |
NOT_NULL |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
extend(T o,
Object... objects)
已过时。
|
static <S,T extends S> |
extendInterface(T o,
Object... objects) |
static void |
foreachClass(ReflectHelper.Processor processor,
ClassNameFilter filter,
String... packages) |
static Field[] |
getAllDeclaredFields(Class<?> clz) |
static Field[] |
getAllDeclaredFields(Class<?> clz,
ReflectHelper.ClassDecision decision) |
static Class[] |
getAllInterfaces(Class clz) |
static <T extends Annotation> |
getAnnotation(Class<T> annotationClass,
AnnotatedElement... elements) |
static <T extends Annotation> |
getAnnotation(Class<T> annotationClass,
AnnotatedElement element,
Set<AnnotatedElement> checked) |
static String |
getParameterName(Constructor constructor,
int index) |
static String |
getParameterName(Method method,
int index) |
static String |
getParameterName(Object executable,
int index,
String prefix) |
static Object |
invoke(Object obj,
Method method,
Object[] args) |
static <T> T |
throwExceptionObject(Class<T> interfaceClass,
Throwable th) |
static String |
typeToCodeStr(Type type) |
public static final ReflectHelper.ClassDecision NOT_NULL
public static <T extends Annotation> T getAnnotation(Class<T> annotationClass, AnnotatedElement element, Set<AnnotatedElement> checked)
public static <T extends Annotation> T getAnnotation(Class<T> annotationClass, AnnotatedElement... elements)
public static String getParameterName(Method method, int index) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassNotFoundException
public static String getParameterName(Constructor constructor, int index) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassNotFoundException
public static Field[] getAllDeclaredFields(Class<?> clz, ReflectHelper.ClassDecision decision)
public static Object invoke(Object obj, Method method, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
public static void foreachClass(ReflectHelper.Processor processor, ClassNameFilter filter, String... packages)
public static <T> T throwExceptionObject(Class<T> interfaceClass, Throwable th)
@Deprecated public static <T> T extend(T o, Object... objects)
public static <S,T extends S> S extendInterface(T o,
Object... objects)
S - 必须是接口T - extends So - objectobjects - 需要扩展出来的对象,只扩展接口Copyright © 2020. All rights reserved.