spring-framework / org.springframework.validation / ValidationUtils / invokeValidator

invokeValidator

open static fun invokeValidator(validator: Validator, obj: Any, errors: Errors): Unit

Invoke the given Validator for the supplied object and Errors instance.

Parameters

validator - the Validator to be invoked (must not be null)

obj - the object to bind the parameters to

errors - the Errors instance that should store the errors (must not be null)

Exceptions

IllegalArgumentException - if either of the Validator or Errors arguments is null, or if the supplied Validator does not support the validation of the supplied object's type

open static fun invokeValidator(validator: Validator, @Nullable obj: Any, errors: Errors, @Nullable vararg validationHints: Any): Unit

Invoke the given Validator/SmartValidator for the supplied object and Errors instance.

Parameters

validator - the Validator to be invoked (must not be null)

obj - the object to bind the parameters to

errors - the Errors instance that should store the errors (must not be null)

validationHints - one or more hint objects to be passed to the validation engine

Exceptions

IllegalArgumentException - if either of the Validator or Errors arguments is null, or if the supplied Validator does not support the validation of the supplied object's type