I have a group of annotations that are always together like so:
@Valid
@ValidPropertyA(kind = "Standard")
@ValidPropertyB(kind = "Standard")
@ValidPropertyC(kind = "Standard")
private SomeReusableType type;
@Valid
@ValidPropertyA(kind = "large")
@ValidPropertyB(kind = "large")
@ValidPropertyC(kind = "large")
private SomeReusableType type;
I would like to compose these annotations into a single annotation @ValidReusableType
, but the problem that I have is is how would I push the kind
into each of the @ValidProperty's
that are on the @ValidResuableType
type?
@Valid
@ValidReusableType(kind = "standard")
private SomeReusableType type;
@Valid
@ValidReusableType(kind = "large")
private SomeReusableType type;
Is there any way to setup the composed annotation to have it so my ConstraintValidator
still have access to the kind
they are validating?