Package org.springframework.validation
Interface SmartValidator
- All Superinterfaces:
Validator
- All Known Implementing Classes:
CustomValidatorBean
,LocalValidatorFactoryBean
,OptionalValidatorFactoryBean
,SpringValidatorAdapter
public interface SmartValidator extends Validator
Extended variant of theValidator
interface, adding support for validation 'hints'.- Since:
- 3.1
- Author:
- Juergen Hoeller, Sam Brannen
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
validate(Object target, Errors errors, Object... validationHints)
Validate the suppliedtarget
object, which must be of a type ofClass
for which theValidator.supports(Class)
method typically returnstrue
.
Method Detail
validate
void validate(Object target, Errors errors, Object... validationHints)
Validate the suppliedtarget
object, which must be of a type ofClass
for which theValidator.supports(Class)
method typically returnstrue
.The supplied
errors
instance 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.- Parameters:
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- See Also:
ValidationUtils