Class LoadedVisitor

  • All Implemented Interfaces:
    io.micronaut.core.order.Ordered

    @Internal
    public class LoadedVisitor
    extends java.lang.Object
    implements io.micronaut.core.order.Ordered
    Used to store a reference to an underlying TypeElementVisitor and optionally invoke the visit methods on the visitor if it matches the element being visited by the annotation processor.
    Since:
    1.0
    • Field Summary

      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Summary

      Constructors 
      Constructor Description
      LoadedVisitor​(io.micronaut.inject.visitor.TypeElementVisitor visitor, JavaVisitorContext visitorContext, GenericUtils genericUtils, javax.annotation.processing.ProcessingEnvironment processingEnvironment)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getOrder()  
      io.micronaut.inject.visitor.TypeElementVisitor getVisitor()  
      boolean matches​(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      boolean matches​(javax.lang.model.element.TypeElement typeElement)  
      java.lang.String toString()  
      io.micronaut.inject.ast.Element visit​(javax.lang.model.element.Element element, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
      Invoke the underlying visitor for the given element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LoadedVisitor

        public LoadedVisitor​(io.micronaut.inject.visitor.TypeElementVisitor visitor,
                             JavaVisitorContext visitorContext,
                             GenericUtils genericUtils,
                             javax.annotation.processing.ProcessingEnvironment processingEnvironment)
        Parameters:
        visitor - The TypeElementVisitor
        visitorContext - The visitor context
        genericUtils - The generic utils
        processingEnvironment - The ProcessingEnvironment
    • Method Detail

      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface io.micronaut.core.order.Ordered
      • getVisitor

        public io.micronaut.inject.visitor.TypeElementVisitor getVisitor()
        Returns:
        The visitor
      • matches

        public boolean matches​(javax.lang.model.element.TypeElement typeElement)
        Parameters:
        typeElement - The class element
        Returns:
        True if the class element should be visited
      • matches

        public boolean matches​(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Parameters:
        annotationMetadata - The annotation data
        Returns:
        True if the element should be visited
      • visit

        @Nullable
        public io.micronaut.inject.ast.Element visit​(javax.lang.model.element.Element element,
                                                     io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Invoke the underlying visitor for the given element.
        Parameters:
        element - The element to visit
        annotationMetadata - The annotation data for the node
        Returns:
        The element if one was created or null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object