public class ReflectionUtils extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
ReflectionUtils.MethodCallback
Action to take on each method.
|
static interface |
ReflectionUtils.MethodFilter
Callback optionally used to method fields to be operated on by a method callback.
|
| 构造器和说明 |
|---|
ReflectionUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
doWithMethods(Class<?> targetClass,
ReflectionUtils.MethodCallback mc)
Perform the given callback operation on all matching methods of the
given class and superclasses.
|
static void |
doWithMethods(Class<?> targetClass,
ReflectionUtils.MethodCallback mc,
ReflectionUtils.MethodFilter mf)
Perform the given callback operation on all matching methods of the
given class and superclasses.
|
static boolean |
isVoid(Class<?> cls)
Checks if is void.
|
public static void doWithMethods(Class<?> targetClass, ReflectionUtils.MethodCallback mc) throws IllegalArgumentException
The same named method occurring on subclass and superclass will
appear twice, unless excluded by a ReflectionUtils.MethodFilter.
targetClass - class to start looking atmc - the callback to invoke for each methodIllegalArgumentException - the illegal argument exceptiondoWithMethods(Class, MethodCallback, MethodFilter)public static void doWithMethods(Class<?> targetClass, ReflectionUtils.MethodCallback mc, ReflectionUtils.MethodFilter mf) throws IllegalArgumentException
The same named method occurring on subclass and superclass will
appear twice, unless excluded by the specified ReflectionUtils.MethodFilter.
targetClass - class to start looking atmc - the callback to invoke for each methodmf - the filter that determines the methods to apply the callback toIllegalArgumentException - the illegal argument exceptionpublic static boolean isVoid(Class<?> cls)
cls - the clsCopyright © 2022 Baidu, Inc.. All rights reserved.