0
public class Person {

    private String id;

    @Min(value = 1, message = "Age of person id '${id}' must be greater than 0.")
    private int age;
}

Is it possible to make '${id}' take the value of the id field in this class?

Thanks.

Anna
  • 839
  • 2
  • 17
  • 33
  • @EugeneS: I don't think it's a duplicate. I cannot use a `@ScriptAssert` in my case. I just want to display the value. – Anna Jan 17 '18 at 15:37

1 Answers1

0

No, it's not possible. I have asked a similar question. The problem is that annotations can't deal with variables. Only a final variable can be passed to annotation.

krund
  • 740
  • 1
  • 7
  • 16