type safe templating



Preprocesses Jamon templates to Java sources.

Templates under the specified src directory are translated into Java sources. The generated java source files are placed under the destdir directory. The directory structure underneath the src directory is preserved, and is used to place the generated Java sources in appropriate packages.


Attribute Description Required
destdir the target directory for generated Java files. Yes
srcdir the root directory for template sources. Yes
emitMode specifies the types allowed in emit directives. Standard (all)

Parameters specified as nested elements

This task forms an implicit FileSet and supports all attributes of <fileset> as well as the nested <include>, <exclude> and <patternset> elements. The files are searched for under the direcotry specified by the srcdir attribute.


<jamon destDir="tsrc" srcdir="wwwtemplates" />

creates Java sources for all of the templates in the wwwtemplates directory, putting generated sources into tsrc

<jamon destdir="tsrc" srcdir="templs">
  <exclude name="not/for/prod/**" />

creates Java sources for all of the templates in the templs directory, except those in the directory templs/not/for/prod. The sources are placed into the directory tree rooted at tsrc.