Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there something like .NET's T4 for Java?

I'm helping a friend develop a Java application. They are a non-MS shop.
I was tasked to write some repetitive code, so naturally as a .NET dev I thought of using T4.

But I'm stuck on Java/Eclipse (and no C# is allowed) so what are my options?
What do Java people use for code generation? Build tasks?

like image 206
chakrit Avatar asked Sep 03 '10 16:09

chakrit


2 Answers

Take a peek at Velocity's Texen engine, connected to an Ant task.

like image 140
samkass Avatar answered Sep 22 '22 02:09

samkass


You might also want to take a look at XText[1] and AndroMDA[2], both different from T4, but well suited to problems involving lots of repetitive-code.

[1] http://www.eclipse.org/Xtext/
[2] http://www.andromda.org/index.php

like image 32
ddimitrov Avatar answered Sep 26 '22 02:09

ddimitrov