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 #621168] Tue, 21 July 2009 09:30
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.
Previous Topic:Generating diagram code in build process
Next Topic:Using workflow with GMF 2.2 for Xpand + QVTO
Goto Forum:
  


Current Time: Sat Apr 20 03:02:13 GMT 2024

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

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

Back to the top