从 Java 类调用 Acceleo 生成器
我必须从我制作的 Java 类中调用 Acceleo 生成器。我怎样才能做到呢?
谢谢
I have to call an Acceleo generator from a Java Class I made. How I can do it?
Thank You
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
[comment @main/]
注释查看从模板自动生成的 Java 类(要快速获取示例,请使用 File > New > Acceleo Module File 并勾选“Create高级选项中的主要注释”)。这个自动化类可以从您编写的任何其他 Java 类中调用,只需实例化它并调用其“initialize”和“doGenerate”方法即可。查看生成的
public static void main(String[] args)
方法,了解其使用示例。You could take a look at the Java class automatically generated from templates with the
[comment @main/]
comment (to quickly get an example, use File > New > Acceleo Module File and tick "Create a main annotation" in the advanced options).This automated class can be called from any other Java class you write by simply instantiating it and calling its 'initialize' and 'doGenerate' methods. Take a look at the generated
public static void main(String[] args)
method for a sample of its use.