Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Determine subclasses from a metaclass
Determine subclasses from a metaclass [message #511918] Wed, 03 February 2010 12:28 Go to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Hi all,
I want to collect all the subtypes/implementors of an abstract/interface
metaclass with the EMF reflective API. That means this would be the
contrary operation to EClass.getEAllSuperTypes(). What is a convenient
way to solve this? There is a method EClass.isSuperTypeOf(EClass) but I
don't want to invoke this on every metaclass in metamodels. By the way,
how can I get all metaclasses in a metamodel? Can anybody help me?

best regards,
Gilbert
Re: Determine subclasses from a metaclass [message #511944 is a reply to message #511918] Wed, 03 February 2010 13:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Gilbert,

Comments below.

Gilbert Mirenque wrote:
> Hi all,
> I want to collect all the subtypes/implementors of an abstract/interface
> metaclass with the EMF reflective API. That means this would be the
> contrary operation to EClass.getEAllSuperTypes(). What is a convenient
> way to solve this? There is a method EClass.isSuperTypeOf(EClass) but I
> don't want to invoke this on every metaclass in metamodels.
Unfortunately that's the only way. The space of all subtypes of an
EClass is unbounded because the space of all EClasses itself is
unbounded. Therefore, the first step is to bound the space of all
EClasses and check each EClass within that space to see if it's a subtype.
> By the way,
> how can I get all metaclasses in a metamodel?
EPackage.eClassifiers will include all EClasses of that package, along
with all EDataTypes too, so you'll need to do instance of checks.
> Can anybody help me?
>
> best regards,
> Gilbert
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Determine subclasses from a metaclass [message #511993 is a reply to message #511944] Wed, 03 February 2010 15:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Thank you Ed, I got it work. But one further question.
EClass.getEPackage() returns the package of an EClass. Does
EPackage.getEClassifiers() return all classifiers independent if they
are placed not directly in the EPackage but in sub-EPackages?
Re: Determine subclasses from a metaclass [message #511996 is a reply to message #511993] Wed, 03 February 2010 15:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Gilbert,

No, EPackage.getEClassifiers returns only the directly contained
classifiers.


Gilbert Mirenque wrote:
> Thank you Ed, I got it work. But one further question.
> EClass.getEPackage() returns the package of an EClass. Does
> EPackage.getEClassifiers() return all classifiers independent if they
> are placed not directly in the EPackage but in sub-EPackages?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:With Teneo and EAV schema, what is the best approach to do non-id based query?
Next Topic:Problem with non-unique reference
Goto Forum:
  


Current Time: Thu Apr 25 05:17:57 GMT 2024

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

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

Back to the top