Interface Validator
-
- All Superinterfaces:
javax.validation.Validator
- All Known Implementing Classes:
DefaultAnnotatedElementValidator
,DefaultValidator
public interface Validator extends javax.validation.Validator
Extended version of theValid
interface for Micronaut's implementation.The
Validator.getConstraintsForClass(Class)
method is not supported by the implementation.- Since:
- 1.2
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ANN_CONSTRAINT
Annotation used to define a constraint.static java.lang.String
ANN_VALID
Annotation used to define an object as valid.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutableMethodValidator
forExecutables()
Overridden variation that returns aExecutableMethodValidator
.static Validator
getInstance()
Constructs a new default instance.<T> java.util.Set<javax.validation.ConstraintViolation<T>>
validate(io.micronaut.core.beans.BeanIntrospection<T> introspection, T object, java.lang.Class<?>... groups)
Validate the given introspection and object.<T> java.util.Set<javax.validation.ConstraintViolation<T>>
validate(T object, java.lang.Class<?>... groups)
<T> java.util.Set<javax.validation.ConstraintViolation<T>>
validateProperty(T object, java.lang.String propertyName, java.lang.Class<?>... groups)
<T> java.util.Set<javax.validation.ConstraintViolation<T>>
validateValue(java.lang.Class<T> beanType, java.lang.String propertyName, java.lang.Object value, java.lang.Class<?>... groups)
-
-
-
Method Detail
-
forExecutables
@NonNull ExecutableMethodValidator forExecutables()
Overridden variation that returns aExecutableMethodValidator
.- Specified by:
forExecutables
in interfacejavax.validation.Validator
- Returns:
- The validator
-
validate
@NonNull <T> java.util.Set<javax.validation.ConstraintViolation<T>> validate(@NonNull T object, java.lang.Class<?>... groups)
- Specified by:
validate
in interfacejavax.validation.Validator
-
validate
@NonNull <T> java.util.Set<javax.validation.ConstraintViolation<T>> validate(@NonNull io.micronaut.core.beans.BeanIntrospection<T> introspection, @NonNull T object, @Nullable java.lang.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> java.util.Set<javax.validation.ConstraintViolation<T>> validateProperty(@NonNull T object, @NonNull java.lang.String propertyName, java.lang.Class<?>... groups)
- Specified by:
validateProperty
in interfacejavax.validation.Validator
-
validateValue
@NonNull <T> java.util.Set<javax.validation.ConstraintViolation<T>> validateValue(@NonNull java.lang.Class<T> beanType, @NonNull java.lang.String propertyName, @Nullable java.lang.Object value, java.lang.Class<?>... groups)
- Specified by:
validateValue
in interfacejavax.validation.Validator
-
getInstance
@NonNull static Validator getInstance()
Constructs a new default instance. Note that the returned instance will not contain managedConstraintValidator
instances and usingjavax.inject.Inject
should be preferred.- Returns:
- The validator.
-
-