public class ReflectionUtils extends Object
| 构造器和说明 |
|---|
ReflectionUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<Field> |
getAllFields(Class tempClass)
获取所有的字段
|
static List<Field> |
getAllFields(Object from)
获取所有的字段
|
static Field[] |
getAllFieldsArr(Class tempClass)
获取所有的字段
|
static Field[] |
getAllFieldsArr(Object from)
获取所有的字段ReflectionUtils
|
static Field |
getField(Class tempClass,
String replace)
根据字段名称获取字段
|
static Field |
getField(Object object,
String replace)
根据字段名称获取字段
|
static Object |
getSuperValue(Object o,
String target) |
static Object |
getValue(Object o,
String target) |
static void |
setValue(Object o,
String fieldName,
Object value)
给具体的赋值
|
public static void setValue(Object o, String fieldName, Object value)
o - fieldName - 字段名称value - public static Field[] getAllFieldsArr(Object from)
from - public static Field getField(Class tempClass, String replace) throws NoSuchFieldException
tempClass - replace - NoSuchFieldExceptionpublic static Field getField(Object object, String replace) throws NoSuchFieldException
object - replace - NoSuchFieldExceptionCopyright © 2022 Anji-Plus. All rights reserved.