Class CustomValidatorBean
java.lang.Object
org.springframework.validation.beanvalidation.SpringValidatorAdapter
org.springframework.validation.beanvalidation.CustomValidatorBean
- All Implemented Interfaces:
- jakarta.validation.Validator, InitializingBean, SmartValidator, Validator
public class CustomValidatorBean
extends SpringValidatorAdapter
implements jakarta.validation.Validator, InitializingBean
Configurable bean class that exposes a specific JSR-303 Validator
through its original interface as well as through the Spring
Validator interface.- Since:
- 3.0
- Author:
- Juergen Hoeller
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.voidsetMessageInterpolator(jakarta.validation.MessageInterpolator messageInterpolator) Specify a custom MessageInterpolator to use for this Validator.voidsetTraversableResolver(jakarta.validation.TraversableResolver traversableResolver) Specify a custom TraversableResolver to use for this Validator.voidsetValidatorFactory(jakarta.validation.ValidatorFactory validatorFactory) Set the ValidatorFactory to obtain the target Validator from.Methods inherited from class SpringValidatorAdapterdetermineErrorCode, determineField, forExecutables, getArgumentsForConstraint, getConstraintsForClass, getRejectedValue, getResolvableField, processConstraintViolations, requiresMessageFormat, supports, unwrap, validate, validate, validate, validateProperty, validateValue, validateValueMethods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.validation.ValidatorforExecutables, getConstraintsForClass, unwrap, validate, validateProperty, validateValueMethods inherited from interface ValidatorvalidateObject
- 
Constructor Details- 
CustomValidatorBeanpublic CustomValidatorBean()
 
- 
- 
Method Details- 
setValidatorFactorypublic void setValidatorFactory(jakarta.validation.ValidatorFactory validatorFactory) Set the ValidatorFactory to obtain the target Validator from.Default is Validation.buildDefaultValidatorFactory().
- 
setMessageInterpolatorpublic void setMessageInterpolator(jakarta.validation.MessageInterpolator messageInterpolator) Specify a custom MessageInterpolator to use for this Validator.
- 
setTraversableResolverpublic void setTraversableResolver(jakarta.validation.TraversableResolver traversableResolver) Specify a custom TraversableResolver to use for this Validator.
- 
afterPropertiesSetpublic void afterPropertiesSet()Description copied from interface:InitializingBeanInvoked by the containingBeanFactoryafter it has set all bean properties and satisfiedBeanFactoryAware,ApplicationContextAwareetc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set. - Specified by:
- afterPropertiesSetin interface- InitializingBean
 
 
-