public class ReflectionKit extends Object
反射工具类
| 构造器和说明 |
|---|
ReflectionKit() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<Field> |
doGetFieldList(Class<?> clazz)
获取该类的所有属性列表
|
static List<Field> |
excludeOverrideSuperField(List<Field> fieldList,
List<Field> superFieldList)
排序重置父类属性
|
static List<Field> |
getFieldList(Class<?> clazz)
获取该类的所有属性列表
|
static Map<String,Field> |
getFieldMap(Class<?> clazz)
获取该类的所有属性列表
|
static Method |
getMethod(Class<?> cls,
Field field) |
static String |
getMethodCapitalize(Field field,
String str)
反射 method 方法名,例如 getId
|
static Object |
getMethodValue(Class<?> cls,
Object entity,
String str)
获取 public get方法的值
|
static Object |
getMethodValue(Object entity,
String str)
获取 public get方法的值
|
static Class |
getSuperClassGenericType(Class clazz,
int index)
反射对象获取泛型
|
static String |
setMethodCapitalize(Field field,
String str)
已过时。
3.0.8
|
public static String getMethodCapitalize(Field field, String str)
反射 method 方法名,例如 getId
field - str - 属性字符串内容@Deprecated public static String setMethodCapitalize(Field field, String str)
反射 method 方法名,例如 setVersion
field - Fieldstr - String JavaBean类的version属性名public static Object getMethodValue(Class<?> cls, Object entity, String str)
获取 public get方法的值
cls - ignoreentity - 实体str - 属性字符串内容public static Object getMethodValue(Object entity, String str)
获取 public get方法的值
entity - 实体str - 属性字符串内容public static Class getSuperClassGenericType(Class clazz, int index)
反射对象获取泛型
clazz - 对象index - 泛型所在位置public static List<Field> excludeOverrideSuperField(List<Field> fieldList, List<Field> superFieldList)
排序重置父类属性
fieldList - 子类属性superFieldList - 父类属性