Applicable methods have JSR-303 constraint annotations on their parameters and/or on their return value (in the latter case specified at the method level, typically as inline annotation).
E.g.: public @NotNull Object myValidMethod(@NotNull String arg1, @Max(10) int arg2)
Validation groups can be specified through Spring's {@link Validated} annotationat the type level of the containing target class, applying to all public service methods of that class. By default, JSR-303 will validate against its default group only.
As of Spring 3.1, this functionality requires Hibernate Validator 4.2 or higher. In Spring 3.2, this class will autodetect a Bean Validation 1.1 compliant provider and automatically use the standard method validation support there (once available). @author Juergen Hoeller @since 3.1 @see MethodValidationPostProcessor @see org.hibernate.validator.method.MethodValidator
|
|