In order to generate any text artifacts from UML models in the Eclipse Modelling Environment (i.e. Papyrus, TopCased, etc.) you should use Acceleo which is an eclipse implementation of the MOF models to text transformation language, the OMG standard language for models to text transformations. It is a very well made technology but it could take some time to become familiar with it especially if you do not know MOF and the Model Driven Architecture.
QVT is another OMG language but its aim is models to models transformations (not models to text). It is therefore not the right answer to your question.
Papyrus is an Eclipse lugin for modeling, you need to use additional Eclipse plugin to do model transformations. In the other answer you can find link to tutorials. First of them indicates you should use QVTo.
发布评论
评论(7)
要从 UML 生成 java 代码,您可以按照以下步骤操作。
我希望这些信息有帮助。
To generate the java code from UML you can follow the below steps.
I hope this information helps.
为了在 Eclipse 建模环境(即 Papyrus、TopCased 等)中从 UML 模型生成任何文本工件,您应该使用 Acceleo 这是一个 eclipse MOF 模型到文本转换语言的实现,即模型的OMG 标准语言到文本转换。
这是一项制作精良的技术,但可能需要一些时间来熟悉它,特别是如果您不知道MOF 和模型驱动架构。
QVT 是另一种 OMG 语言,但其目标是模型到模型的转换(而不是模型到文本)。因此,这不是您问题的正确答案。
In order to generate any text artifacts from UML models in the Eclipse Modelling Environment (i.e. Papyrus, TopCased, etc.) you should use Acceleo which is an eclipse implementation of the MOF models to text transformation language, the OMG standard language for models to text transformations.
It is a very well made technology but it could take some time to become familiar with it especially if you do not know MOF and the Model Driven Architecture.
QVT is another OMG language but its aim is models to models transformations (not models to text). It is therefore not the right answer to your question.
这些可以帮助你。
Papyrus 教程
These can help you.
Papyrus Tutorials
Papyrus是一个用于建模的Eclipse插件,您需要使用额外的Eclipse插件来进行模型转换。在另一个答案中,您可以找到教程的链接。第一个指示您应该使用 QVTo。
资源:
Papyrus is an Eclipse lugin for modeling, you need to use additional Eclipse plugin to do model transformations. In the other answer you can find link to tutorials. First of them indicates you should use QVTo.
Resources:
要从使用 Papyrus 创建的 UML 图生成代码,必须为 Papyrus 创建运行配置。
更多信息和演示视频请访问以下链接。
To generate code from a UML diagram created with Papyrus must create a run configuration for Papyrus.
More information and a demo video at the following links.
您需要安装Papyrus Java Classes Generator。
现在,在您的 model.di 中:右键单击您的班级 --> Java -->生成java代码。
你就完成了!
You need to install Papyrus Java Classes Generator.
Now, in your model.di : right click on your class --> Java --> Generate java code.
And you're done !
它不适用于 Java,因为即使您从类图中获得了代码,但该代码也很脏,完全无法使用。
看来这个工具是由从未做过任何 java 编码的建模者编写的:-)
It doesn't work with Java because even if you get a code from a class diagram then this code is so dirty that it is totally unusable.
It seems that this tool has been written by modelers who have never done any java codding :-)