Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Ecore Tools » accessing ecore model content
accessing ecore model content [message #633664] Mon, 18 October 2010 18:35 Go to next message
waqar  is currently offline waqar Friend
Messages: 5
Registered: October 2010
Junior Member
i am new to this group and also to ecore modeling.
I created a ecore model in emf and now deserialize it using the code:

Resource res = ResourceSet.getResource(URI.createFileURI("LibV2.ecore"), true) ;

// get the root object
EObject root = res.getContents().get(0) ;

Now I want to know how i further get access to the contents of my model.

Re: accessing ecore model content [message #641759 is a reply to message #633664] Sat, 27 November 2010 17:13 Go to previous message
readingflyer is currently offline readingflyerFriend
Messages: 3
Registered: November 2010
Junior Member

root should be an EPackage. You can make an instanceof test and cast it than to that. Then you can use the method EPackage.getEClassifiers() to get all EClasses and EDataTypes of your model.
Previous Topic:[EMF/Ecore] Generated editor projects always break after metamodel modifications?
Next Topic:Weaving a new model from existing ones
Goto Forum:

Current Time: Mon Oct 26 08:29:16 GMT 2020

Powered by FUDForum. Page generated in 0.01346 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top