Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EMF-IncQuery » get Eclass of EObject
get Eclass of EObject [message #1410999] Fri, 22 August 2014 06:27 Go to next message
Eclipse GuestFriend
Messages: 93
Registered: February 2013
Location: Vienna
Member
Hi !

I need to get the EClass of a specific EObject and all EObjects of a specific EClass. I would like to write this on a pattern that will fit for all models , like this for example :

pattern getEClass(o : EObject) {
EObject.eClass();
}

Is there any way to do this ? It is very important to be able to find for a specific Eobject its EClass. Thank you !
Re: get Eclass of EObject [message #1411012 is a reply to message #1410999] Fri, 22 August 2014 07:07 Go to previous messageGo to next message
Gabor Bergmann is currently offline Gabor BergmannFriend
Messages: 28
Registered: July 2009
Junior Member
Hi,

if you wish to know all instances of a given eClass:

pattern foo(bar) = {
MyFavoriteEClass(bar); 
// write here any other constraint you want to put on 'bar'
}


Currently, you cannot query the type of an eObject using EMF-IncQuery - but hey, you can easily do it in Java, using the .eClass() method.
Re: get Eclass of EObject [message #1411016 is a reply to message #1411012] Fri, 22 August 2014 07:11 Go to previous message
Eclipse GuestFriend
Messages: 93
Registered: February 2013
Location: Vienna
Member
Thank you very much!
Previous Topic:Simplification of Query
Next Topic:Aggregation of Strings of different Objects
Goto Forum:
  


Current Time: Fri Sep 21 23:03:54 GMT 2018

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

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

Back to the top