Package org.apache.bval.jsr
Interface CascadingPropertyValidator
-
- All Superinterfaces:
jakarta.validation.Validator
- All Known Implementing Classes:
ValidatorImpl
public interface CascadingPropertyValidator extends jakarta.validation.ValidatorPer the bean validation spec,Validis not honored by thevalidateProperty(Object, String, Class...)andvalidateValue(Class, String, Object, Class...)methods. TheCascadingPropertyValidatorinterface thus defines aValidatorthat 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 ofobjectnamedpropertyName.default <T> Set<jakarta.validation.ConstraintViolation<T>>validateProperty(T object, String propertyName, Class<?>... groups)Validates all constraints placed on the property ofobjectnamedpropertyName.<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 namedpropertyNameof the classbeanTypewould 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 namedpropertyNameof the classbeanTypewould 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 ofobjectnamedpropertyName.- Specified by:
validatePropertyin 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
Setif none - Throws:
IllegalArgumentException- ifobjectisnull, ifpropertyName null, empty or not a valid object property or ifnullis passed to the varargsgroupsjakarta.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 ofobjectnamedpropertyName.- 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 alongValidpropertiesgroups- group or list of groups targeted for validation (default toDefault)- Returns:
- constraint violations or an empty
Setif none - Throws:
IllegalArgumentException- ifobjectisnull, ifpropertyName null, empty or not a valid object property or ifnullis passed to the varargsgroupsjakarta.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 namedpropertyNameof the classbeanTypewould the property value bevalue.ConstraintViolationobjects returnnullforConstraintViolation.getRootBean()andConstraintViolation.getLeafBean().- Specified by:
validateValuein 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
Setif none - Throws:
IllegalArgumentException- ifbeanTypeisnull, ifpropertyName null, empty or not a valid object property or ifnullis passed to the varargsgroupsjakarta.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 namedpropertyNameof the classbeanTypewould the property value bevalue.ConstraintViolationobjects returnnullforConstraintViolation.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
Setif none - Throws:
IllegalArgumentException- ifbeanTypeisnull, ifpropertyName null, empty or not a valid object property or ifnullis passed to the varargsgroupsjakarta.validation.ValidationException- if a non recoverable error happens during the validation process
-
-