Annotation Interface Validate


Validates a component of the object.
There are 2 use-cases for this annotation:
  1. Validate the contents of an application-specific datatype. Those types are not PDOs and as such not deeply validated. The component must implement Validateable.
  2. 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 the Validate annotation, 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
    Modifier and Type
    Optional Element
    Description
    The optional condition.
    int
    Priority that determines the execution order of validations.
    Higher values will be invoked first.
    Class<? extends ValidationScope>[]
    The validation scope(s) the validator should be applied to.
  • Element Details

    • priority

      int priority
      Priority that determines the execution order of validations.
      Higher values will be invoked first.
      Returns:
      the priority
      Default:
      0
    • scope

      Class<? extends ValidationScope>[] scope
      The validation scope(s) the validator should be applied to.
      Returns:
      the validation scopes.
      Default:
      {org.tentackle.validate.DefaultScope.class}
    • condition

      String condition
      The optional condition.
      Returns:
      the condition
      Default:
      ""