Hi,
I am wondering if it is possible to register programmatically a ConstraintValidator class for a custom annotation to the Validator.
I would like to define an annotation CheckCase (example below ) that would be part of my API but I don't want it to import/depend on the ConstraintValidator class.
The ConstraintValidator is for me an implementation class that I don't want to expose and deliver and even depend on it.
Therefore I want to set the validatedBy attribute to empty array for the @Constraint annotation.
Is it possible to configure the validator so that it associates the @CheckCase annotation a specific ConstraintValidator implementation case ?
(like for the annotations provided in the javax.validation api)
Code:
@Target( { METHOD, FIELD, ANNOTATION_TYPE })
@Retention(RUNTIME)
@Constraint(validatedBy = {})
@Documented
public @interface CheckCase {
String message() default "{com.mycompany.constraints.checkcase}";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
CaseMode value();
}
Thanks in advance,
Regards,
Luc