public abstract class ReflectionUtils extends Object
| 构造器和说明 |
|---|
ReflectionUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Class<?> |
getInterfaceGenericType(Class<?> clazz)
Get the class implements interfaces generic type(first interface and first generic type)
|
static Class<?> |
getInterfaceGenericType(Class<?> clazz,
int interfaceIndex,
int genericTypeIndex)
Get the class generic type
|
static Object |
invokeMethod(Object obj,
Method method,
Object... args)
Invoke method
|
static <E> E |
newInstance(Class<E> clazz)
Creates a new instance of the class represented by this Class object
|
static void |
setFieldValue(Object obj,
Field field,
Object value)
Set field value
|
public static <E> E newInstance(Class<E> clazz)
E - clazz - the classpublic static Class<?> getInterfaceGenericType(Class<?> clazz)
clazz - the classpublic static Class<?> getInterfaceGenericType(Class<?> clazz, int interfaceIndex, int genericTypeIndex)
clazz - the classinterfaceIndex - the index of implements the interfacegenericTypeIndex - the index of the generic typepublic static Object invokeMethod(Object obj, Method method, Object... args)
obj - the objectmethod - the methodargs - the method argumentsCopyright © 2017. All rights reserved.