Trying to read regex values from yaml file in POJO class. like this,
@Pattern(regexp = "${something.value}")
private String someValue;
But this is not working because its expecting below, (Within annotations you can only refer to constant expressions)
Pattern.regexp must be a constant expression at run time.
Am curious if there is any solution for this case with only supporting Annotations or calling some get/set methods at runtime which holds value of config.
Not really looking for custom validator solution though.
Thanks for your help in advance.