public class FieldUtils
extends org.apache.commons.lang.reflect.FieldUtils
| 构造器和说明 |
|---|
FieldUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static List<Field> |
getAllFields(Class<?> clazz)
获取指定类的所有属性(包含super class的属性),包括private、protected、public
|
static List<Field> |
getAllFields(Class<?> clazz,
boolean excludeStaticFileds)
获取指定类的所有属性(包含super class的属性),包括private、protected、public
|
static List<Field> |
getAllFields(Class<?> clazz,
Class<? extends Annotation> annotation,
boolean excludeStaticFileds)
获取指定类的所有属性(包含super class的属性),包括private、protected、public
|
static Object |
getBeanProperty(Object target,
String name)
已过时。
|
static Class<?> |
getBeanPropertyType(Class<?> clazz,
String name)
已过时。
|
static Object |
getField(Object target,
String name) |
static Class |
getFieldGenericType(Class clazz,
String fieldName) |
static Class |
getFieldGenericType(Class clazz,
String fieldName,
int index) |
static Class |
getFieldGenericType(Field field)
通过反射,获得Field泛型参数的实际类型.
|
static Class |
getFieldGenericType(Field field,
int index)
通过反射,获得Field泛型参数的实际类型.
|
static String |
getFieldName(Method m) |
static void |
setBeanProperty(Object target,
String name,
Class<?> type,
Object value)
已过时。
|
static void |
setBeanProperty(Object target,
String name,
Object value)
已过时。
|
getDeclaredField, getDeclaredField, getField, getField, readDeclaredField, readDeclaredField, readDeclaredStaticField, readDeclaredStaticField, readField, readField, readField, readField, readStaticField, readStaticField, readStaticField, readStaticField, writeDeclaredField, writeDeclaredField, writeDeclaredStaticField, writeDeclaredStaticField, writeField, writeField, writeField, writeField, writeStaticField, writeStaticField, writeStaticField, writeStaticFieldpublic static List<Field> getAllFields(Class<?> clazz)
clazz - public static List<Field> getAllFields(Class<?> clazz, boolean excludeStaticFileds)
clazz - excludeStaticFileds - 是否排除static属性public static List<Field> getAllFields(Class<?> clazz, Class<? extends Annotation> annotation, boolean excludeStaticFileds)
clazz - annotation - 只获取有指定注解的属性excludeStaticFileds - 是否排除static属性public static Class getFieldGenericType(Field field, int index)
Field - field 字段int - index 泛型参数所在索引,从0开始.Object.classpublic static Class getFieldGenericType(Class clazz, String fieldName, int index)
public static Class getFieldGenericType(Field field)
Field - field 字段int - index 泛型参数所在索引,从0开始.Object.class@Deprecated public static Class<?> getBeanPropertyType(Class<?> clazz, String name)
@Deprecated public static Object getBeanProperty(Object target, String name)
target - name - @Deprecated public static void setBeanProperty(Object target, String name, Object value)
target - name - 属性名value - 设置的属性值@Deprecated public static void setBeanProperty(Object target, String name, Class<?> type, Object value)
target - name - 属性名type - 属性类型value - 设置的属性值Copyright © 2016. All rights reserved.