001package org.gbif.api.util;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007import javax.validation.Constraint;
008import javax.validation.Payload;
009
010/**
011 * Validates that the URI field is absolute, beginning with either http or https.
012 * To use, apply to the URI fields intended for validation.
013 * The field must be:
014 * <ul>
015 * <li>A URI object</li>
016 * </ul>
017 */
018@Retention(RetentionPolicy.RUNTIME)
019@Target({ElementType.METHOD, ElementType.FIELD})
020@Constraint(validatedBy = URIValidator.class)
021public @interface HttpURI {
022  public abstract Class<?>[] groups() default {};
023  public abstract Class<? extends Payload>[] payload() default { };
024  public abstract String message() default "";
025}