Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » how to enumerate all subclasses in genmodel JET templates
how to enumerate all subclasses in genmodel JET templates [message #657504] Thu, 03 March 2011 03:16 Go to next message
Simon Chen is currently offline Simon ChenFriend
Messages: 13
Registered: July 2009
Junior Member
Hello there...

I have a no-so-quick question regarding ecore/genmodel and javajet.

More to the point, I am customizing the original Class.javajet in emf.codegen.ecore to generate my own code given an ecore file. Let's say I have a GenClass C, how can I enumerate all the subclasses of C, including child classes, grandchild classes, etc.? I know that I can write a short piece of code there, but I wonder if there is an easy way out...

Thanks.
-Simon
Re: how to enumerate all subclasses in genmodel JET templates [message #657656 is a reply to message #657504] Thu, 03 March 2011 15:30 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30623
Registered: July 2009
Senior Member
Simon,

Comments below

Simon Chen wrote:
> Hello there...
>
> I have a no-so-quick question regarding ecore/genmodel and javajet.
>
> More to the point, I am customizing the original Class.javajet in
> emf.codegen.ecore to generate my own code given an ecore file. Let's
> say I have a GenClass C, how can I enumerate all the subclasses of C,
> including child classes, grandchild classes, etc.? I know that I can
> write a short piece of code there, but I wonder if there is an easy
> way out...
First you have to find all classes, and of course there can be
subclasses in other models that aren't reachable or you can't know about
because they don't exist yet. In any case, look at all the code in the
GenModel's implementation. Things like the child creation descriptors
in the item providers rely on finding all subclasses, so you can follow
what's going on there.
>
> Thanks.
> -Simon
Previous Topic:[TENEO] Support for Inheritance by Teneo
Next Topic:UnresolvedReferenceException an ID
Goto Forum:
  


Current Time: Wed Nov 13 10:16:26 GMT 2019

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

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

Back to the top