package sample.model.constraints; import static java.lang.annotation.ElementType.*; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.*; import javax.validation.*; import javax.validation.constraints.*; /** * 年を表現する制約注釈。 */ @Documented @Constraint(validatedBy = {}) @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER }) @Retention(RUNTIME) @ReportAsSingleViolation @Digits(integer = 4, fraction = 0) @Size public @interface YearEmpty { String message() default "{error.domain.year}"; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; @OverridesAttribute(constraint = Size.class, name = "max") int max() default 4; @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER }) @Retention(RUNTIME) @Documented public @interface List { YearEmpty[] value(); } }