- All Known Subinterfaces:
TypedElementInfo
,io.helidon.common.types.TypedElementInfoBlueprint
,TypeInfo
,io.helidon.common.types.TypeInfoBlueprint
- All Known Implementing Classes:
TypedElementInfo.BuilderBase.TypedElementInfoImpl
,TypeInfo.BuilderBase.TypeInfoImpl
public interface Annotated
Annotated elements provide annotations and their values.
-
Method Summary
Modifier and TypeMethodDescriptiondefault List
<Annotation> List of all annotations - bothannotations()
andinheritedAnnotations()
.default Annotation
annotation
(TypeName annotationType) Get an annotation on this annotated type.List of declared and known annotations for this element.default Optional
<Annotation> findAnnotation
(TypeName annotationType) Find an annotation on this annotated type.default boolean
hasAnnotation
(TypeName annotationType) Check if the annotation exists on this annotated.List of all inherited annotations for this element.
-
Method Details
-
annotations
List<Annotation> annotations()List of declared and known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build (such as theof the annotation
).- Returns:
- the list of annotations declared on this element
-
inheritedAnnotations
List<Annotation> inheritedAnnotations()List of all inherited annotations for this element. Inherited annotations are annotations declared on annotations of this element that are also marked asInherited
.The returned list does not contain
annotations()
. If a meta-annotation is present on multiple annotations, it will be returned once for each such declaration.- Returns:
- list of all meta annotations of this element
-
allAnnotations
List of all annotations - bothannotations()
andinheritedAnnotations()
.- Returns:
- list of all annotations valid for this element
-
findAnnotation
Find an annotation on this annotated type.- Parameters:
annotationType
- annotation type- Returns:
- annotation with value (if found)
-
annotation
Get an annotation on this annotated type.- Parameters:
annotationType
- annotation type- Returns:
- annotation with value
- Throws:
NoSuchElementException
- if the annotation is not present on this element- See Also:
-
hasAnnotation
Check if the annotation exists on this annotated.- Parameters:
annotationType
- type of annotation to find- Returns:
true
if the annotation exists on this annotated component
-