The Text Transformation Model

The TemplateTransformModel allows FreeMarker templates to perform text transformations on any portion of a template. The signature of a TemplateTransformModel is below:

public void transform(Reader source, Writer output)
                    throws TemplateModelException, IOException;
        

The two arguments in the method define the input and output for the transformation. Unlike other model interfaces, this method does not return a TemplateModel.

The interface allows both input and output to be arbirarily long. Implementing classes may want to perform buffering on the input to maximize speed. The input and output may also be adapted to suit other systems, such as an XML parser or XSL transformation engine.