如何使组合约束参数化?
例如,我要使用:
public class Invoice {
@ValidInvoiceAmount(100)
private BigDecimal amount;
}
此注释的意思是:
@Min(value = 100)
@NotNull
// ...
public @interface ValidInvoiceAmount {
// ...
}
参考:Example 12.11: Specifying the validation target of a purely composed constraint
示例12.11 将min-value固定为0,但我想将此值用作变量。