## 接口的使用
org.springframework.validation.Validator

- 使用Validator的程序包
  程序包 | 说明
  --- | ---
  org.springframework.validation | Provides data binding and validation functionality, for usage in business and/or UI layers.
  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.

- - ### org.springframework.validation中Validator的使用

    org.springframework.validation中Validator的子接口
    限定符和类型 | 接口和说明
    --- | ---
    `interface` | `SmartValidator` Extended variant of the `Validator` interface, adding support for validation 'hints'.

    返回Validator的org.springframework.validation中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `Validator` | DataBinder.`getValidator()` Return the primary Validator to apply after each binding step, if any.

    返回变量类型为Validator的类型的org.springframework.validation中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `List<Validator>` | DataBinder.`getValidators()` Return the Validators to apply after data binding.

    参数类型为Validator的org.springframework.validation中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | DataBinder.`addValidators(Validator... validators)` Add Validators to apply after each binding step.
    `static void` | ValidationUtils.`invokeValidator(Validator validator, Object obj, Errors errors)` Invoke the given `Validator` for the supplied object and `Errors` instance.
    `static void` | ValidationUtils.`invokeValidator(Validator validator, Object obj, Errors errors, Object... validationHints)` Invoke the given `Validator`/`SmartValidator` for the supplied object and `Errors` instance.
    `void` | DataBinder.`replaceValidators(Validator... validators)` Replace the Validators to apply after each binding step.
    `void` | DataBinder.`setValidator(Validator validator)` Set the Validator to apply after each binding step.

  - ### org.springframework.validation.beanvalidation中Validator的使用

    实现Validator的org.springframework.validation.beanvalidation中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `CustomValidatorBean` Configurable bean class that exposes a specific JSR-303 Validator through its original interface as well as through the Spring `Validator` interface.
    `class` | `LocalValidatorFactoryBean` This is the central class for `javax.validation` (JSR-303) setup in a Spring application context: It bootstraps a `javax.validation.ValidationFactory` and exposes it through the Spring `Validator` interface as well as through the JSR-303 `Validator` interface and the `ValidatorFactory` interface itself.
    `class` | `OptionalValidatorFactoryBean` `LocalValidatorFactoryBean` subclass that simply turns `Validator` calls into no-ops in case of no Bean Validation provider being available.
    `class` | `SpringValidatorAdapter` Adapter that takes a JSR-303 `javax.validator.Validator` and exposes it as a Spring `Validator` while also exposing the original JSR-303 Validator interface itself.