Package io.micronaut.inject.visitor
Interface BeanElementVisitor<A extends java.lang.annotation.Annotation>
-
- Type Parameters:
A- An annotation type to limit visitation to a subset of beans
- All Superinterfaces:
io.micronaut.core.order.Ordered,io.micronaut.core.util.Toggleable
public interface BeanElementVisitor<A extends java.lang.annotation.Annotation> extends io.micronaut.core.order.Ordered, io.micronaut.core.util.ToggleableAllows visiting a bean to perform any validation prior to when bean definitions are written out.- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<BeanElementVisitor<?>>VISITORSThe available visitors.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidfinish(VisitorContext visitorContext)Called once when visitor processing finishes.default voidstart(VisitorContext visitorContext)Called once when visitor processing starts.default booleansupports(BeanElement beanElement)Returns whether this visitor supports visiting the specified element.BeanElementvisitBeanElement(BeanElement beanElement, VisitorContext visitorContext)Visits aBeanElementbefore it is finalized and written to disk, allowing mutation of any annotation metadata before writing the bean definition.
-
-
-
Field Detail
-
VISITORS
static final java.util.List<BeanElementVisitor<?>> VISITORS
The available visitors.
-
-
Method Detail
-
visitBeanElement
@Nullable BeanElement visitBeanElement(@NonNull BeanElement beanElement, @NonNull VisitorContext visitorContext)
Visits aBeanElementbefore it is finalized and written to disk, allowing mutation of any annotation metadata before writing the bean definition.- Parameters:
beanElement- The bean elementvisitorContext- The visitor context- Returns:
- The bean element or
nullif the bean should not be written
-
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
-
supports
default boolean supports(@NonNull BeanElement beanElement)Returns whether this visitor supports visiting the specified element.- Parameters:
beanElement- The bean element- Returns:
- True if it does
-
-