Package io.micronaut.inject.visitor
Interface TypeElementVisitor<C,E>
-
- Type Parameters:
C- The annotation required on the class. UseObjectfor all classes.E- The annotation required on the element. UseObjectfor all elements.
- All Superinterfaces:
io.micronaut.core.order.Ordered,io.micronaut.core.util.Toggleable
- All Known Implementing Classes:
BeanImportVisitor,ContextConfigurerVisitor,IntrospectedTypeElementVisitor
public interface TypeElementVisitor<C,E> extends io.micronaut.core.order.Ordered, io.micronaut.core.util.ToggleableProvides a hook into the compilation process to allow user defined functionality to be created at compile time.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTypeElementVisitor.VisitorKindImplementors of theTypeElementVisitorinterface should specify what kind of visitor it is.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidfinish(VisitorContext visitorContext)Called once when visitor processing finishes.default java.lang.StringgetClassType()default java.lang.StringgetElementType()default java.util.Set<java.lang.String>getSupportedAnnotationNames()default java.util.Set<java.lang.String>getSupportedOptions()Called once when processor loads.default TypeElementVisitor.VisitorKindgetVisitorKind()default voidstart(VisitorContext visitorContext)Called once when visitor processing starts.default voidvisitClass(ClassElement element, VisitorContext context)Executed when a class is encountered that matches the <C> generic.default voidvisitConstructor(ConstructorElement element, VisitorContext context)Executed when a constructor is encountered that matches the <C> generic.default voidvisitEnumConstant(EnumConstantElement element, VisitorContext context)Executed when a enum constant is encountered that matches the <E> generic.default voidvisitField(FieldElement element, VisitorContext context)Executed when a field is encountered that matches the <E> generic.default voidvisitMethod(MethodElement element, VisitorContext context)Executed when a method is encountered that matches the <E> generic.
-
-
-
Method Detail
-
visitClass
default void visitClass(ClassElement element, VisitorContext context)
Executed when a class is encountered that matches the <C> generic.- Parameters:
element- The elementcontext- The visitor context
-
visitMethod
default void visitMethod(MethodElement element, VisitorContext context)
Executed when a method is encountered that matches the <E> generic.- Parameters:
element- The elementcontext- The visitor context
-
visitConstructor
default void visitConstructor(ConstructorElement element, VisitorContext context)
Executed when a constructor is encountered that matches the <C> generic.- Parameters:
element- The elementcontext- The visitor context
-
visitField
default void visitField(FieldElement element, VisitorContext context)
Executed when a field is encountered that matches the <E> generic.- Parameters:
element- The elementcontext- The visitor context
-
visitEnumConstant
default void visitEnumConstant(EnumConstantElement element, VisitorContext context)
Executed when a enum constant is encountered that matches the <E> generic.- Parameters:
element- The elementcontext- The visitor context- Since:
- 3.6.0
-
start
default void start(VisitorContext visitorContext)
Called once when visitor processing starts.- Parameters:
visitorContext- The visitor context
-
finish
default void finish(VisitorContext visitorContext)
Called once when visitor processing finishes.- Parameters:
visitorContext- The visitor context
-
getSupportedAnnotationNames
default java.util.Set<java.lang.String> getSupportedAnnotationNames()
- Returns:
- The supported default annotation names.
-
getClassType
default java.lang.String getClassType()
-
getElementType
default java.lang.String getElementType()
-
getSupportedOptions
default java.util.Set<java.lang.String> getSupportedOptions()
Called once when processor loads. Used to expose visitors custom processor options.- Returns:
- Set with custom options
-
getVisitorKind
@NonNull default TypeElementVisitor.VisitorKind getVisitorKind()
- Returns:
- The visitor kind.
-
-