Package org.apache.bval.jsr
Interface CascadingPropertyValidator
-
- All Superinterfaces:
jakarta.validation.Validator
- All Known Implementing Classes:
ValidatorImpl
public interface CascadingPropertyValidator extends jakarta.validation.Validator
Per the bean validation spec,Valid
is not honored by thevalidateProperty(Object, String, Class...)
andvalidateValue(Class, String, Object, Class...)
methods. TheCascadingPropertyValidator
interface thus defines aValidator
that provides corresponding methods that may honorValid
. It should be noted thatValidator.validateProperty(Object, String, Class...)
andValidator.validateValue(Class, String, Object, Class...)
are assumed semantically equivalent to calling theCascadingPropertyValidator
-defined methods withcascade == false
.- Version:
- $Rev: 993539 $ $Date: 2010-09-07 16:27:50 -0500 (Tue, 07 Sep 2010) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> Set<jakarta.validation.ConstraintViolation<T>>
validateProperty(T object, String propertyName, boolean cascade, Class<?>... groups)
Validates all constraints placed on the property ofobject
namedpropertyName
.default <T> Set<jakarta.validation.ConstraintViolation<T>>
validateProperty(T object, String propertyName, Class<?>... groups)
Validates all constraints placed on the property ofobject
namedpropertyName
.<T> Set<jakarta.validation.ConstraintViolation<T>>
validateValue(Class<T> beanType, String propertyName, Object value, boolean cascade, Class<?>... groups)
Validates all constraints placed on the property namedpropertyName
of the classbeanType
would the property value bevalue
.default <T> Set<jakarta.validation.ConstraintViolation<T>>
validateValue(Class<T> beanType, String propertyName, Object value, Class<?>... groups)
Validates all constraints placed on the property namedpropertyName
of the classbeanType
would the property value bevalue
.
-
-
-
Method Detail
-
validateProperty
default <T> Set<jakarta.validation.ConstraintViolation<T>> validateProperty(T object, String propertyName, Class<?>... groups)
Validates all constraints placed on the property ofobject
namedpropertyName
.- Specified by:
validateProperty
in interfacejakarta.validation.Validator
- Parameters:
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 toDefault
)- Returns:
- constraint violations or an empty
Set
if none - Throws:
IllegalArgumentException
- ifobject
isnull
, ifpropertyName null
, empty or not a valid object property or ifnull
is passed to the varargsgroups
jakarta.validation.ValidationException
- if a non recoverable error happens during the validation process
-
validateProperty
<T> Set<jakarta.validation.ConstraintViolation<T>> validateProperty(T object, String propertyName, boolean cascade, Class<?>... groups)
Validates all constraints placed on the property ofobject
namedpropertyName
.- Parameters:
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 alongValid
propertiesgroups
- group or list of groups targeted for validation (default toDefault
)- Returns:
- constraint violations or an empty
Set
if none - Throws:
IllegalArgumentException
- ifobject
isnull
, ifpropertyName null
, empty or not a valid object property or ifnull
is passed to the varargsgroups
jakarta.validation.ValidationException
- if a non recoverable error happens during the validation process
-
validateValue
default <T> Set<jakarta.validation.ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, Class<?>... groups)
Validates all constraints placed on the property namedpropertyName
of the classbeanType
would the property value bevalue
.ConstraintViolation
objects returnnull
forConstraintViolation.getRootBean()
andConstraintViolation.getLeafBean()
.- Specified by:
validateValue
in interfacejakarta.validation.Validator
- Parameters:
beanType
- the bean typepropertyName
- property to validatevalue
- property value to validategroups
- group or list of groups targeted for validation (default toDefault
)- Returns:
- constraint violations or an empty
Set
if none - Throws:
IllegalArgumentException
- ifbeanType
isnull
, ifpropertyName null
, empty or not a valid object property or ifnull
is passed to the varargsgroups
jakarta.validation.ValidationException
- if a non recoverable error happens during the validation process
-
validateValue
<T> Set<jakarta.validation.ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, boolean cascade, Class<?>... groups)
Validates all constraints placed on the property namedpropertyName
of the classbeanType
would the property value bevalue
.ConstraintViolation
objects returnnull
forConstraintViolation.getRootBean()
andConstraintViolation.getLeafBean()
.- Parameters:
beanType
- the bean typepropertyName
- property to validatevalue
- property value to validategroups
- group or list of groups targeted for validation (default toDefault
)- Returns:
- constraint violations or an empty
Set
if none - Throws:
IllegalArgumentException
- ifbeanType
isnull
, ifpropertyName null
, empty or not a valid object property or ifnull
is passed to the varargsgroups
jakarta.validation.ValidationException
- if a non recoverable error happens during the validation process
-
-