@Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER})
@Retention(value=RUNTIME)
@Documented
@Constraint(validatedBy=DecimalRange.DecimalRangeValidator.class)
@Published
public @interface DecimalRange
NumberRangeを用いること。
salesが-1.5~1.5の範囲内であるかチェックするpublic class Sample{@DecimalRange(min = -1.5, max = 1.5) String sales;}