|Re: JET2 in emft project [message #64808]
||Tue, 21 July 2009 15:59
| Ed Merks
Registered: July 2009
It's best to ask about JET2 on the M2T newsgroup, which I've added to
the "to" list of the reply, so no need to repost.
gloria guitteaud wrote:
> Hello everybody,
> I am working with a DSL toolkit to develop plugins. I created a Jet
> Transformation project and I developed templates.
> The issue deals with the "generate" method of JET2. I haven't found
> yet a way to that method.
> In fact,in my project, I have a folder named "templates" that contains
> three files :dump.jet, main.jet and the template I developed. At
> saving that files, it autogenerates classes in a folder named "jet2java".
> I can run my template project by running the main.jet class by the
> 'run configuration' command in the popup menu of eclipse.
> Then, I would like to find a way to run that file without using the
> 'run configuration' command. I think that I must use the "generate"
> method of the class autogenerated from the main.jet template. That
> method requires two parameter: a JET2Context and a JET2Writer. At this
> time, I wrote the following code:("_jet_main" is the autogenerated class)
> _jet_main y = new _jet_main();
> JET2Context context = new JET2Context(null);
> context.setVariable("toto", y);
> JET2Writer out = new BodyContentWriter();
> y.generate(context, out);
> Running that code, I got a null pointer exception and a link to the
> "_jet_main" class at the following line:
> RuntimeTagElement _jettag_c_if_25_1 =
> context.getTagFactory().createRuntimeTag(_jetns_c, "if", "c:if",
> _td_c_if_25_1); //$NON-NLS-1$ //$NON-NLS-2$
> I don't really know how to use that "generate" method, but maybe I
> don't need it finally.
> The goal I want too reach is running the main.jet file dynamically, in
> a class.
> Thank's for helping me.
Powered by FUDForum
. Page generated in 0.01619 seconds