AnnotationProcessing - Generating Files at Each Round vs at Last Round

只谈情不闲聊 提交于 2019-12-22 05:49:12

问题


I was playing around with annotation processing and was unable to use generated files directly via an import in my code. Instead I had to prepend the generated class with its complete package. I posted a SO question error: package generated.schema does not exist.

In the end I figured out the reason for this, turned out to be pretty simple, see my answer to the same post. Turned out the error was because I was generating the files at last round of processing, instead of anywhere in between.

So my questions are:

  • How does generating files at last round vs generating files at in between rounds changes accessing the generated files in code?

  • Is there a specific reason (Java-related or otherwise) for this behavior?

来源:https://stackoverflow.com/questions/56831539/annotationprocessing-generating-files-at-each-round-vs-at-last-round

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!