Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Root Class of Ecore model package instance
Root Class of Ecore model package instance [message #638381] Thu, 11 November 2010 06:02 Go to next message
vaibhav  is currently offline vaibhav Friend
Messages: 22
Registered: September 2010
Junior Member
Hi,

How to get the root class of the Model package instance ? Is there any API for that ?

Best Regards,
Vaibhav
Re: Root Class of Ecore model package instance [message #638395 is a reply to message #638381] Thu, 11 November 2010 07:49 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 11.11.10 07.02, vaibhav wrote:
>
> How to get the root class of the Model package instance ? Is there any
> API for that ?

What do you mean by "root" class. A class at the root of an inheritance
tree (i.e. the super-most class) or a containment tree (i.e. a class not
contained in anything but itself)? In any case, I think you'll have to
do a topological sort yourself.

Hallvard
Re: Root Class of Ecore model package instance [message #638461 is a reply to message #638381] Thu, 11 November 2010 11:47 Go to previous message
Nirmal SasidharanFriend
Messages: 120
Registered: July 2009
Location: Germany
Senior Member
Hello Vaibhav,

Assuming that you are looking to get the Root container of the EPackage doing a
EcoreUtil.getRootContainer(eClass) 
and getting the first child should work (again assuming that you have a single root). If you already have a handle to the EPackage then only the second part is enough.

Regards,
Nirmal
Previous Topic:Sorted ELists
Next Topic:Referencing image files
Goto Forum:
  


Current Time: Tue Apr 23 06:42:55 GMT 2024

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

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

Back to the top