Class SpringwebConstraintValidatorFactory

java.lang.Object
org.springframework.web.bind.support.SpringwebConstraintValidatorFactory
All Implemented Interfaces:
jakarta.validation.ConstraintValidatorFactory

public class SpringwebConstraintValidatorFactory extends Object implements jakarta.validation.ConstraintValidatorFactory
JSR-303 ConstraintValidatorFactory implementation that delegates to the current Spring webApplicationContext for creating autowired ConstraintValidator instances.

In contrast to SpringConstraintValidatorFactory, this variant is meant for declarative use in a standard validation.xml file, for example, in combination with JAX-RS or JAX-WS.

Since:
4.2.1
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • SpringwebConstraintValidatorFactory

      public SpringwebConstraintValidatorFactory()
  • Method Details

    • getInstance

      public <T extends jakarta.validation.ConstraintValidator<?,?>> T getInstance(Class<T> key)
      Specified by:
      getInstance in interface jakarta.validation.ConstraintValidatorFactory
    • releaseInstance

      public void releaseInstance(jakarta.validation.ConstraintValidator<?,?> instance)
      Specified by:
      releaseInstance in interface jakarta.validation.ConstraintValidatorFactory
    • getwebApplicationContext

      protected webApplicationContext getwebApplicationContext()
      Retrieve the Spring webApplicationContext to use. The default implementation returns the current webApplicationContext as registered for the thread context class loader.
      Returns:
      the current webApplicationContext (never null)
      See Also: