| [news.eclipse.tools.emf] Re: Integrate with EMF code generation |
|
Martin, Comments below. Martin Taal wrote: Hi Ed (and others),I see. It would seem nicer if we had some type of extensibility mechanism. This bugzilla hints about that https://bugs.eclipse.org/bugs/show_bug.cgi?id=176726 For example I would like to add the following code to the templates (before the getter in the template):GenModel does support GenAnnotations, so it's definitely possible to associate additional information with the GenModel (at any level) without actually extending the model. Not yet, but I'd certainly be interested in working with you to arrange for that to be possible. I'd like to arrive at some type of mechanism whereby you'd not need dynamic templates nor a derived GenModel to achieve this goal. Obviously we'd need some type of APIs in the GenModel that would allow the generator templates to fetch the annotations needed for the class and for the generated methods (operations and feature accessors). I think you already have annotations on the Ecore model that you could interpret to produce the Java 5.0 annotations, so perhaps what's needed is some type of registry that allows folks to plugin such interpreters or maybe there's a GenModel property that lists the interpreters that should be invoked for the model; it could specify both the plugin ID and the class name. As I said, ideally I'd like to come up with something that does not require dynamic templates nor a derived GenModel because that seems heavy weight and it makes combining different extensions impossible. |