![]() P.S: I haven't tried and tested the second method. You can find a reference implementation here. The way jdk stores the annotation map is java version dependent and is not reliable since it is not exposed for use (it is private). We can put the newly created annotation with the actual value (which is constant) on the property of the annotation and override the actual annotation in the retrieved map. Then we create an annotation object of the required type. So while processing the annotation for the first time, we resolve the expression and find the actual value. You can use reflection and get hold of that map. Java stores a private variable which maintains a map of annotations on the class/field/method.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |