org.howardism.ant
Class StringTemplatePlugin

java.lang.Object
  extended byorg.howardism.ant.StringTemplatePlugin
All Implemented Interfaces:
WebTemplatePlugin

public class StringTemplatePlugin
extends java.lang.Object
implements WebTemplatePlugin

This plugin to the WebTemplate Ant task interface the StringTemplate engine.

It is assumed that the template file name should be specified as a name only and without the .st extension. However, the file itself must end with .st for the StringTemplate engine to pick it up.

See www.StringTemplate.org for details and documentation for how the templates should be written.

See Also:
WebTemplate

Constructor Summary
StringTemplatePlugin()
           
 
Method Summary
 void convert(java.io.File srcParent, java.io.File destFile, java.lang.String template, java.util.Properties attributes)
          Converts a single file using the template engine.
 void setParent(org.apache.tools.ant.Task parent)
          Allows the WebTemplate task to pass the plugin a reference to the Parent (the caller) so that it can send it log messages.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTemplatePlugin

public StringTemplatePlugin()
Method Detail

convert

public void convert(java.io.File srcParent,
                    java.io.File destFile,
                    java.lang.String template,
                    java.util.Properties attributes)
             throws org.apache.tools.ant.BuildException
Converts a single file using the template engine.

The parameters include the source data file and the template as well as the destination file where the resulting converted file will be written by this method.

Specified by:
convert in interface WebTemplatePlugin
Parameters:
srcParent - name of the input file's parent for locating the template file.
destFile - name of the destination file.
template - name of the template file
attributes - A java.util.Properties file that contains the data and content
Throws:
org.apache.tools.ant.BuildException

setParent

public void setParent(org.apache.tools.ant.Task parent)
Description copied from interface: WebTemplatePlugin
Allows the WebTemplate task to pass the plugin a reference to the Parent (the caller) so that it can send it log messages.

Specified by:
setParent in interface WebTemplatePlugin
Parameters:
parent -