public class ReflectUtils extends Object
| Constructor and Description |
|---|
ReflectUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<Field> |
getAllDeclaredFields(Class<?> clazz)
获取所有声明字段,且非static修饰 (包括父类)
|
static List<Method> |
getAllMethods(Class<?> entityClass) |
static Class<?> |
getClassGenericType(boolean isInterface,
Class<?> clazz,
int index) |
static List<Field> |
getDeclaredFields(Class<?> clazz)
获取当前类声明字段,且非static修饰
|
static Method |
getMethod(Class<?> entityClass,
String fieldName) |
static void |
getMethodsRecursion(Class<?> entityClass,
List<Method> list) |
static Class<?> |
getSuperClassGenericType(Class<?> clazz,
int index) |
static <T> boolean |
isFieldNull(T entity,
String fieldName) |
static <T> boolean |
isIdNull(T entity) |
static Object |
methodInvoke(Method method,
Object obj,
Object... args) |
static ReflectEntity |
resolveEntity(Class<?> clazz)
解析反射实体
|
static <T> Map<String,Object> |
resolveEntityFieldAndValue(T entity)
获取实体字段和值
|
public static Class<?> getClassGenericType(boolean isInterface, Class<?> clazz, int index)
public static ReflectEntity resolveEntity(Class<?> clazz)
clazz - 实体类对象public static <T> boolean isIdNull(T entity)
public static <T> boolean isFieldNull(T entity,
String fieldName)
public static <T> Map<String,Object> resolveEntityFieldAndValue(T entity)
T - 实体对象类entity - 实体对象public static List<Field> getDeclaredFields(Class<?> clazz)
clazz - 类对象Copyright © 2021. All rights reserved.