ElementType.LOCAL_VARIABLE annotation type

前端 未结 4 696
一生所求
一生所求 2020-12-11 01:45

I`d like to create my own annotations to annotate some local variable. To write the annotation is not the problem, the problem is to get the information of them at the Runti

4条回答
  •  鱼传尺愫
    2020-12-11 01:56

    JLS 9.6.1.2 does indeed state that local variable annotations are not retained. However, JSR 308 is working its way through the community process. It should give you the capability you need.

    If you want an interim solution, here is an implementation of JSR 308.

提交回复
热议问题