Questions tagged [eclipse-m2t-jet]

*Java Emitter Templates* (JET) is an Eclipse framework that can generate Eclipse resources (projects, folders and files) from an input model. It is part of the *Model To Text* project (M2T).

Java Emitter Templates (JET) is an Eclipse framework that can generate Eclipse resources (projects, folders and files) from an input model. It is part of the Model To Text project (M2T).

Most popular use is for code generation (model-to-text), but it can be used to convert any model-based input to any output (model-to-model). The models currently supported include XML, EMF and the current Eclipse workspace resource hierarchy. It is possible to add custom loaders to use other input formats with the framework.

A JET transform consists of a collection of text templates. One template, usually called main.jet, acts as the controller template for the transform. The controller template doesn't produce any Eclipse files directly, but it does create projects, folders and files through the application of other templates to the model.

Questions related to the M2T-JET framework should use this tag.

For more information on the Eclipse M2T JET framework:

10 questions
5
votes
2 answers

Generating Java code from XML in Eclipse

I am working on a project that will have several Java classes that are very similar to each other, and that I would like to generate from XML files. What I would like to be able to do is change the Eclipse build process to do something like…
Kevin Lacquement
  • 5,057
  • 3
  • 25
  • 30
4
votes
1 answer

Using JET to generate code: Indenting code

I'm trying to do the following: Write a JET template that receives an object of type Class as argument. The object should represent a Java interface. The template generates a class that implements the interface, i.e. provides methods for all…
Jigglypuff
  • 1,433
  • 6
  • 24
  • 38
4
votes
3 answers

Code generation in Eclipse

What is the most useful code generation tool in eclipse, velocity or jet templates? Anybody has experience with both of them and know the pro and cons?
fastcodejava
  • 39,895
  • 28
  • 133
  • 186
4
votes
2 answers

Use Xtext or XTend to build code generator for existing EMF Model

I have a transformation sequence of models that eventually outputs an EMF model, instance of some EMF Meta model (the meta model I defined myself). I am looking for a good way to generate code from this. Of course, there is XPand, I used to use…
Marten Sytema
  • 1,906
  • 3
  • 21
  • 29
3
votes
2 answers

Run JET Templates without Eclipse

I need to generate java code from jet templates using a maven project and it should be done outside eclipse environment, but so far i haven't figure out how to do this. I'm using maven 3x and jet 1.1.x. I've tried several approaches but none of them…
2
votes
1 answer

How to make the source directory visible in Eclipse M2T JET projects?

I just started to play around with Eclipse M2T JET2. Now I noticed that the jet2java directory, containing the generated Java sources, is hidden in my workspace. Also, when I create a src directory, it is hidden... Now I was wondering whether there…
Veger
  • 37,240
  • 11
  • 105
  • 116
2
votes
1 answer

How to use Java Emitter Template (JET) to generate Java code from a a .xmi file created based on an EMF model

So, here is my problem, I have an Eclipse EMF project, and i have built a model, generated the corresponding code, and also programmed some framework classes by hand, that correspond to the model. I have used the eclipse wizard to adapt the project…
Luis Miguel Serrano
  • 5,029
  • 2
  • 41
  • 41
0
votes
1 answer

Is it possible to call a JET file within another JET file? If so please explain how it can be done

I have a JET file generating a C++ file. I want to generate various C++ files out of a single JET file.The single jet file should call other JET files within it. Is it possible?
0
votes
1 answer

Possibility of more then one xml input to jet?

Can we give more then one xml input to jet(java emitter template)? If we can, then please give me an example.
yogi
  • 21
  • 3
0
votes
2 answers

Using JET with EMF

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
Pavel Bernshtam
  • 4,232
  • 8
  • 38
  • 62