tags:

views:

406

answers:

2

Hi!

I need to run JET templates on a EMF model metadata - i.e. the model itself (not data) is input to my JET template.

More practically - I want generate non java code, based on EMF templates.

How I do it?

Thank you

A: 

I'm not sure I get you right, but you can pass your model just like any other object into the JET template (as described in the JET tutorial). Also, it makes no difference if you generate Java or any other text with JET. As an additional pointer, you might want to consider using Xpand (part of openArchitectureWare) for very comfortable model to text generation (including things like content assist for your model in the template editor).

Fabian Steeg
Can you provide me an example how I get a model as an object? Do you mean passing the package object to JET?
I'd imagined you'd pass some instance of the generated classes into the template, but Xpand or the solution suggested by Freddy are probably more reasonable anyway.
Fabian Steeg
A: 

For code generation, you could use Acceleo. That is like Xpand very comfortable model to text generation (Acceleo language is very intuitive for model browsing) and also less painful than JET.