Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » JET2 in emft project
JET2 in emft project [message #139039] Tue, 21 July 2009 09:30 Go to next message
gloria guitteaud is currently offline gloria guitteaudFriend
Messages: 14
Registered: July 2009
Junior Member
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.
Re: JET2 in emft project [message #139065 is a reply to message #139039] Tue, 21 July 2009 15:59 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33081
Registered: July 2009
Senior Member
Gloria,

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.
>
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: JET2 in emft project [message #621170 is a reply to message #139039] Tue, 21 July 2009 15:59 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33081
Registered: July 2009
Senior Member
Gloria,

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.
>
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Using workflow with GMF 2.2 for Xpand + QVTO
Next Topic:Porting M2T code generator from OAW to EMFT
Goto Forum:
  


Current Time: Sat Mar 02 03:56:47 GMT 2024

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

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

Back to the top