Class LoadedVisitor
- java.lang.Object
-
- io.micronaut.annotation.processing.visitor.LoadedVisitor
-
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
@Internal public class LoadedVisitor extends java.lang.Object implements io.micronaut.core.order.OrderedUsed to store a reference to an underlyingTypeElementVisitorand optionally invoke the visit methods on the visitor if it matches the element being visited by the annotation processor.- Since:
- 1.0
-
-
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 intgetOrder()io.micronaut.inject.visitor.TypeElementVisitorgetVisitor()booleanmatches(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)booleanmatches(javax.lang.model.element.TypeElement typeElement)java.lang.StringtoString()io.micronaut.inject.ast.Elementvisit(javax.lang.model.element.Element element, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Invoke the underlying visitor for the given element.
-
-
-
Constructor Detail
-
LoadedVisitor
public LoadedVisitor(io.micronaut.inject.visitor.TypeElementVisitor visitor, JavaVisitorContext visitorContext, GenericUtils genericUtils, javax.annotation.processing.ProcessingEnvironment processingEnvironment)- Parameters:
visitor- TheTypeElementVisitorvisitorContext- The visitor contextgenericUtils- The generic utilsprocessingEnvironment- TheProcessingEnvironment
-
-
Method Detail
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceio.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 visitannotationMetadata- The annotation data for the node- Returns:
- The element if one was created or null
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-