class ReflectionUtils
extends java.lang.Object
Constructor and Description |
---|
ReflectionUtils() |
Modifier and Type | Method and Description |
---|---|
(package private) static <T extends java.lang.annotation.Annotation> |
getAnnotationFromGetterOrField(java.lang.reflect.Method getter,
java.lang.Class<T> annotationClass)
This method searches for a specific type of annotation that is applied to
either the specified getter method or its corresponding class field.
|
(package private) static java.lang.reflect.Field |
getClassFieldByName(java.lang.Class<?> clazz,
java.lang.String fieldName)
Returns the Field object for the specified field name declared in the
specified class.
|
(package private) static java.lang.reflect.Method |
getDeclaredSetterByGetter(java.lang.reflect.Method getter)
Returns the declared setter method that corresponds to the given method.
|
(package private) static java.lang.String |
getFieldNameByGetter(java.lang.reflect.Method getter,
boolean forceCamelCase)
Returns the field name that corresponds to the given getter method,
according to the Java naming convention.
|
(package private) static <T extends java.lang.annotation.Annotation> |
getterOrFieldHasAnnotation(java.lang.reflect.Method getter,
java.lang.Class<T> annotationClass)
Returns true if an annotation for the specified type is found on the
getter method or its corresponding class field.
|
(package private) static java.lang.Class<?> |
resolveClass(java.lang.reflect.Type type)
Resolve the raw class for the given type.
|
static java.lang.String getFieldNameByGetter(java.lang.reflect.Method getter, boolean forceCamelCase)
getter
- The getter method.forceCamelCase
- True if the returned field name should be in camel-case, i.e.
the first letter is lower-cased.static final java.lang.reflect.Method getDeclaredSetterByGetter(java.lang.reflect.Method getter)
getter
- The getter method.static java.lang.reflect.Field getClassFieldByName(java.lang.Class<?> clazz, java.lang.String fieldName)
clazz
- The declaring class where the field will be reflected. This
method will NOT attempt to reflect its superclass if such
field is not found in this class.fieldName
- The case-sensitive name of the field to be searched.static <T extends java.lang.annotation.Annotation> T getAnnotationFromGetterOrField(java.lang.reflect.Method getter, java.lang.Class<T> annotationClass)
static <T extends java.lang.annotation.Annotation> boolean getterOrFieldHasAnnotation(java.lang.reflect.Method getter, java.lang.Class<T> annotationClass)
static java.lang.Class<?> resolveClass(java.lang.reflect.Type type)