@Documented @Inherited @Retention(value=RUNTIME) @Target(value=METHOD) public @interface OnValidate
This annotation does not change when an object will be enqueued for validation. It only affects the behavior once validation of an instance is actually performed.
When validating an object, validation via @OnValidate methods occurs after JSR 303 validation, if any.
An optional list of validation groups() may be specified; if so, the annotated method will only be invoked when
one or more of specified validation groups (or a superclass thereof) is being validated. In particular, if groups()
is non-empty and does not contain a class that extends Default, then the method will
not be invoked by automatic validation.
The annotated method must be an instance method (i.e., not static), return void, and take zero parameters.
If validation fails, the method should throw a ValidationException.
Copyright © 2017. All rights reserved.