Class ScalaAnnotationDefaultsRecordingVisitor

java.lang.Object
io.micronaut.scala.processing.test.ScalaAnnotationDefaultsRecordingVisitor
All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.core.util.Toggleable, io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>

public final class ScalaAnnotationDefaultsRecordingVisitor extends Object implements io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
Records the member defaults of one annotation, read both ways the Element API offers them: through VisitorContext.getAnnotationDefaultValues(String) and through the AnnotationValue of the annotated class. The Scala counterpart of the DefaultsRecordingVisitor in Core's AnnotationMemberDefaultsSpec.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    What one compilation recorded.

    Nested classes/interfaces inherited from interface io.micronaut.inject.visitor.TypeElementVisitor

    io.micronaut.inject.visitor.TypeElementVisitor.VisitorKind
  • Field Summary

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    describe(@Nullable Map<CharSequence, Object> values)
    Renders the defaults in the language neutral form Core's spec compares against, so the Scala result can be checked against the literal shared by the Java, Kotlin and Groovy suites.
    record(String className, String annotationName, Runnable compilation)
    Executes a compilation recording the defaults of the given annotation as seen from the given class.
    void
    visitClass(io.micronaut.inject.ast.ClassElement element, io.micronaut.inject.visitor.VisitorContext context)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.core.order.Ordered

    getOrder

    Methods inherited from interface io.micronaut.core.util.Toggleable

    isEnabled

    Methods inherited from interface io.micronaut.inject.visitor.TypeElementVisitor

    finish, getClassType, getElementType, getSupportedAnnotationNames, getSupportedOptions, getVisitorKind, query, start, visitConstructor, visitEnumConstant, visitField, visitMethod
  • Constructor Details

    • ScalaAnnotationDefaultsRecordingVisitor

      public ScalaAnnotationDefaultsRecordingVisitor()
  • Method Details

    • record

      public static ScalaAnnotationDefaultsRecordingVisitor.Recording record(String className, String annotationName, Runnable compilation)
      Executes a compilation recording the defaults of the given annotation as seen from the given class.
      Parameters:
      className - The name of the class carrying the annotation
      annotationName - The annotation whose defaults to record
      compilation - The compilation
      Returns:
      The recording
    • describe

      public static String describe(@Nullable Map<CharSequence, Object> values)
      Renders the defaults in the language neutral form Core's spec compares against, so the Scala result can be checked against the literal shared by the Java, Kotlin and Groovy suites.
      Parameters:
      values - The defaults
      Returns:
      The rendering
    • visitClass

      public void visitClass(io.micronaut.inject.ast.ClassElement element, io.micronaut.inject.visitor.VisitorContext context)
      Specified by:
      visitClass in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>