How can I change annotations/Hibernate validation rules at runtime?
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... You can't do it normally. Here's what I've done to get more dynamic validations working via Hibernate Validator. Extend the ClassValidator class.