javax.enterprise.inject.spi
Interface Annotated

All Known Subinterfaces:
AnnotatedCallable<X>, AnnotatedConstructor<X>, AnnotatedField<X>, AnnotatedMember<X>, AnnotatedMethod<X>, AnnotatedParameter<X>, AnnotatedType<X>

public interface Annotated

The metadata for an annotated element which can be parsed by the BeanManager. The semantics are similar to AnnotatedElement.

Author:
Pete Muir, Clint Popetz

Method Summary
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType)
          Get the annotation instance on the annoated element for a given annotation type.
 java.util.Set<java.lang.annotation.Annotation> getAnnotations()
          Get all the annotation instances on the annotated element
 java.lang.reflect.Type getBaseType()
          Get the type of the annotated element
 java.util.Set<java.lang.reflect.Type> getTypeClosure()
          Get all types the base type should be considered assignable to
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Determine if an annotation is present on the annotated element
 

Method Detail

getBaseType

java.lang.reflect.Type getBaseType()
Get the type of the annotated element

Returns:
the type

getTypeClosure

java.util.Set<java.lang.reflect.Type> getTypeClosure()
Get all types the base type should be considered assignable to

Returns:
a set of types the base type should be considered assignable to

getAnnotation

<T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType)
Get the annotation instance on the annoated element for a given annotation type.

Type Parameters:
T - the type of the annotation
Parameters:
annotationType - the class object of the annotation type
Returns:
the annotation instance, or null if no annotation is present for the given annotationType

getAnnotations

java.util.Set<java.lang.annotation.Annotation> getAnnotations()
Get all the annotation instances on the annotated element

Returns:
the annotation instances, or an empty set if no annotations are present

isAnnotationPresent

boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Determine if an annotation is present on the annotated element

Parameters:
annotationType - the annotation type to check for
Returns:
true if the annotation is present


Copyright © 2008-2009. All Rights Reserved.