On 13 Jan 2017, at 18:54, Matt Benson <mbenson(a)apache.org>
wrote:
As I warned, however, defining these might become tedious. It might be helpful to define
a mechanism (like that supported by Spring) to map annotation elements:
@Size
@ConstraintsApplyTo(WRAPPED_VALUE)
@Constraint
public @interface WrappedSize {
@MapTo(type=Size.class, attribute="min")
int min() default 0;
@MapTo(type=Size.class, attribute="max")
int max() default Integer.MAX_VALUE;
String message() default "";
Class<?> groups() default {};
Class<? extends Payload>[] payload() default {};
}
@Size(1) @WrappedSize(min=3) StringList nicknames;
If you mean something like @MapTo, the spec already has that via @OverridesAttribute
AFAIK we invented it.