Interface Annotated

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 Details

    • annotations

      List<Annotation> annotations()
      The list of known annotations for this element. Note that "known" implies that the annotation is visible, which depends upon the context in which it was build.
      Returns:
      the list of annotations on this element
    • findAnnotation

      default Optional<Annotation> findAnnotation(TypeName annotationType)
      Find an annotation on this annotated type.
      Parameters:
      annotationType - annotation type
      Returns:
      annotation with value (if found)
    • annotation

      default Annotation annotation(TypeName annotationType)
      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

      default boolean hasAnnotation(TypeName annotationType)
      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