I am currently have a problem to get the qualified name of constraints annotation from javax.validation.constraints.
I want to check if the annotation(s) is used for the supported type(s).
e.g. @Min and @Max are only allowed for digits, Integer, int, etc…
@NotBlank for CharSequence and can also be used with a string, because String inherit from CharSequence.
But if I want to get fullyQualifiedName of an annotation, most of time I will get “!unknownSymbol!” (except for javax.validation.constraints.Min, -.Max and -.NotNull.)
My first guess was that javax.validation.constraints is not in a Library, which was the case.
So I import the library via Maven and I still get !unknownSymbol! (except for -.Min, -.Max and -.NotNull).
note: I am using a Hashmap with String and List to make a whitelist for each constraints type. e.g. [fullyQualifiedName of annotation, [“Integer”, “int”, “Byte”, …]]
and that`s why I need the FQN of an annotation. But on the prod, it is possible to get the FQN, but not on JUnitTest.
Can someone help me with this? I hope it was understandable.
Thanks in advance.