Class ScalaDiagnosticVisitor
java.lang.Object
io.micronaut.scala.processing.test.ScalaDiagnosticVisitor
- All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.core.util.Toggleable, io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
public final class ScalaDiagnosticVisitor
extends Object
implements io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
Test visitor that reports a diagnostic against a chosen element, so a spec can assert
where the compiler attributed it.
VisitorContext is the only way a visitor can
report anything, and the element it is given is the only thing that can carry a source
position, so this is the seam the position plumbing has to be tested through.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe diagnostic severity to report.static enumWhich element of the visited class to blame.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 voidreporting(ScalaDiagnosticVisitor.Severity severity, ScalaDiagnosticVisitor.Target target, String message, Runnable runnable) Runs a compilation with this visitor reporting the given diagnostic.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
-
ScalaDiagnosticVisitor
public ScalaDiagnosticVisitor()
-
-
Method Details
-
reporting
public static void reporting(ScalaDiagnosticVisitor.Severity severity, ScalaDiagnosticVisitor.Target target, String message, Runnable runnable) Runs a compilation with this visitor reporting the given diagnostic.- Parameters:
severity- The severitytarget- The element to blamemessage- The messagerunnable- The compilation
-
visitClass
-