public final class AnnotatedFieldsProvider extends Object
| Modifier and Type | Method and Description |
|---|---|
static List<Field> |
getAnnotatedFields(Class<?> objectType,
Class<? extends Annotation>... annotationClasses)
Returns all fields of the given object type or one of its ancestors which are annotated with at least one of
the given annotation classes.
Note: there is no commitment to a specific order for the returned list of fields. |
static List<Field> |
getSortedAnnotatedFields(Class<?> objectType,
Class<? extends Annotation>... annotationClasses)
Returns a list of fields which are annotated in the given
objectType with one of the given
annotation classes. |
public static List<Field> getSortedAnnotatedFields(Class<?> objectType, Class<? extends Annotation>... annotationClasses)
objectType with one of the given
annotation classes. The fields are sorted according to their respective position values with the following
semantics:
If the position of a field A is less than the position of a field B, than field A comes (not necessarily
directly) before field B.
All fields with the default position value (-1) will come after all fields with explicit positions.
objectType - the object typeannotationClasses - the annotation classespublic static List<Field> getAnnotatedFields(Class<?> objectType, Class<? extends Annotation>... annotationClasses)
objectType - the object typeannotationClasses - the annotation classesCopyright © 2014. All rights reserved.