Let's say we have the following piece of code:
public class Demo {
@ABC(name = "abc")
private String field1;
@ABC
private String field2;
}
@interface ABC {
String name() default "";
}
How can I write a query that selects all the fields annotated with @ABC
that does not have the name
property?
There's getValue(string)
method in Annotation
object, but getValue("name")
returns empty string for the annotation on field2
because it's the default value. But I am wondering how can I check if that property is even there, mentioned by the author.