View Javadoc
1   package model.validation;
2   
3   import javax.validation.Constraint;
4   import javax.validation.Payload;
5   import java.lang.annotation.*;
6   
7   /**
8    * L'identificativo deve corrispondere a una sezione esistente
9    * @see SectionExistsByIdValidator
10   * @see SectionExistsByNameValidator
11   */
12  @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER,
13          ElementType.ANNOTATION_TYPE})
14  @Retention(RetentionPolicy.RUNTIME)
15  @Constraint(validatedBy = {SectionExistsByNameValidator.class, SectionExistsByIdValidator.class})
16  @Documented
17  public @interface SectionExists {
18      String message() default "Section must exist";
19  
20      Class<?>[] groups() default {};
21  
22      Class<? extends Payload>[] payload() default {};
23  }