@Documented @Target(value=ANNOTATION_TYPE) @Retention(value=RUNTIME) public @interface Constraint
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.Built in Constraints
Modifier and Type | Required Element and Description |
---|---|
Class<? extends ConstraintValidator<?,?>>[] |
validatedBy |
public abstract Class<? extends ConstraintValidator<?,?>>[] validatedBy
ConstraintValidator
which gets used when this constraint is applied
to fields, methods (getters), types or parameter.Copyright © 2017. All rights reserved.