public class ReflectUtils extends Object
| 构造器和说明 |
|---|
ReflectUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getCodeBase(Class<?> cls)
得到类所在地址,可以是文件,也可以是jar包
|
static Method |
getMethod(Class clazz,
String methodName,
Class... argsType)
加载Method方法
|
static Method |
getMethod(String clazzName,
String methodName,
String[] argsType)
加载Method方法
|
static Method |
getPropertyGetterMethod(Class clazz,
String property)
得到get/is方法
|
protected static String |
getPropertyNameFromBeanReadMethod(Method method) |
static Method |
getPropertySetterMethod(Class clazz,
String property,
Class propertyClazz)
得到set方法
|
protected static boolean |
isBeanPropertyReadMethod(Method method) |
protected static boolean |
isBeanPropertyWriteMethod(Method method) |
static boolean |
isPrimitives(Class<?> clazz)
是否默认类型,基本类型+string+date
|
protected static boolean |
isPublicInstanceField(Field field) |
public static boolean isPrimitives(Class<?> clazz)
clazz - the clspublic static String getCodeBase(Class<?> cls)
cls - the clspublic static Method getMethod(String clazzName, String methodName, String[] argsType)
clazzName - 类名methodName - 方法名argsType - 参数列表public static Method getMethod(Class clazz, String methodName, Class... argsType)
clazz - 类methodName - 方法名argsType - 参数列表public static Method getPropertySetterMethod(Class clazz, String property, Class propertyClazz)
clazz - 类property - 属性propertyClazz - 属性public static Method getPropertyGetterMethod(Class clazz, String property)
clazz - 类property - 属性protected static boolean isBeanPropertyReadMethod(Method method)
protected static String getPropertyNameFromBeanReadMethod(Method method)
protected static boolean isBeanPropertyWriteMethod(Method method)
protected static boolean isPublicInstanceField(Field field)
Copyright © 2008–2018 The Ant Financial. All rights reserved.