Package org.apache.bval.jsr
Class ValidatorImpl
- java.lang.Object
-
- org.apache.bval.jsr.ValidatorImpl
-
- All Implemented Interfaces:
jakarta.validation.executable.ExecutableValidator
,jakarta.validation.Validator
,CascadingPropertyValidator
public class ValidatorImpl extends Object implements CascadingPropertyValidator, jakarta.validation.executable.ExecutableValidator
-
-
Constructor Summary
Constructors Constructor Description ValidatorImpl(ApacheFactoryContext validatorContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.validation.executable.ExecutableValidator
forExecutables()
jakarta.validation.metadata.BeanDescriptor
getConstraintsForClass(Class<?> clazz)
<T> T
unwrap(Class<T> type)
<T> Set<jakarta.validation.ConstraintViolation<T>>
validate(T object, Class<?>... groups)
<T> Set<jakarta.validation.ConstraintViolation<T>>
validateConstructorParameters(Constructor<? extends T> constructor, Object[] parameterValues, Class<?>... groups)
<T> Set<jakarta.validation.ConstraintViolation<T>>
validateConstructorReturnValue(Constructor<? extends T> constructor, T createdObject, Class<?>... groups)
<T> Set<jakarta.validation.ConstraintViolation<T>>
validateParameters(T object, Method method, Object[] parameterValues, Class<?>... groups)
<T> Set<jakarta.validation.ConstraintViolation<T>>
validateProperty(T object, String propertyName, boolean cascade, Class<?>... groups)
Validates all constraints placed on the property ofobject
namedpropertyName
.<T> Set<jakarta.validation.ConstraintViolation<T>>
validateReturnValue(T object, Method method, Object returnValue, Class<?>... groups)
<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
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.bval.jsr.CascadingPropertyValidator
validateProperty, validateValue
-
-
-
-
Constructor Detail
-
ValidatorImpl
ValidatorImpl(ApacheFactoryContext validatorContext)
-
-
Method Detail
-
getConstraintsForClass
public jakarta.validation.metadata.BeanDescriptor getConstraintsForClass(Class<?> clazz)
- Specified by:
getConstraintsForClass
in interfacejakarta.validation.Validator
-
validate
public <T> Set<jakarta.validation.ConstraintViolation<T>> validate(T object, Class<?>... groups)
- Specified by:
validate
in interfacejakarta.validation.Validator
-
validateProperty
public <T> Set<jakarta.validation.ConstraintViolation<T>> validateProperty(T object, String propertyName, boolean cascade, Class<?>... groups)
Description copied from interface:CascadingPropertyValidator
Validates all constraints placed on the property ofobject
namedpropertyName
.- Specified by:
validateProperty
in interfaceCascadingPropertyValidator
- 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
-
validateValue
public <T> Set<jakarta.validation.ConstraintViolation<T>> validateValue(Class<T> beanType, String propertyName, Object value, boolean cascade, Class<?>... groups)
Description copied from interface:CascadingPropertyValidator
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 interfaceCascadingPropertyValidator
- 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
-
forExecutables
public jakarta.validation.executable.ExecutableValidator forExecutables()
- Specified by:
forExecutables
in interfacejakarta.validation.Validator
-
validateParameters
public <T> Set<jakarta.validation.ConstraintViolation<T>> validateParameters(T object, Method method, Object[] parameterValues, Class<?>... groups)
- Specified by:
validateParameters
in interfacejakarta.validation.executable.ExecutableValidator
-
validateReturnValue
public <T> Set<jakarta.validation.ConstraintViolation<T>> validateReturnValue(T object, Method method, Object returnValue, Class<?>... groups)
- Specified by:
validateReturnValue
in interfacejakarta.validation.executable.ExecutableValidator
-
validateConstructorParameters
public <T> Set<jakarta.validation.ConstraintViolation<T>> validateConstructorParameters(Constructor<? extends T> constructor, Object[] parameterValues, Class<?>... groups)
- Specified by:
validateConstructorParameters
in interfacejakarta.validation.executable.ExecutableValidator
-
validateConstructorReturnValue
public <T> Set<jakarta.validation.ConstraintViolation<T>> validateConstructorReturnValue(Constructor<? extends T> constructor, T createdObject, Class<?>... groups)
- Specified by:
validateConstructorReturnValue
in interfacejakarta.validation.executable.ExecutableValidator
-
unwrap
public <T> T unwrap(Class<T> type)
- Specified by:
unwrap
in interfacejakarta.validation.Validator
-
-