Provides a JSP based templating engine. The template looks like a JSP file, but the code written within the JSP tags can be JavaScript. An example template is given below:
/**
 * This is a test header - <%="hi there"%>
 * create on <%=new java.util.Date()%>
 */

public class TestClass {

  public void someOtherMethod<%="()"%>{
    <% for(i=0; i<10; i++) { %>
    System.out.println("hi there"); <%}%>
  }
}

Typical usage:

  Template template = new Template();

  //set up implicit variables
  template.setProperty("name", value);

  String templateFileName = ... //name of the template file
  String outputFile = ... //name of the file to the generated

  //exec the template
  template.exec(templateFileName, outputFile);

Package Specification

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see: