Skip to main content



      Home
Home » Archived » EMF-IncQuery » get Eclass of EObject
get Eclass of EObject [message #1410999] Fri, 22 August 2014 02: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 03:07 Go to previous messageGo to next message
Eclipse UserFriend
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 03: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: Tue Jul 08 01:29:52 EDT 2025

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

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

Back to the top