非 GWT Java 代码的延迟绑定生成器
我正在从事的一个项目需要基于一组注释生成一些代码。我感兴趣的是减少处理注释和生成代码的启动成本,这需要将分析和代码生成从运行时/启动转移到应用程序的编译时阶段。我正在尝试的功能与延迟绑定生成器为 GWT 处理的功能非常相似。
延迟绑定是 GWT 编译器使用的一种技术,用于根据一组参数创建和选择类的特定实现。
...
生成器是 GWT 编译器调用的类,用于在编译期间生成类的 Java 实现。
通过延迟绑定生成器,GWT 基本上可以避免反射,因为反射/分析和后续代码生成是在编译时处理的。这使得基于 GWT 的应用程序的启动速度非常快。
是否有任何框架可以处理常规 java 的延迟绑定生成器的概念?
作为一个后续问题,这样做的一个目标也是与 IDE 编译集成。这是否需要某种适用于 Eclipse、Intellij 等的 IDE 插件?另外,它与各种构建工具(Maven、Ant、Gradle 等)的集成效果如何?
A project I am working on requires some code generation based on a set of annotations. I am interested in reducing the startup cost of processing the annotations and generating code which requires moving the analysis and code generation out of runtime/startup into the compile time phase of the application. The functionality I am trying is very similar to what Deferred Bindings Generators handle for GWT.
Deferred Binding is a technique used by the GWT compiler to create and select a specific implementation of a class based on a set of parameters.
...
Generators are classes that are invoked by the GWT compiler to generate a Java implementation of a class during compilation.
Through Deferred Binding Generators, GWT can essentially avoid reflection because the reflection/analysis and subsequent code generation is handled at compile time. This makes the startup of GWT based applications extremely fast.
Are there any frameworks that handle the concept of Deferred Binding Generators for regular java?
As a follow on question, a goal of this is also to integrate with IDE compilation. Will this require some sort of IDE plugin for Eclipse, Intellij, and others? Also, how well will this integrate with the various build tools out there (Maven, Ant, Gradle, etc)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论