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.*; import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat.ISO; /** * ISOフォーマットの日付(必須)を表現する制約注釈。 * <p>YYYY-MM-DDを想定します。 */ @Documented @Constraint(validatedBy = {}) @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER }) @Retention(RUNTIME) @ReportAsSingleViolation @NotNull @DateTimeFormat(iso = ISO.DATE) public @interface ISODate { String message() default "{error.domain.ISODate}"; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER }) @Retention(RUNTIME) @Documented public @interface List { ISODate[] value(); } }