Class ScalaAnnotationRemovalVisitor
java.lang.Object
io.micronaut.scala.processing.test.ScalaAnnotationRemovalVisitor
- All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.core.util.Toggleable, io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
public final class ScalaAnnotationRemovalVisitor
extends Object
implements io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
Test visitor that takes annotations off a visited class.
Removal is the half of element mutation nothing here could reach. ScalaElementMutationVisitor only adds, and adding is forgiving: an annotation written twice
is the same as written once. Taking one away has to reach the same metadata the plugin built,
and a removal that silently misses leaves the bean exactly as it was.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe kind of removal to perform.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 TypeMethodDescriptionintgetOrder()io.micronaut.inject.visitor.TypeElementVisitor.VisitorKindstatic <T> Tremoving(ScalaAnnotationRemovalVisitor.Mode mode, String annotationName, @Nullable String replacement, Supplier<T> supplier) Executes a compilation with this visitor removing the given annotation and adding another.static <T> Tremoving(ScalaAnnotationRemovalVisitor.Mode mode, String annotationName, Supplier<T> supplier) Executes a compilation with this visitor removing the given annotation.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.util.Toggleable
isEnabledMethods inherited from interface io.micronaut.inject.visitor.TypeElementVisitor
finish, getClassType, getElementType, getSupportedAnnotationNames, getSupportedOptions, query, start, visitConstructor, visitEnumConstant, visitField, visitMethod
-
Constructor Details
-
ScalaAnnotationRemovalVisitor
public ScalaAnnotationRemovalVisitor()
-
-
Method Details
-
removing
public static <T> T removing(ScalaAnnotationRemovalVisitor.Mode mode, String annotationName, Supplier<T> supplier) Executes a compilation with this visitor removing the given annotation.- Type Parameters:
T- The result type- Parameters:
mode- The removal to performannotationName- The annotation to removesupplier- The compilation work- Returns:
- The supplier result
-
removing
public static <T> T removing(ScalaAnnotationRemovalVisitor.Mode mode, String annotationName, @Nullable @Nullable String replacement, Supplier<T> supplier) Executes a compilation with this visitor removing the given annotation and adding another.- Type Parameters:
T- The result type- Parameters:
mode- The removal to performannotationName- The annotation to removereplacement- The annotation to add in its placesupplier- The compilation work- Returns:
- The supplier result
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered
-
visitClass
-
getVisitorKind
-