public interface CascadingPropertyValidator
extends javax.validation.Validator
Valid
is not honored by the
validateProperty(Object, String, Class...)
and
validateValue(Class, String, Object, Class...)
methods. The
CascadingPropertyValidator
interface thus defines a Validator
that
provides corresponding methods that may honor Valid
.
It should be noted that Validator.validateProperty(Object, String, Class...)
and Validator.validateValue(Class, String, Object, Class...)
are assumed
semantically equivalent to calling the CascadingPropertyValidator
-defined
methods with cascade == false
.Modifier and Type | Method and Description |
---|---|
<T> Set<javax.validation.ConstraintViolation<T>> |
validateProperty(T object,
String propertyName,
boolean cascade,
Class<?>... groups)
Validates all constraints placed on the property of
object named propertyName . |
default <T> Set<javax.validation.ConstraintViolation<T>> |
validateProperty(T object,
String propertyName,
Class<?>... groups)
Validates all constraints placed on the property of
object named propertyName . |
<T> Set<javax.validation.ConstraintViolation<T>> |
validateValue(Class<T> beanType,
String propertyName,
Object value,
boolean cascade,
Class<?>... groups)
Validates all constraints placed on the property named
propertyName of the class
beanType would the property value be value . |
default <T> Set<javax.validation.ConstraintViolation<T>> |
validateValue(Class<T> beanType,
String propertyName,
Object value,
Class<?>... groups)
Validates all constraints placed on the property named
propertyName of the class
beanType would the property value be value . |
default <T> Set<javax.validation.ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups)
object
named propertyName
.validateProperty
in interface javax.validation.Validator
object
- object to validatepropertyName
- property to validate (i.e. field and getter constraints). Nested
properties may be referenced (e.g. prop[2].subpropA.subpropB)groups
- group or list of groups targeted for validation (default to
Default
)Set
if noneIllegalArgumentException
- if object
is null
, if propertyName null
,
empty or not a valid object property or if null
is
passed to the varargs groups
javax.validation.ValidationException
- if a non recoverable error happens during the validation process<T> Set<javax.validation.ConstraintViolation<T>> validateProperty(T object, String propertyName, boolean cascade, Class<?>... groups)
object
named propertyName
.object
- object to validatepropertyName
- property to validate (i.e. field and getter constraints). Nested
properties may be referenced (e.g. prop[2].subpropA.subpropB)cascade
- whether to cascade along Valid
propertiesgroups
- group or list of groups targeted for validation (default to
Default
)Set
if noneIllegalArgumentException
- if object
is null
, if propertyName null
,
empty or not a valid object property or if null
is
passed to the varargs groups
javax.validation.ValidationException
- if a non recoverable error happens during the validation processdefault <T> Set<javax.validation.ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, Class<?>... groups)
propertyName
of the class
beanType
would the property value be value
.
ConstraintViolation
objects return null
for ConstraintViolation.getRootBean()
and
ConstraintViolation.getLeafBean()
.validateValue
in interface javax.validation.Validator
beanType
- the bean typepropertyName
- property to validatevalue
- property value to validategroups
- group or list of groups targeted for validation (default to
Default
)Set
if noneIllegalArgumentException
- if beanType
is null
, if
propertyName null
, empty or not a valid object
property or if null
is passed to the varargs groups
javax.validation.ValidationException
- if a non recoverable error happens during the validation process<T> Set<javax.validation.ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, boolean cascade, Class<?>... groups)
propertyName
of the class
beanType
would the property value be value
.
ConstraintViolation
objects return null
for ConstraintViolation.getRootBean()
and
ConstraintViolation.getLeafBean()
.beanType
- the bean typepropertyName
- property to validatevalue
- property value to validategroups
- group or list of groups targeted for validation (default to
Default
)Set
if noneIllegalArgumentException
- if beanType
is null
, if
propertyName null
, empty or not a valid object
property or if null
is passed to the varargs groups
javax.validation.ValidationException
- if a non recoverable error happens during the validation processCopyright © 2010–2020 The Apache Software Foundation. All rights reserved.