public class ReflectHelper extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ReflectHelper.MethodParameter |
| 限定符和类型 | 方法和说明 |
|---|---|
static <S,T extends S> |
extendInterface(T o,
Object... objects) |
static void |
foreachClass(Consumer<Class<?>> processor,
Function<String,Boolean> filter,
String... packages) |
static Field[] |
getAllDeclaredFields(Class<?> clz) |
static Field[] |
getAllDeclaredFields(Class<?> clz,
Function<Class<?>,Boolean> 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(Executable executable,
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 boolean |
isAssignable(Class<?> from,
Class<?> to) |
static boolean |
isMatch(Type instanceType,
Type serviceType) |
static <T> T |
throwExceptionObject(Class<T> interfaceClass,
Function<Method,Throwable> function) |
static <T> T |
throwExceptionObject(Class<T> interfaceClass,
Supplier<Throwable> supplier) |
static String |
typeToCodeStr(Type type) |
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(Executable executable, int index)
public static Field[] getAllDeclaredFields(Class<?> clz, Function<Class<?>,Boolean> decision)
public static Object invoke(Object obj, Method method, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
public static void foreachClass(Consumer<Class<?>> processor, Function<String,Boolean> filter, String... packages)
public static <T> T throwExceptionObject(Class<T> interfaceClass, Supplier<Throwable> supplier)
public static <T> T throwExceptionObject(Class<T> interfaceClass, Function<Method,Throwable> function)
public static <S,T extends S> S extendInterface(T o,
Object... objects)
S - 必须是接口T - extends So - objectobjects - 需要扩展出来的对象,只扩展接口Copyright © 2021. All rights reserved.