Skip to main content



      Home
Home » Modeling » EMF » how to enumerate all subclasses in genmodel JET templates
how to enumerate all subclasses in genmodel JET templates [message #657504] Wed, 02 March 2011 22:16 Go to next message
Eclipse UserFriend
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 10:30 Go to previous message
Eclipse UserFriend
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: Sat Jul 12 10:43:38 EDT 2025

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

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

Back to the top