public final class ReflectionUtils
extends java.lang.Object
A utility class for reflection.
Modifier and Type | Method and Description |
---|---|
static java.util.List<java.lang.reflect.Field> |
getAnnotatedFields(java.lang.Class<?> startClass,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Gets all annotated fields in the entire class hierarchy.
|
static java.util.List<java.lang.reflect.Field> |
getFieldsUpTo(java.lang.Class<?> startClass,
java.lang.Class<?> exclusiveParent)
Gets the class hierarchy.
|
public static java.util.List<java.lang.reflect.Field> getAnnotatedFields(java.lang.Class<?> startClass, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Gets all annotated fields in the entire class hierarchy.
startClass
- the start class in the class hierarchy.annotationClass
- the annotation classpublic static java.util.List<java.lang.reflect.Field> getFieldsUpTo(java.lang.Class<?> startClass, java.lang.Class<?> exclusiveParent)
Gets the class hierarchy.
startClass
- the start classexclusiveParent
- the exclusive parent