Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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: Sat Jul 12 23:12:05 EDT 2025

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

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

Back to the top