public class MethodUtils
extends org.apache.commons.lang.reflect.MethodUtils
| 构造器和说明 |
|---|
MethodUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Method |
findGetterMethod(Class<?> clazz,
Field field) |
static Method |
findGetterMethod(Class<?> clazz,
String fieldName) |
static Method |
findPublicMethod(Class<?> clazz,
String name,
Class<?>[] signatures) |
static Method |
findSetterMethod(Class<?> clazz,
Field field) |
static List<Class> |
getMethodGenericParameterTypes(Method method)
通过反射,获得方法输入参数第一个输入参数的所有泛型参数的实际类型.
|
static List<Class> |
getMethodGenericParameterTypes(Method method,
int index)
通过反射,获得方法输入参数第index个输入参数的所有泛型参数的实际类型.
|
static Class |
getMethodGenericReturnType(Method method)
通过反射,获得方法返回值第一个泛型参数的实际类型.
|
static Class |
getMethodGenericReturnType(Method method,
int index)
通过反射,获得方法返回值泛型参数的实际类型.
|
static Method |
getPublicMethod(Class<?> clazz,
String name,
Class<?>[] signatures) |
static boolean |
hasMethod(Class<?> clazz,
String method,
Class<?>... parameterTypes)
判断clazz中是否有指定的方法
|
static boolean |
isGetterMethod(Method method) |
static boolean |
isIsMethod(Method method) |
static boolean |
isSetterMethod(Method method) |
getAccessibleMethod, getAccessibleMethod, getAccessibleMethod, getMatchingAccessibleMethod, invokeExactMethod, invokeExactMethod, invokeExactMethod, invokeExactStaticMethod, invokeExactStaticMethod, invokeExactStaticMethod, invokeMethod, invokeMethod, invokeMethod, invokeStaticMethod, invokeStaticMethod, invokeStaticMethodpublic static boolean hasMethod(Class<?> clazz, String method, Class<?>... parameterTypes)
clazz - method - parameterTypes - public static boolean isIsMethod(Method method)
public static boolean isGetterMethod(Method method)
public static boolean isSetterMethod(Method method)
public static Method getPublicMethod(Class<?> clazz, String name, Class<?>[] signatures) throws NoSuchMethodException
public static Method findPublicMethod(Class<?> clazz, String name, Class<?>[] signatures)
public static Class getMethodGenericReturnType(Method method, int index)
Method - method 方法int - index 泛型参数所在索引,从0开始.Object.classpublic static Class getMethodGenericReturnType(Method method)
Method - method 方法Object.classpublic static List<Class> getMethodGenericParameterTypes(Method method, int index)
Method - method 方法int - index 第几个输入参数Copyright © 2016. All rights reserved.