Class AnnotationDef

java.lang.Object
io.micronaut.sourcegen.model.AnnotationDef

public final class AnnotationDef extends Object
The annotation definition.
Since:
1.0
Author:
Denis Stepanov
  • Method Details

    • getType

      public ClassTypeDef getType()
    • getValues

      public Map<String,Object> getValues()
    • builder

      public static AnnotationDef.AnnotationDefBuilder builder(ClassTypeDef type)
    • builder

      public static AnnotationDef.AnnotationDefBuilder builder(Class<? extends Annotation> annotationType)
    • of

      public static AnnotationDef of(io.micronaut.core.annotation.AnnotationValue<?> annotation, io.micronaut.inject.visitor.VisitorContext context)
      Create an annotation definition from an AnnotationValue annotation.

      Visitor context is required to deduce the types for annotation members, as AnnotationValue does not retain such information. The annotation does not need to be present on the classpath, but type mirror information must be retrievable.

      Parameters:
      annotation - The annotation
      context - The visitor context
      Returns:
      The copy of given annotation
      Since:
      1.0