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 14:35 Go to next message
waqar  is currently offline waqar
Messages: 5
Registered: October 2010
Junior Member
hi,
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.

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

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: Thu Jul 31 09:38:35 EDT 2014

Powered by FUDForum. Page generated in 0.02485 seconds