Package io.micronaut.inject.visitor
Interface TypeElementVisitor<C,E>
-
- Type Parameters:
C
- The annotation required on the class. UseObject
for all classes.E
- The annotation required on the element. UseObject
for 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.Toggleable
Provides 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 class
TypeElementVisitor.VisitorKind
Implementors of theTypeElementVisitor
interface should specify what kind of visitor it is.
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
finish(VisitorContext visitorContext)
Called once when visitor processing finishes.default java.lang.String
getClassType()
default java.lang.String
getElementType()
default java.util.Set<java.lang.String>
getSupportedAnnotationNames()
default java.util.Set<java.lang.String>
getSupportedOptions()
Called once when processor loads.default TypeElementVisitor.VisitorKind
getVisitorKind()
default void
start(VisitorContext visitorContext)
Called once when visitor processing starts.default void
visitClass(ClassElement element, VisitorContext context)
Executed when a class is encountered that matches the <C> generic.default void
visitConstructor(ConstructorElement element, VisitorContext context)
Executed when a constructor is encountered that matches the <C> generic.default void
visitEnumConstant(EnumConstantElement element, VisitorContext context)
Executed when a enum constant is encountered that matches the <E> generic.default void
visitField(FieldElement element, VisitorContext context)
Executed when a field is encountered that matches the <E> generic.default void
visitMethod(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.
-
-