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 un utente esistente
9    * @see UserExistsByNameValidator
10   * @see UsersExistsByIdValidator
11   */
12  @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER,
13          ElementType.ANNOTATION_TYPE})
14  @Retention(RetentionPolicy.RUNTIME)
15  @Constraint(validatedBy = {UsersExistsByIdValidator.class, UserExistsByNameValidator.class})
16  @Documented
17  public @interface UserExists {
18      String message() default "User must exist";
19  
20      Class<?>[] groups() default {};
21  
22      Class<? extends Payload>[] payload() default {};
23  }