Class MyBatisMapperScanReflectionVisitor
java.lang.Object
io.micronaut.configuration.mybatis.processor.MyBatisMapperScanReflectionVisitor
- All Implemented Interfaces:
io.micronaut.core.order.Ordered, io.micronaut.core.util.Toggleable, io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
@Internal
public final class MyBatisMapperScanReflectionVisitor
extends Object
implements io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
Adds the GraalVM native image metadata of the mappers registered by
MyBatisMapperScan as
ReflectionConfig values to the annotated type: MyBatis implements mapper interfaces with
Proxy, and instantiates and populates their result and parameter types reflectively.
The metadata itself is generated by the Micronaut GraalTypeElementVisitor from those values,
exactly like for @ReflectiveAccess. That visitor is TypeElementVisitor.VisitorKind.ISOLATING and runs at
order -200, so this visitor must be isolating as well (isolating and aggregating visitors run in
different annotation processors on javac) and ordered before it, see getOrder().
Like MyBatisMapperScanVisitor, the visitor visits every class because it has to see the
unannotated mapper interfaces. Visitors process all classes before the next visitor runs, so the values
added here are complete by the time the Graal visitor reaches the annotated type.
-
Nested Class Summary
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 TypeMethodDescriptionvoidfinish(io.micronaut.inject.visitor.VisitorContext visitorContext) intgetOrder()io.micronaut.inject.visitor.TypeElementVisitor.VisitorKindvoidvisitClass(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
getClassType, getElementType, getSupportedAnnotationNames, getSupportedOptions, query, start, visitConstructor, visitEnumConstant, visitField, visitMethod
-
Constructor Details
-
MyBatisMapperScanReflectionVisitor
public MyBatisMapperScanReflectionVisitor()
-
-
Method Details
-
getVisitorKind
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered
-
visitClass
-
finish
-