Top Description Fields Constructors Methods
org.springframework.validation.beanvalidation

public Class CustomValidatorBean

extends SpringValidatorAdapter
implements Validator, InitializingBean
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.InitializingBean, jakarta.validation.Validator
Imports
jakarta.validation.MessageInterpolator, .TraversableResolver, .Validation, .Validator, .ValidatorContext, .ValidatorFactory, org.springframework.beans.factory.InitializingBean, org.springframework.lang.Nullable

Configurable bean class that exposes a specific JSR-303 Validator through its original interface as well as through the Spring org.springframework.validation.Validator interface.
Author
Juergen Hoeller
Since
3.0

Field Summary

Modifier and TypeField and Description
private MessageInterpolator
private TraversableResolver
private ValidatorFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

public void
setMessageInterpolator(MessageInterpolator messageInterpolator)

Specify a custom MessageInterpolator to use for this Validator.

public void
setTraversableResolver(TraversableResolver traversableResolver)

Specify a custom TraversableResolver to use for this Validator.

public void
setValidatorFactory(ValidatorFactory validatorFactory)

Set the ValidatorFactory to obtain the target Validator from.

Inherited from org.springframework.validation.beanvalidation.SpringValidatorAdapter:
determineErrorCodedetermineFieldforExecutablesgetArgumentsForConstraintgetConstraintsForClassgetRejectedValuegetResolvableFieldprocessConstraintViolationsrequiresMessageFormatsetTargetValidatorsupportsunwrapvalidatevalidatevalidatevalidatePropertyvalidateValuevalidateValue

Field Detail

messageInterpolatorback to summary
private MessageInterpolator messageInterpolator
Annotations
@Nullable
traversableResolverback to summary
private TraversableResolver traversableResolver
Annotations
@Nullable
validatorFactoryback to summary
private ValidatorFactory validatorFactory
Annotations
@Nullable

Constructor Detail

CustomValidatorBeanback to summary
public CustomValidatorBean()

Method Detail

afterPropertiesSetback to summary
public void afterPropertiesSet()

Implements org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Doc from org.springframework.beans.factory.InitializingBean.afterPropertiesSet.

Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

Annotations
@Override
setMessageInterpolatorback to summary
public void setMessageInterpolator(MessageInterpolator messageInterpolator)

Specify a custom MessageInterpolator to use for this Validator.

setTraversableResolverback to summary
public void setTraversableResolver(TraversableResolver traversableResolver)

Specify a custom TraversableResolver to use for this Validator.

setValidatorFactoryback to summary
public void setValidatorFactory(ValidatorFactory validatorFactory)

Set the ValidatorFactory to obtain the target Validator from.

Default is jakarta.validation.Validation#buildDefaultValidatorFactory().