public final class ReflectionUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Class<?>[] |
NO_PARAM_SIGNATURE |
static java.lang.Class<?>[] |
SINGLE_OBJECT_PARAM_SIGNATURE |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.reflect.Method |
extractMethod(java.lang.Class<?> clazz,
java.lang.String methodName) |
static java.lang.reflect.Method |
extractMethod(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?> parameterType) |
static java.lang.reflect.Field |
findField(java.lang.Class<?> classToCheck,
java.lang.String propertyName) |
static java.lang.reflect.Method |
findGetterMethod(java.lang.Class<?> rootClass,
java.lang.String propertyName)
Try to find a getter method by a property name.
|
static <T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<?> classToCheck,
java.lang.String propertyName,
java.lang.Class<T> annotationClass) |
static java.lang.reflect.Method |
getClassGetter(java.lang.Class<?> classToCheck,
java.lang.String propertyName)
Try to find a class getter method by a property name.
|
static java.lang.reflect.Method |
getClassSetter(java.lang.Class<?> classToCheck,
java.lang.String propertyName,
java.lang.Class<?> propertyType)
Try to find a class setter method by a property name.
|
static java.lang.reflect.Method |
getClassSetter(java.lang.Class<?> classToCheck,
java.lang.String propertyName,
java.lang.reflect.Method getterMethod)
Try to find a class setter method by a property name.
|
static java.lang.String[] |
getPropertyParts(java.lang.String property) |
static <T> T |
invoke(java.lang.Object thisObject,
java.lang.reflect.Method method) |
static <T> T |
invoke(java.lang.Object thisObject,
java.lang.reflect.Method method,
java.lang.Object parameter) |
static void |
makePublic(java.lang.reflect.AccessibleObject accessibleObject) |
public static final java.lang.Class<?>[] NO_PARAM_SIGNATURE
public static final java.lang.Class<?>[] SINGLE_OBJECT_PARAM_SIGNATURE
public static void makePublic(java.lang.reflect.AccessibleObject accessibleObject)
public static java.lang.reflect.Method findGetterMethod(java.lang.Class<?> rootClass,
java.lang.String propertyName)
rootClass - a root class form which begin to find a getterpropertyName - a property namepublic static java.lang.reflect.Method getClassGetter(java.lang.Class<?> classToCheck,
java.lang.String propertyName)
classToCheck - a class in which find a getterpropertyName - a property namepublic static java.lang.reflect.Method getClassSetter(java.lang.Class<?> classToCheck,
java.lang.String propertyName,
java.lang.reflect.Method getterMethod)
classToCheck - a class in which find a setterpropertyName - a property namegetterMethod - a getter method for getting a type of a propertypublic static java.lang.reflect.Method getClassSetter(java.lang.Class<?> classToCheck,
java.lang.String propertyName,
java.lang.Class<?> propertyType)
classToCheck - a class in which find a setterpropertyName - a property namepropertyType - a type of a propertypublic static java.lang.reflect.Field findField(java.lang.Class<?> classToCheck,
java.lang.String propertyName)
public static java.lang.String[] getPropertyParts(java.lang.String property)
public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<?> classToCheck,
java.lang.String propertyName,
java.lang.Class<T> annotationClass)
public static java.lang.reflect.Method extractMethod(java.lang.Class<?> clazz,
java.lang.String methodName)
throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodExceptionpublic static <T> T invoke(java.lang.Object thisObject,
java.lang.reflect.Method method)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionpublic static java.lang.reflect.Method extractMethod(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?> parameterType)
throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodExceptionpublic static <T> T invoke(java.lang.Object thisObject,
java.lang.reflect.Method method,
java.lang.Object parameter)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetException