Annotation Interface Validate
@Target({METHOD,FIELD})
@Retention(RUNTIME)
@Documented
@Repeatable(ValidateContainer.class)
@Validation(ValidateImpl.class)
public @interface Validate
Validates a component of the object.
There are 2 use-cases for this annotation:
There are 2 use-cases for this annotation:
- Validate the contents of an application-specific datatype. Those types are not PDOs and as such not
deeply validated. The component must implement
Validateable. - Explicit validation of a PDO component. By default, components in PDOs are validated after all members of the PDO are validated.
This corresponds to the generated order in the source code and ordinal of the
Persistent-annotation. With theValidateannotation, however, the validation order can be changed by providing a priority. An optional condition can also be used to skip the validation of the component, if the condition is not met. Notice that the generated validate()-method of the aggregate PDO will not validate the component again, if annotated with@Validate.
- Author:
- harald
-
Optional Element Summary
Optional Elements
-
Element Details
-
priority
int priorityPriority that determines the execution order of validations.
Higher values will be invoked first.- Returns:
- the priority
- Default:
0
-
scope
Class<? extends ValidationScope>[] scopeThe validation scope(s) the validator should be applied to.- Returns:
- the validation scopes.
- Default:
{org.tentackle.validate.DefaultScope.class}
-
condition
-