Skip to content

Instantly share code, notes, and snippets.

@sednem
Created October 25, 2012 16:10
Show Gist options
  • Save sednem/3953715 to your computer and use it in GitHub Desktop.
Save sednem/3953715 to your computer and use it in GitHub Desktop.
Annotation ISBN
package br.ufpe.nti.entity.beanValidation;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
@Target( { METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Constraint(validatedBy = ValidaISBN.class)
@Documented
public @interface ISBN {
String message() default "{validation.isbn}";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment