Interface Validator
- All Superinterfaces:
jakarta.validation.Validator
- All Known Implementing Classes:
DefaultAnnotatedElementValidator
,DefaultValidator
public interface Validator
extends jakarta.validation.Validator
Extended version of the
Valid
interface for Micronaut's implementation.
The Validator.getConstraintsForClass(Class)
method is not supported by the implementation.
- Since:
- 1.2
- Author:
- graemerocher
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription@NonNull ExecutableMethodValidator
Overridden variation that returns aExecutableMethodValidator
.static @NonNull Validator
Constructs a new default instance.<T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
validate
(@NonNull io.micronaut.core.beans.BeanIntrospection<T> introspection, T object, @Nullable Class<?>... groups) Validate the given introspection and object.<T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
<T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
validateProperty
(T object, @NonNull String propertyName, Class<?>... groups) <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>>
validateValue
(@NonNull Class<T> beanType, @NonNull String propertyName, @Nullable Object value, Class<?>... groups) Methods inherited from interface jakarta.validation.Validator
getConstraintsForClass, unwrap
-
Field Details
-
ANN_VALID
Annotation used to define an object as valid. -
ANN_CONSTRAINT
Annotation used to define a constraint.
-
-
Method Details
-
forExecutables
Overridden variation that returns aExecutableMethodValidator
.- Specified by:
forExecutables
in interfacejakarta.validation.Validator
- Returns:
- The validator
-
validate
@NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validate(@NonNull T object, Class<?>... groups) - Specified by:
validate
in interfacejakarta.validation.Validator
-
validate
@NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validate(@NonNull @NonNull io.micronaut.core.beans.BeanIntrospection<T> introspection, @NonNull T object, @Nullable @Nullable Class<?>... groups) Validate the given introspection and object.- Type Parameters:
T
- The object type- Parameters:
introspection
- The introspectionobject
- The objectgroups
- The groups- Returns:
- The constraint violations
-
validateProperty
@NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateProperty(@NonNull T object, @NonNull @NonNull String propertyName, Class<?>... groups) - Specified by:
validateProperty
in interfacejakarta.validation.Validator
-
validateValue
@NonNull <T> @NonNull Set<jakarta.validation.ConstraintViolation<T>> validateValue(@NonNull @NonNull Class<T> beanType, @NonNull @NonNull String propertyName, @Nullable @Nullable Object value, Class<?>... groups) - Specified by:
validateValue
in interfacejakarta.validation.Validator
-
getInstance
Constructs a new default instance. Note that the returned instance will not contain managedConstraintValidator
instances and usingInject
should be preferred.- Returns:
- The validator.
-