content: package org.agoncal.book.javaee7.chapter03;
  
  import javax.validation.Constraint;
  import javax.validation.Payload;
  import javax.validation.ReportAsSingleViolation;
  import javax.validation.constraints.Pattern;
  import javax.validation.constraints.Size;
  import java.lang.annotation.Retention;
  import java.lang.annotation.Target;
  
  import static java.lang.annotation.ElementType.*;
  import static java.lang.annotation.RetentionPolicy.RUNTIME;
  
  /**
   * @author Antonio Goncalves
   *         APress Book - Beginning Java EE 7 with Glassfish 4
   *         http://www.apress.com/
   *         http://www.antoniogoncalves.org
   *         --
   */
  @Size(min = 7)
  @Pattern(regexp = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\."
          + "[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*"
          + "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?")
  @ReportAsSingleViolation
  @Constraint(validatedBy = {})
  @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
  @Retention(RUNTIME)
  public @interface Email {
  
    String message() default "{org.agoncal.book.javaee7.chapter03.Email.message}";
  
    Class<?>[] groups() default {};
  
    Class<? extends Payload>[] payload() default {};
  
    @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER})
    @Retention(RUNTIME)
    @interface List {
      Email[] value();
    }
  }
  