Annotation Processor - How to get the Class it is processing
来源:互联网 发布:杭州海关大数据 编辑:程序博客网 时间:2024/04/28 09:27
You are unable to access the Class the Annotation Processor is processing because the Class has not been compiled yet. Instead Java offers the analogous Elements api for reflection-style inspection of the input source.
The Element (which you found by using roundEnv.getRootElements()
) has much more information about the class being compiled than just its name. A ton of useful information can be found by using the ElementVisitors:
http://stackoverflow.com/questions/18034626/annotation-processor-how-to-get-the-class-it-is-processing
自己出现的问题跟这个差不多,想访问Annotation Processor生成的java文件中的类。
最后解决办法:就是生成类中必须实现某个接口,而这个接口本身是已经存在的。然后调用这个接口就可以实现了。
0 0
- Annotation Processor - How to get the Class it is processing
- How to Get the WDK
- Lombok Requires Annotation Processing Annotation processing seems to be disabled for the project "xx
- What is svchost.exe And Why Is It Running? :: the How-To Geek
- How to get to the point quickly?
- Get "Server Down" when retrieve the channel list in sopcast, how to solve it?
- virtual memory layout and how to get it by the correspoinding functuon
- How to get a type in C++ when its template argument is the argument
- know how it works is the best way to understand all
- enough is enough - how to make a dmg the way you expect it
- Colored SQL--How to force the AWR to capture a specified SQL even if it is not the top one
- Is it possible to get the difference from two dynamic arrays regardless of their order?
- How to get parameters from the URL?
- How to get the current epoch time
- How to get the useful synonyms
- How to get the Information leakage
- [PHP]How to get the system info?
- How to get the digest hash
- 5分钟学会的新技能,炫酷到没朋友
- 初识osg
- 如何在大学时代成为编程大神!
- mac idea(intellij idea)常用快捷键
- linux sshd远程登陆配置
- Annotation Processor - How to get the Class it is processing
- android进阶之路:大牛问答
- Attribute value is quoted with " which must be escaped when used within the value 问题解决
- Android Studio编译报错:sdk:minSdkVersion 1 cannot be smaller than version 7 declared in library
- javascript异步执行函数导致的变量变化问题解决思路
- JS继承机制的深入理解--动态原型存在的问题与解决
- 近期博客说明
- 欢迎使用CSDN-markdown编辑器
- [学习笔记]二位数组作为函数参数传递剖析