public final class Annotations extends Object
Annotations, Annotateds and AnnotatedElements.| Modifier and Type | Method and Description |
|---|---|
static Collection<? extends Annotation> |
getAnnotations(Class<?> c,
BeanManager beanManager)
Returns a
Collection of Annotations that are
present on the supplied
Class, using the BeanManager.createAnnotatedType(Class) method as appropriate. |
static Set<Annotation> |
getAnnotationsQualifiedWith(Annotated host,
Class<? extends Annotation> metaAnnotationType,
BeanManager beanManager)
Returns a
Set of Annotations that are
ultimately qualified with an annotation whose
annotation type is equal
to the supplied metaAnnotationType. |
static Set<Annotation> |
getAnnotationsQualifiedWith(AnnotatedElement host,
Class<? extends Annotation> metaAnnotationType,
BeanManager beanManager)
Returns a
Set of Annotations that are
ultimately qualified with an annotation whose
annotation type is equal
to the supplied metaAnnotationType. |
static boolean |
isAnnotationQualifiedWith(Annotation annotation,
Class<? extends Annotation> qualifierType,
BeanManager beanManager)
Returns
true if the supplied Annotation is
ultimately qualified by an annotation with the supplied
qualifierType as its annotationType. |
static Set<Annotation> |
retainAnnotationsQualifiedWith(Collection<? extends Annotation> suppliedAnnotations,
Class<? extends Annotation> metaAnnotationType,
BeanManager beanManager)
Given a
Collection of Annotations, returns a
subset of them that are found to be ultimately qualified
with an annotation whose annotation type is equal to the supplied metaAnnotationType. |
public static final Set<Annotation> getAnnotationsQualifiedWith(Annotated host, Class<? extends Annotation> metaAnnotationType, BeanManager beanManager)
Set of Annotations that are
ultimately qualified with an annotation whose
annotation type is equal
to the supplied metaAnnotationType.
This method never returns null.
host - the Annotated whose annotations will be used as the
initial set; must not be nullmetaAnnotationType - the qualifier annotation type to look for; must
not be nullbeanManager - a BeanManager for retrieving the
appropriate annotated type when appropriate; may be nullnull subset of AnnotationsNullPointerException - if host or metaAnnotationType is nullretainAnnotationsQualifiedWith(Collection, Class,
BeanManager)public static final Set<Annotation> getAnnotationsQualifiedWith(AnnotatedElement host, Class<? extends Annotation> metaAnnotationType, BeanManager beanManager)
Set of Annotations that are
ultimately qualified with an annotation whose
annotation type is equal
to the supplied metaAnnotationType.
This method never returns null.
host - the AnnotatedElement whose annotations will be used as the
initial set; must not be nullmetaAnnotationType - the qualifier annotation type to look for; must
not be nullbeanManager - a BeanManager for retrieving the
appropriate annotated type when appropriate; may be nullnull subset of AnnotationsNullPointerException - if host or metaAnnotationType is nullretainAnnotationsQualifiedWith(Collection, Class,
BeanManager)public static final Set<Annotation> retainAnnotationsQualifiedWith(Collection<? extends Annotation> suppliedAnnotations, Class<? extends Annotation> metaAnnotationType, BeanManager beanManager)
Collection of Annotations, returns a
subset of them that are found to be ultimately qualified
with an annotation whose annotation type is equal to the supplied metaAnnotationType.
This method never returns null.
suppliedAnnotations - a Collection of Annotations that will be used as the initial set; may be nullmetaAnnotationType - the qualifier annotation type to look for; must
not be nullbeanManager - a BeanManager for retrieving the
appropriate annotated type when appropriate; may be nullnull subset of AnnotationsNullPointerException - if metaAnnotationType is
nullpublic static final Collection<? extends Annotation> getAnnotations(Class<?> c, BeanManager beanManager)
Collection of Annotations that are
present on the supplied
Class, using the BeanManager.createAnnotatedType(Class) method as appropriate.
This method never returns null.
c - the Class whose Annotations should be
returned; must not be nullbeanManager - a BeanManager whose BeanManager.createAnnotatedType(Class) method will be called;
may be null in which case AnnotatedElement.getAnnotations() will be called insteadnull Collection of AnnotationsBeanManager.createAnnotatedType(Class),
AnnotatedElement.getAnnotations()public static final boolean isAnnotationQualifiedWith(Annotation annotation, Class<? extends Annotation> qualifierType, BeanManager beanManager)
true if the supplied Annotation is
ultimately qualified by an annotation with the supplied
qualifierType as its annotationType.
Ultimately qualified means that either the qualifier
annotation represented by the supplied qualifierType is
present on the supplied
annotation or one of its Annotations, or
present on one of
those Annotations, and so on.
annotation - the Annotation to check; must not be
nullqualifierType - the Class representing the annotation type to look for; must
not be nullbeanManager - a BeanManager whose BeanManager.createAnnotatedType(Class) method will be called;
may be nulltrue if the supplied Annotation is
ultimately qualified by an annotation with the supplied
qualifierType as its annotationType;
false otherwiseNullPointerException - if annotation or qualifierType is nullCopyright © 2017–2018, microBean. All rights reserved.