Skip to content

Instantly share code, notes, and snippets.

@agoncal
Created March 11, 2014 21:33
Show Gist options
  • Save agoncal/9495544 to your computer and use it in GitHub Desktop.
Save agoncal/9495544 to your computer and use it in GitHub Desktop.
// At the moment I generate this
@Documented
@Constraint(validatedBy = {})
@Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@ReportAsSingleViolation
public @interface URL {
String message() default "{org.mycompany.myproject.constraints.URL.message}";
Class<?>[] groups() default { };
Class<? extends Payload>[] payload() default { };
}
// And I would like to get that
@Documented
@Constraint(validatedBy = {})
@Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@ReportAsSingleViolation
public @interface URL {
String message() default "{org.mycompany.myproject.constraints.URL.message}";
Class<?>[] groups() default { };
Class<? extends Payload>[] payload() default { };
@Target( { METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
public @interface List {
URL[] value();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment