接口 SmartValidator
- 所有超级接口:
Validator
- 所有已知实现类:
CustomValidatorBean,LocalValidatorFactoryBean,OptionalValidatorFactoryBean,SpringValidatorAdapter
public interface SmartValidator extends Validator
Extended variant of theValidatorinterface, adding support for validation 'hints'.- 从以下版本开始:
- 3.1
- 作者:
- Juergen Hoeller, Sam Brannen
方法详细资料
validate
void validate(Object target, Errors errors, Object... validationHints)
Validate the suppliedtargetobject, which must be of a type ofClassfor which theValidator.supports(Class)method typically returnstrue.The supplied
errorsinstance can be used to report any resulting validation errors.This variant of
validate()supports validation hints, such as validation groups against a JSR-303 provider (in which case, the provided hint objects need to be annotation arguments of typeClass).Note: Validation hints may get ignored by the actual target
Validator, in which case this method should behave just like its regularValidator.validate(Object, Errors)sibling.- 参数:
target- the object that is to be validated (can benull)errors- contextual state about the validation process (nevernull)validationHints- one or more hint objects to be passed to the validation engine- 另请参阅:
ValidationUtils