Annotation Interface Constraint


@Documented @Target(ANNOTATION_TYPE) @Retention(RUNTIME) public @interface Constraint
Meta annotation to declare a constraint annotation. Every custom constraint annotation meta-annotated with this very annotation must implement the following fields:
  • String message() - the message to be used if this constraint is violated.
  • Class<?>[] groups() default {}; - the validation group. See GroupSequence. If a constraint gets applied without any specific group then Default is assumed.
  • Class<? extends Payload>[] payload() default {}; - Custom Payload for the contstraint.
Version:
$Rev$ $Date$
See Also:
  • Element Details