public abstract class ReflectUtils extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
ReflectUtils.ArrayProxy |
static interface |
ReflectUtils.BeanFieldFilter |
static interface |
ReflectUtils.BeanMethodFilter |
static interface |
ReflectUtils.FieldProxy |
static interface |
ReflectUtils.MethodProxy |
static interface |
ReflectUtils.ProxyFactory |
| 限定符和类型 | 字段和说明 |
|---|---|
static ReflectUtils.ProxyFactory |
defaultArrayProxy |
static ReflectUtils.ProxyFactory |
defaultFieldProxy |
static ReflectUtils.ProxyFactory |
defaultMethodProxy |
| 构造器和说明 |
|---|
ReflectUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
arrayGet(Object array,
int index) |
static void |
arraySet(Object array,
int index,
Object value) |
static int |
arraySize(Object array) |
static void |
copy(Object src,
Object dest) |
static Object |
get(Object obj,
String property)
Invokes a object's "getter" method by property name
|
static ReflectUtils.ArrayProxy |
getArrayProxy(Class<?> clazz) |
static ReflectUtils.FieldProxy |
getFieldProxy(Field field) |
static Map<String,Field> |
getFields(Class<?> clazz) |
static Map<String,Field> |
getFields(Class<?> clazz,
ReflectUtils.BeanFieldFilter filter) |
static Method |
getGetterMethod(Class<?> clazz,
String propertyName) |
static Map<String,Method> |
getGetterMethods(Class<?> clazz) |
static Map<String,Method> |
getGetterMethods(Class<?> clazz,
ReflectUtils.BeanMethodFilter filter) |
static String[] |
getInterfaceNames(Class<?> c)
Gets the all interface names of this class
|
static ReflectUtils.MethodProxy |
getMethodProxy(Method method) |
static Object |
getProperty(Object obj,
String property) |
static String |
getPropertyName(Method method) |
static Method |
getSetterMethod(Class<?> clazz,
String propertyName) |
static Map<String,Method> |
getSetterMethods(Class<?> clazz) |
static Map<String,Method> |
getSetterMethods(Class<?> clazz,
ReflectUtils.BeanMethodFilter filter) |
static void |
set(Object obj,
String property,
Object value)
Invokes a object's "setter" method by property name
|
static void |
setProperty(Object obj,
String property,
Object value) |
public static ReflectUtils.ProxyFactory defaultArrayProxy
public static ReflectUtils.ProxyFactory defaultFieldProxy
public static ReflectUtils.ProxyFactory defaultMethodProxy
public static void setProperty(Object obj, String property, Object value) throws Throwable
Throwablepublic static Object getProperty(Object obj, String property) throws Throwable
Throwablepublic static void set(Object obj, String property, Object value) throws Throwable
obj - The instance of a objectproperty - The property name of this objectvalue - The parameter of "setter" method that you want to setThrowable - A runtime exceptionpublic static Object get(Object obj, String property) throws Throwable
obj - The instance of a objectproperty - The property name of this objectThrowable - A runtime exceptionpublic static void arraySet(Object array, int index, Object value) throws Throwable
Throwablepublic static ReflectUtils.ArrayProxy getArrayProxy(Class<?> clazz) throws Throwable
Throwablepublic static ReflectUtils.FieldProxy getFieldProxy(Field field) throws Throwable
Throwablepublic static ReflectUtils.MethodProxy getMethodProxy(Method method) throws Throwable
Throwablepublic static String[] getInterfaceNames(Class<?> c)
c - The class of one objectpublic static Map<String,Method> getSetterMethods(Class<?> clazz, ReflectUtils.BeanMethodFilter filter)
public static Map<String,Method> getGetterMethods(Class<?> clazz, ReflectUtils.BeanMethodFilter filter)
public static Map<String,Field> getFields(Class<?> clazz, ReflectUtils.BeanFieldFilter filter)
Copyright © 2016. All rights reserved.