public final class Annotations extends Object
Annotation
s, Annotated
s and AnnotatedElement
s.Modifier and Type | Method and Description |
---|---|
static Collection<? extends Annotation> |
getAnnotations(Class<?> c,
BeanManager beanManager)
Returns a
Collection of Annotation s 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 Annotation s 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 Annotation s 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 Annotation s, 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 Annotation
s 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 null
metaAnnotationType
- the qualifier annotation type to look for; must
not be null
beanManager
- a BeanManager
for retrieving the
appropriate annotated type when appropriate; may be null
null
subset of Annotation
sNullPointerException
- if host
or metaAnnotationType
is null
retainAnnotationsQualifiedWith(Collection, Class,
BeanManager)
public static final Set<Annotation> getAnnotationsQualifiedWith(AnnotatedElement host, Class<? extends Annotation> metaAnnotationType, BeanManager beanManager)
Set
of Annotation
s 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 null
metaAnnotationType
- the qualifier annotation type to look for; must
not be null
beanManager
- a BeanManager
for retrieving the
appropriate annotated type when appropriate; may be null
null
subset of Annotation
sNullPointerException
- if host
or metaAnnotationType
is null
retainAnnotationsQualifiedWith(Collection, Class,
BeanManager)
public static final Set<Annotation> retainAnnotationsQualifiedWith(Collection<? extends Annotation> suppliedAnnotations, Class<? extends Annotation> metaAnnotationType, BeanManager beanManager)
Collection
of Annotation
s, 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 Annotation
s that will be used as the initial set; may be null
metaAnnotationType
- the qualifier annotation type to look for; must
not be null
beanManager
- a BeanManager
for retrieving the
appropriate annotated type when appropriate; may be null
null
subset of Annotation
sNullPointerException
- if metaAnnotationType
is
null
public static final Collection<? extends Annotation> getAnnotations(Class<?> c, BeanManager beanManager)
Collection
of Annotation
s that are
present on the supplied
Class
, using the BeanManager.createAnnotatedType(Class)
method as appropriate.
This method never returns null
.
c
- the Class
whose Annotation
s should be
returned; must not be null
beanManager
- a BeanManager
whose BeanManager.createAnnotatedType(Class)
method will be called;
may be null
in which case AnnotatedElement.getAnnotations()
will be called insteadnull
Collection
of Annotation
sBeanManager.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 Annotation
s, or
present on one of
those Annotation
s, and so on.
annotation
- the Annotation
to check; must not be
null
qualifierType
- the Class
representing the annotation type
to look for; must
not be null
beanManager
- a BeanManager
whose BeanManager.createAnnotatedType(Class)
method will be called;
may be null
true
if the supplied Annotation
is
ultimately qualified by an annotation with the supplied
qualifierType
as its annotationType
;
false
otherwiseNullPointerException
- if annotation
or qualifierType
is null
Copyright © 2017–2018, microBean. All rights reserved.