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 ClassesModifier and TypeClassDescriptionstatic final classWhat 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringdescribe(@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.Executes a compilation recording the defaults of the given annotation as seen from the given class.voidvisitClass(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, waitMethods inherited from interface io.micronaut.core.order.Ordered
getOrderMethods inherited from interface io.micronaut.core.util.Toggleable
isEnabledMethods 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 annotationannotationName- The annotation whose defaults to recordcompilation- The compilation- Returns:
- The recording
-
describe
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
-