public final class Annotations extends Object
Internal API: these methods are part of the internal API and may be removed, have their signature change, or have their access level decreased from public to protected, package, or private in future versions without notice.
| Modifier and Type | Method and Description |
|---|---|
static <T extends Annotation> |
findAnnotation(Class<?> klass,
Class<T> annotationClass)
Find expected annotation on class, or a class in the hierarchy.
|
static <T extends Annotation> |
findAnnotation(Field field,
Class<T> annotationClass)
Find expected annotation on given field, or a class in the hierarchy.
|
static Collection<Annotation> |
findAnnotations(Field field)
Find all annotations on given field.
|
public static Collection<Annotation> findAnnotations(Field field)
field - The field.public static <T extends Annotation> T findAnnotation(Class<?> klass, Class<T> annotationClass)
T - Type of annotation.klass - Class.annotationClass - Annotation class to look for.null otherwise.public static <T extends Annotation> T findAnnotation(Field field, Class<T> annotationClass)
T - Type of annotation.field - Class.annotationClass - Annotation class to look for.null otherwise.Copyright © 2019. All rights reserved.