-
- All Known Subinterfaces:
- AnnotatedCallable<X>, AnnotatedConstructor<X>, AnnotatedField<X>, AnnotatedMember<X>, AnnotatedMethod<X>, AnnotatedParameter<X>, AnnotatedType<X>
public interface Annotated
Represents a Java program element that can be annotated.
- Author:
- Gavin King, Pete Muir, Clint Popetz
- See Also:
AnnotatedElement
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and 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.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.
-
-
-
Method Detail
-
getBaseType
Type getBaseType()
Get the type of the annotated program element.
- Returns:
- the type of the annotated program element
-
getTypeClosure
Set<Type> getTypeClosure()
Get all types to which the base type should be considered assignable.
- Returns:
- a set of all types to which the base type should be considered assignable
-
getAnnotation
<T extends Annotation> T getAnnotation(Class<T> annotationType)
Get program element annotation of a certain annotation type.
- Type Parameters:
T
- the type of the annotation- Parameters:
annotationType
- the class of the annotation type- Returns:
- the program element annotation of the given annotation type, or a null value
-
getAnnotations
Set<Annotation> getAnnotations()
Get all annotations of the program element.
- Returns:
- all annotations of the program element, or an empty set if no annotations are present
-
isAnnotationPresent
boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
Determine if the program element has an annotation of a certain annotation type.
- 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
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/08/2025 01:27:19 Cette version de la page est en cache (à la date du 22/08/2025 01:27:19) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/enterprise/inject/spi/annotated.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.