public class ReflectionUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.reflect.Field |
getClassField(java.lang.Class clazz,
java.lang.String fieldName) |
static java.lang.reflect.Method |
getClassMethod(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Class<?>... fieldParams) |
static <Type> Type |
getFinalStatic(java.lang.Class clazz,
java.lang.String fieldName,
java.lang.Class<Type> returnType) |
static java.lang.Object |
getObjectField(java.lang.Object o,
java.lang.String fieldName) |
static java.lang.reflect.Method |
getObjectMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Class<?>... paramsTypes) |
static java.lang.Object |
invoke(java.lang.Object o,
java.lang.reflect.Method method,
java.lang.Object... param) |
static void |
setFinalStatic(java.lang.reflect.Field field,
java.lang.Object newValue) |
static void |
setObjectField(java.lang.Object o,
java.lang.String fieldName,
java.lang.Object value) |
public static java.lang.Object getObjectField(java.lang.Object o, java.lang.String fieldName) throws java.lang.NoSuchFieldException, java.lang.IllegalAccessException
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
public static void setObjectField(java.lang.Object o, java.lang.String fieldName, java.lang.Object value) throws java.lang.NoSuchFieldException, java.lang.IllegalAccessException
java.lang.NoSuchFieldException
java.lang.IllegalAccessException
public static java.lang.Object invoke(java.lang.Object o, java.lang.reflect.Method method, java.lang.Object... param) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public static java.lang.reflect.Method getObjectMethod(java.lang.Object object, java.lang.String methodName, java.lang.Class<?>... paramsTypes) throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public static java.lang.reflect.Method getClassMethod(java.lang.Class clazz, java.lang.String methodName, java.lang.Class<?>... fieldParams) throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public static java.lang.reflect.Field getClassField(java.lang.Class clazz, java.lang.String fieldName) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
public static void setFinalStatic(java.lang.reflect.Field field, java.lang.Object newValue) throws java.lang.Exception
java.lang.Exception
public static <Type> Type getFinalStatic(java.lang.Class clazz, java.lang.String fieldName, java.lang.Class<Type> returnType) throws java.lang.Exception
java.lang.Exception