Package org.springframework.validation.beanvalidation

# Class OptionalValidatorFactoryBean

java.lang.Object
org.springframework.validation.beanvalidation.SpringValidatorAdapter
org.springframework.validation.beanvalidation.LocalValidatorFactoryBean
org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean

All Implemented Interfaces:
  `Validator`, `ValidatorFactory`, `AutoCloseable`, `org.springframework.beans.factory.Aware`, `org.springframework.beans.factory.DisposableBean`, `org.springframework.beans.factory.InitializingBean`, `ApplicationContextAware`, `SmartValidator`, `Validator`

public class OptionalValidatorFactoryBean extends LocalValidatorFactoryBean
`LocalValidatorFactoryBean` subclass that simply turns `Validator` calls into no-ops in case of no Bean Validation provider being available.

This is the actual class used by Spring's MVC configuration namespace, in case of the `jakarta.validation` API being present but no explicit Validator having been configured.

Since:
  4.0.1
Author:
  Juergen Hoeller

## Constructor Summary

Constructors
Constructor
Description
`OptionalValidatorFactoryBean()`

## Method Summary

Modifier and Type
Method
Description
`void`
`afterPropertiesSet()`

### Methods inherited from class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean

`close, destroy, getClockProvider, getConstraintValidatorFactory, getMessageInterpolator, getParameterNameProvider, getTraversableResolver, getValidationPropertyMap, getValidator, postProcessConfiguration, setApplicationContext, setConfigurationInitializer, setConstraintValidatorFactory, setMappingLocations, setMessageInterpolator, setParameterNameDiscoverer, setProviderClass, setTraversableResolver, setValidationMessageSource, setValidationProperties, setValidationPropertyMap, setValidationProviderResolver, unwrap, usingContext`

### Methods inherited from class org.springframework.validation.beanvalidation.SpringValidatorAdapter

`determineErrorCode, determineField, forExecutables, getArgumentsForConstraint, getConstraintsForClass, getRejectedValue, getResolvableField, processConstraintViolations, requiresMessageFormat, supports, validate, validate, validate, validateProperty, validateValue, validateValue`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.validation.Validator

`validateObject`

## Constructor Details

### OptionalValidatorFactoryBean

public OptionalValidatorFactoryBean()

## Method Details

### afterPropertiesSet

public void afterPropertiesSet()

Specified by:
  `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
Overrides:
  `afterPropertiesSet` in class `LocalValidatorFactoryBean`