1

I have a question about Java Annotations. Is there a way to use code in their usages? It's obvious that I can't use objects but maybe static methods or some other way? I mean something like

@Query(MyClass.staticMethod())

Of course I had tried above code and it is not working :( Do anyone have idea how to achieve such thing?

dandoo1212
  • 11
  • 1
  • 1
    Does this answer your question? [Call method inside annotation in JAVA](https://stackoverflow.com/questions/49277478/call-method-inside-annotation-in-java) – OH GOD SPIDERS Sep 08 '20 at 18:58

1 Answers1

0

You cannot call a method to get a value for the annotation.

Please have look at these posts:
Java Annotations values provided in dynamic manner
Which types can be used for Java annotation members?

mcernak
  • 9,050
  • 1
  • 5
  • 13