简体   繁体   English

浏览ecore模型

[英]navigate ecore model

如何在Java中以编程方式导航Ecore模型以提取元素信息?

The best single resource on EMF is the "Eclipse Modeling Framework" book (2nd edition). 关于EMF的最佳单一资源是“ Eclipse Modeling Framework”一书(第2版)。

@Pangea's answer links to the EObject interfaces. @Pangea的答案链接到EObject接口。 But a better way to use a model instance is to use the generated interfaces. 但是使用模型实例的更好方法是使用生成的接口。 If you read the "A Tour of the Eclipse Modeling Framework" article by Lars Vogel, it includes a simple example of accessing a model using the generated APIs. 如果您阅读Lars Vogel撰写的“ Eclipse建模框架之旅” ,则其中包括使用生成的API访问模型的简单示例。 And "the book" has a lot more on this subject. 而“这本书”在这个主题上还有很多。

You can use EObject's api like eContents(), eSet(), eGet() etc..or you can use oAW's xText. 您可以使用eObject的api(例如eContents(),eSet(),eGet()等),也可以使用oAW的xText。

EObject API: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EObject.html EObject API: http ://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/ EObject.html

http://www.eclipse.org/Xtext/ http://www.eclipse.org/Xtext/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM