Interface TypeElementVisitor<C,​E>

  • Type Parameters:
    C - The annotation required on the class. Use Object for all classes.
    E - The annotation required on the element. Use Object 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
    • Method Detail

      • visitClass

        default void visitClass​(ClassElement element,
                                VisitorContext context)
        Executed when a class is encountered that matches the <C> generic.
        Parameters:
        element - The element
        context - 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 element
        context - 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 element
        context - 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 element
        context - 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 element
        context - 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