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 @Size @Pattern(regexp = "") public @interface CurrencyEmpty { String message() default "{error.domain.currency}"; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; @OverridesAttribute(constraint = Size.class, name = "max") int max() default 3; @OverridesAttribute(constraint = Pattern.class, name = "regexp") String regexp() default "^[a-zA-Z]{3}$"; @Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER }) @Retention(RUNTIME) @Documented public @interface List { CurrencyEmpty[] value(); } }