If have a Java class with some fields I want to validate using Hibernate Validator. Now I want my users to be able to configure at runtime which validations take place.
For example:
public class MyPojo {
...
@NotEmpty
String void getMyField() {
...
}
...
}
Let's say I want to remove the NotEmpty
check or replace it with Email
or CreditCardNumber
, how can I do it? Is it even possible? I guess it comes down to changing annotations at runtime...