Class EmptyAnnotated
- java.lang.Object
-
- org.jboss.weld.annotated.EmptyAnnotated
-
-
Field Summary
Fields Modifier and Type Field Description static EmptyAnnotated
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Annotation>
TgetAnnotation(Class<T> annotationType)
Get program element annotation of a certain annotation type.Set<Annotation>
getAnnotations()
Get all annotations of the program element.<T extends Annotation>
Set<T>getAnnotations(Class<T> annotationType)
Get program element annotations of a certain annotation type.Type
getBaseType()
Get the type of the annotated program element.Set<Type>
getTypeClosure()
Get all types to which the base type should be considered assignable.boolean
isAnnotationPresent(Class<? extends Annotation> annotationType)
Determine if the program element has an annotation of a certain annotation type.
-
-
-
Field Detail
-
INSTANCE
public static final EmptyAnnotated INSTANCE
-
-
Method Detail
-
getBaseType
public Type getBaseType()
Description copied from interface:Annotated
Get the type of the annotated program element.
- Specified by:
getBaseType
in interfaceAnnotated
- Returns:
- the type of the annotated program element
-
getTypeClosure
public Set<Type> getTypeClosure()
Description copied from interface:Annotated
Get all types to which the base type should be considered assignable.
- Specified by:
getTypeClosure
in interfaceAnnotated
- Returns:
- a set of all types to which the base type should be considered assignable
-
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
Description copied from interface:Annotated
Get program element annotation of a certain annotation type. The behavior of this method is intended to be the same behavior as
AnnotatedElement.getAnnotation(Class)
, where repeatable annotations are not supported.- Specified by:
getAnnotation
in interfaceAnnotated
- Type Parameters:
T
- the type of the annotation- Parameters:
annotationType
- the class of the annotation type- Returns:
- the first program element annotation of the given annotation type, or a null value
-
getAnnotations
public <T extends Annotation> Set<T> getAnnotations(Class<T> annotationType)
Description copied from interface:Annotated
Get program element annotations of a certain annotation type.
This method returns back all annotations, including repeatable annotations of this type. The behavior of this method is intended to be the same behavior as
AnnotatedElement.getAnnotationsByType(Class)
, where repeatable annotations are supported.- Specified by:
getAnnotations
in interfaceAnnotated
- Type Parameters:
T
- the type of the annotation- Parameters:
annotationType
- the class of the annotation type- Returns:
- the program element annotations of the given annotation type, or an empty collection
-
getAnnotations
public Set<Annotation> getAnnotations()
Description copied from interface:Annotated
Get all annotations of the program element.
- Specified by:
getAnnotations
in interfaceAnnotated
- Returns:
- all annotations of the program element, or an empty set if no annotations are present
-
isAnnotationPresent
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
Description copied from interface:Annotated
Determine if the program element has an annotation of a certain annotation type. The behavior of this method is similar to
AnnotatedElement.isAnnotationPresent(Class)
for the underlying program element.- Specified by:
isAnnotationPresent
in interfaceAnnotated
- Parameters:
annotationType
- the annotation type to check for- Returns:
- true if the program element has an annotation of the given annotation type, or false otherwise
-
-