|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.solder.reflection.AnnotationInspector
public class AnnotationInspector
Inspect an AnnotatedElement
or Annotated
to obtain its meta-annotations and annotations,
featuring support for Stereotype
annotations as a transitive annotation provider.
Method Summary | ||
---|---|---|
static
|
getAnnotation(Annotated annotated,
Class<A> annotationType,
BeanManager beanManager)
Inspect the Annotated and retrieve the specified annotation
type, if present. |
|
static
|
getAnnotation(AnnotatedElement element,
Class<A> annotationType,
BeanManager beanManager)
Inspect the AnnotatedElement and retrieve the specified annotation
type, if present. |
|
static
|
getAnnotation(AnnotatedElement element,
Class<A> annotationType,
boolean transitive,
BeanManager beanManager)
Inspect the AnnotatedElement for a specific annotation type. |
|
static
|
getAnnotationFromStereotype(Annotated annotated,
Class<A> annotationType,
BeanManager beanManager)
Discover if the Annotated has been annotated with a @
Stereotype that provides the specified annotation type and
return it. |
|
static
|
getAnnotationFromStereotype(AnnotatedElement element,
Class<A> annotationType,
BeanManager beanManager)
Discover if the AnnotatedElement has been annotated with a @
Stereotype that provides the annotation type and return it. |
|
static Set<Annotation> |
getAnnotations(Annotated element,
Class<? extends Annotation> metaAnnotationType)
Inspects an annotated element for any annotations with the given meta annotation. |
|
static
|
getMetaAnnotation(Annotated element,
Class<A> annotationType)
Inspects an annotated element for the given meta annotation. |
|
static boolean |
isAnnotationPresent(Annotated annotated,
Class<? extends Annotation> annotationType,
BeanManager beanManager)
Discover if the Annotated has been annotated with the specified
annotation type. |
|
static boolean |
isAnnotationPresent(AnnotatedElement element,
Class<? extends Annotation> annotationType,
BeanManager beanManager)
Discover if the AnnotatedElement has been annotated with the
specified annotation type. |
|
static boolean |
isAnnotationPresent(AnnotatedElement element,
Class<? extends Annotation> annotationType,
boolean transitive,
BeanManager beanManager)
Discover if the AnnotatedElement has been annotated with the
specified annotation type. |
|
static boolean |
isAnnotationPresentOnStereotype(Annotated annotated,
Class<? extends Annotation> annotationType,
BeanManager beanManager)
Discover if the Annotated has been annotated with a @
Stereotype that provides the specified annotation type. |
|
static boolean |
isAnnotationPresentOnStereotype(AnnotatedElement element,
Class<? extends Annotation> annotationType,
BeanManager beanManager)
Discover if the AnnotatedElement has been annotated with a @
Stereotype that provides the annotation type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isAnnotationPresent(AnnotatedElement element, Class<? extends Annotation> annotationType, BeanManager beanManager)
AnnotatedElement
has been annotated with the
specified annotation type. This method discovers annotations defined on
the element as well as annotations inherited from a CDI @
Stereotype
on the element.
element
- The element to inspectannotationType
- The annotation type to expectbeanManager
- The CDI BeanManager instance
true
if annotation is present either on the element
itself or one of its stereotypes, false
if the
annotation is not presentpublic static boolean isAnnotationPresent(Annotated annotated, Class<? extends Annotation> annotationType, BeanManager beanManager)
Annotated
has been annotated with the specified
annotation type. This method discovers annotations defined on
the element as well as annotations inherited from a CDI @
Stereotype
on the element.
element
- The element to inspectannotationType
- The annotation type to expectbeanManager
- The CDI BeanManager instance
true
if annotation is present either on the element itself or one of its stereotypes,
false
if the annotation is not presentpublic static boolean isAnnotationPresent(AnnotatedElement element, Class<? extends Annotation> annotationType, boolean transitive, BeanManager beanManager)
AnnotatedElement
has been annotated with the
specified annotation type. If the transitive argument is true
, this method also discovers annotations inherited from a CDI @
Stereotype
on the element.
element
- The element to inspectannotationType
- The annotation to expecttransitive
- Whether annotations provided by stereotypes should be
consideredbeanManager
- The CDI BeanManager instance
true
if annotation is present on the element itself
or (if specified) one of its stereotypes, false
if the annotation is
not presentpublic static boolean isAnnotationPresentOnStereotype(AnnotatedElement element, Class<? extends Annotation> annotationType, BeanManager beanManager)
AnnotatedElement
has been annotated with a @
Stereotype
that provides the annotation type.
element
- The element to inspectannotationType
- The annotation type to expectbeanManager
- The CDI BeanManager instance
true
if annotation is provided by a stereotype on the element,
false
if the annotation is not presentpublic static boolean isAnnotationPresentOnStereotype(Annotated annotated, Class<? extends Annotation> annotationType, BeanManager beanManager)
Annotated
has been annotated with a @
Stereotype
that provides the specified annotation type.
element
- The element to inspect.annotationType
- The annotation type to expectbeanManager
- The CDI BeanManager instance
true
if annotation is provided by a stereotype on the element,
false
if the annotation is not presentpublic static <A extends Annotation> A getAnnotation(AnnotatedElement element, Class<A> annotationType, BeanManager beanManager)
AnnotatedElement
and retrieve the specified annotation
type, if present. This method discovers annotations defined on
the element as well as annotations inherited from a CDI @
Stereotype
on the element.
element
- The element to inspectannotationType
- The annotation type to expectbeanManager
- The CDI BeanManager instance
public static <A extends Annotation> A getAnnotation(Annotated annotated, Class<A> annotationType, BeanManager beanManager)
Annotated
and retrieve the specified annotation
type, if present. This method discovers annotations defined on
the element as well as annotations inherited from a CDI @
Stereotype
on the element.
annotated
- The element to inspectannotationType
- The annotation type to expectbeanManager
- The CDI BeanManager instance
public static <A extends Annotation> A getAnnotation(AnnotatedElement element, Class<A> annotationType, boolean transitive, BeanManager beanManager)
AnnotatedElement
for a specific annotation type. If the
transitive argument is true
, this method also discovers
annotations inherited from a CDI @ Stereotype
on the element.
element
- The element to inspectannotationType
- The annotation type to expecttransitive
- Whether the annotation may be used as a meta-annotation
or notbeanManager
- The CDI BeanManager instance
public static <A extends Annotation> A getAnnotationFromStereotype(AnnotatedElement element, Class<A> annotationType, BeanManager beanManager)
AnnotatedElement
has been annotated with a @
Stereotype
that provides the annotation type and return it.
element
- The element to inspectannotationType
- The annotation type to expectbeanManager
- The CDI BeanManager instance
public static <A extends Annotation> A getAnnotationFromStereotype(Annotated annotated, Class<A> annotationType, BeanManager beanManager)
Annotated
has been annotated with a @
Stereotype
that provides the specified annotation type and
return it.
element
- The element to inspect.annotationType
- The annotation type to expectbeanManager
- The CDI BeanManager instance
public static <A extends Annotation> A getMetaAnnotation(Annotated element, Class<A> annotationType)
element
- The element to inspectannotationType
- The meta annotation to search for
public static Set<Annotation> getAnnotations(Annotated element, Class<? extends Annotation> metaAnnotationType)
element
- The element to inspectannotationType
- The meta annotation to search for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |