Package io.micronaut.context.visitor
Class ValidationVisitor
java.lang.Object
io.micronaut.context.visitor.ValidationVisitor
- All Implemented Interfaces:
Ordered
,Toggleable
,TypeElementVisitor<Object,
Object>
@Internal
@NextMajorVersion("This class needs to be moved to the validation module")
public class ValidationVisitor
extends Object
implements TypeElementVisitor<Object,Object>
The visitor adds Validated annotation if one of the parameters is a constraint or @Valid.
- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.inject.visitor.TypeElementVisitor
TypeElementVisitor.VisitorKind
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
void
visitClass
(ClassElement element, VisitorContext context) Executed when a class is encountered that matches the <C> generic.void
visitConstructor
(ConstructorElement element, VisitorContext context) Executed when a constructor is encountered that matches the <C> generic.void
visitField
(FieldElement element, VisitorContext context) Executed when a field is encountered that matches the <E> generic.void
visitMethod
(MethodElement element, VisitorContext context) Executed when a method is encountered that matches the <E> generic.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
Methods inherited from interface io.micronaut.inject.visitor.TypeElementVisitor
finish, getClassType, getElementType, getSupportedOptions, start, visitEnumConstant
-
Constructor Details
-
ValidationVisitor
public ValidationVisitor()
-
-
Method Details
-
getSupportedAnnotationNames
- Specified by:
getSupportedAnnotationNames
in interfaceTypeElementVisitor<Object,
Object> - Returns:
- The supported default annotation names.
-
getOrder
public int getOrder() -
getVisitorKind
- Specified by:
getVisitorKind
in interfaceTypeElementVisitor<Object,
Object> - Returns:
- The visitor kind.
-
visitClass
Description copied from interface:TypeElementVisitor
Executed when a class is encountered that matches the <C> generic.- Specified by:
visitClass
in interfaceTypeElementVisitor<Object,
Object> - Parameters:
element
- The elementcontext
- The visitor context
-
visitConstructor
Description copied from interface:TypeElementVisitor
Executed when a constructor is encountered that matches the <C> generic.- Specified by:
visitConstructor
in interfaceTypeElementVisitor<Object,
Object> - Parameters:
element
- The elementcontext
- The visitor context
-
visitMethod
Description copied from interface:TypeElementVisitor
Executed when a method is encountered that matches the <E> generic.- Specified by:
visitMethod
in interfaceTypeElementVisitor<Object,
Object> - Parameters:
element
- The elementcontext
- The visitor context
-
visitField
Description copied from interface:TypeElementVisitor
Executed when a field is encountered that matches the <E> generic.- Specified by:
visitField
in interfaceTypeElementVisitor<Object,
Object> - Parameters:
element
- The elementcontext
- The visitor context
-