public class ReflectUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
EMPTY_PARAM |
static String |
PARAM_CLASS_SPLIT |
| 构造器和说明 |
|---|
ReflectUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Class<?> |
forName(String className) |
static Class<?>[] |
forNames(String classList) |
static Object |
getEmptyObject(Class<?> returnType) |
static String |
getMethodDesc(Method method)
获取方法的标示 : method_name + "(" + paramDesc + ")"
|
static String |
getMethodDesc(String methodName,
String paramDesc)
获取方法的标示 : method_name + "(" + paramDesc + ")"
|
static String |
getMethodParamDesc(Method method)
获取method方式的接口参数,以逗号分割,拼接clz列表。
|
static String |
getName(Class<?> clz)
需要支持一维数组、二维数组等
|
static Class<?> |
getPrimitiveClass(String name) |
static List<Method> |
getPublicMethod(Class<?> clz)
获取clz public method
1)不包含构造函数
2)不包含Object.class
3)包含该clz的父类的所有public方法
|
public static String getMethodParamDesc(Method method)
method - public static String getMethodDesc(Method method)
method - public static String getMethodDesc(String methodName, String paramDesc)
- public static Class<?>[] forNames(String classList) throws ClassNotFoundException
public static Class<?> forName(String className) throws ClassNotFoundException
public static List<Method> getPublicMethod(Class<?> clz)
1)不包含构造函数
2)不包含Object.class
3)包含该clz的父类的所有public方法
clz - Copyright © 2016. All rights reserved.