|Re: how to enumerate all subclasses in genmodel JET templates [message #657656 is a reply to message #657504]
||Thu, 03 March 2011 15:30
| Ed Merks
Registered: July 2009
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.
Powered by FUDForum
. Page generated in 0.05566 seconds