Class MethodValidationAdapter

java.lang.Object
org.springframework.validation.beanvalidation.MethodValidationAdapter

public class MethodValidationAdapter extends Object
Assist with applying method-level validation via Validator, adapt each resulting ConstraintViolation to ParameterValidationResult, and raise MethodValidationException.

Used by MethodValidationInterceptor.

Since:
6.1
Author:
Rossen Stoyanchev
  • Constructor Details

    • MethodValidationAdapter

      public MethodValidationAdapter()
      Create an instance using a default JSR-303 validator underneath.
    • MethodValidationAdapter

      public MethodValidationAdapter(ValidatorFactory validatorFactory)
      Create an instance using the given JSR-303 ValidatorFactory.
      Parameters:
      validatorFactory - the JSR-303 ValidatorFactory to use
    • MethodValidationAdapter

      public MethodValidationAdapter(Validator validator)
      Create an instance using the given JSR-303 Validator.
      Parameters:
      validator - the JSR-303 Validator to use
    • MethodValidationAdapter

      public MethodValidationAdapter(Supplier<Validator> validator)
      Create an instance for the supplied (potentially lazily initialized) Validator.
      Parameters:
      validator - a Supplier for the Validator to use
  • Method Details