generj
version 0.1 in download
Overview
A java to java source code generator. Use a fluent java description to generate java source code.
The original idea was to ease the java code generation in stjx. This also the place to look for more examples.
An easy one:
Clazz hr = new Clazz("org.open.hello",
TYP("HelloWorld")).
publc().sttic().method( VOID, "main" ).
arg( Typ.array( "String" ), "args" ).
body().
call( DOT( NAME("System"), NAME("out"), NAME("println")),
STR("Hello World\\n")).r().c();
hr.toString();
produces:
package org.open.hello;
public class HelloWorld {
public static void main( String ... args ){
System.out.println( "Hello World\n" );
}
}
Plan
The first releases is targeted for stjx. If anybody is interested in further development generj will develop as independent project.
page revision: 10, last edited: 06 Sep 2010 07:31