方法体内注释处理 [英] processing of annotations inside a method body

查看:240
本文介绍了方法体内注释处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我处理使用可插拔注释处理API的Java注释。是它在某种程度上可能也处理方法体内部使用的注释吗?

I am processing java annotations using the Pluggable Annotation Processing API. Is it somehow possible to also process annotations used inside a method body?

感谢您的帮助。彼得

推荐答案

我想,我找到了解决办法。因为我认为,这是不可能与当前的javac。当地的注解只是简单的意见,并不会通过可插入注释处理API进行处理。但也有有趣的努力 JSR308 ,处理支持奇妙的事作为类型 - 参数类型注释变量,局部变量,注释,类型检查和铸造...并因为它看起来,它将被纳入OpenJDK的8.不错

I think, i found the solution. As i thought, it is not possible with the current javac. local annotations are just simple comments and wont be processed by the pluggable annotation processing api. BUT there are interesting efforts in JSR308, handling type annotations that support marvelous things as parameters on type-variables, local variables, annotated-type-checking and casting... and as it looks, it will be incorporated into openJDK 8. nice

这篇关于方法体内注释处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆