方法体中注解的处理 [英] processing of annotations inside a method body

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

问题描述

我正在使用 Pluggable Annotation Processing 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天全站免登陆