简体   繁体   中英

navigate ecore model

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

The best single resource on EMF is the "Eclipse Modeling Framework" book (2nd edition).

@Pangea's answer links to the EObject interfaces. 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. 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: 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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