Package org.springframework.validation.beanvalidation
@NonNullApi
@NonNullFields
package org.springframework.validation.beanvalidation
Support classes for integrating a JSR-303 Bean Validation provider
(such as Hibernate Validator) into a Spring ApplicationContext
and in particular with Spring's data binding and validation APIs.
The central class is LocalValidatorFactoryBean
which defines a shared ValidatorFactory/Validator setup for availability
to other Spring components.
-
ClassDescriptionSimple
BeanPostProcessorthat checks JSR-303 constraint annotations in Spring-managed beans, throwing an initialization exception in case of constraint violations right before calling the bean's init method (if any).Configurable bean class that exposes a specific JSR-303 Validator through its original interface as well as through the SpringValidatorinterface.Default implementation ofMethodValidatorthat delegates to aMethodValidationAdapter.Delegates to a targetMessageInterpolatorimplementation but enforces Spring's managed Locale.This is the central class forjakarta.validation(JSR-303) setup in a Spring application context: It bootstraps ajakarta.validation.ValidationFactoryand exposes it through the SpringValidatorinterface as well as through the JSR-303Validatorinterface and theValidatorFactoryinterface itself.Implementation of Hibernate Validator 4.3/5.x'sResourceBundleLocatorinterface, exposing a SpringMessageSourceas localizedMessageSourceResourceBundle.Assist with applying method-level validation viaValidator, adapt each resultingConstraintViolationtoParameterValidationResult, and raiseMethodValidationException.Contract to determine the object name of an@Validmethod parameter.Extension ofConstraintViolationExceptionthat implementsMethodValidationResultexposing an additional list ofParameterValidationResultthat represents violations adapted toMessageSourceResolvableand grouped by method parameter.An AOP AllianceMethodInterceptorimplementation that delegates to a JSR-303 provider for performing method-level validation on annotated methods.A convenientBeanPostProcessorimplementation that delegates to a JSR-303 provider for performing method-level validation on annotated methods.Container for method validation results where underlyingviolationshave been adapted toParameterValidationResulteach containing a list ofMessageSourceResolvablegrouped by method parameter.Contract to apply method validation without directly usingMethodValidationAdapter.LocalValidatorFactoryBeansubclass that simply turnsValidatorcalls into no-ops in case of no Bean Validation provider being available.Extension ofParameterValidationResultthat's created for Object method arguments or return values with cascaded violations on their properties.Store and expose the results of method validation viaValidatorfor a specific method parameter.JSR-303ConstraintValidatorFactoryimplementation that delegates to a Spring BeanFactory for creating autowiredConstraintValidatorinstances.Adapter that takes a JSR-303javax.validator.Validatorand exposes it as a SpringValidatorwhile also exposing the original JSR-303 Validator interface itself.