freemarker.testcase.models
Class TransformModel1

java.lang.Object
  |
  +--freemarker.testcase.models.TransformModel1
All Implemented Interfaces:
TemplateModel, TemplateTransformModel

public final class TransformModel1
extends java.lang.Object
implements TemplateTransformModel

A TemplateTransformModel that includes properties. These properties can be set at model construction time, or, for the purposes of this demonstration, can be passed in from a wrapper TemplateMethodModel.

Version:
$Id: TransformModel1.java,v 1.12 2003/11/08 01:44:26 run2000 Exp $

Constructor Summary
TransformModel1()
          Creates new TransformModel1
 
Method Summary
 boolean isEmpty()
          Is the model empty?
 void setAmpersands(boolean bAmpersands)
          Indicates whether we escape ampersands.
 void setComment(java.lang.String aComment)
          Sets a comment for this transformation.
 void setQuotes(boolean bQuotes)
          Indicates whether we escape quotes.
 void setTags(boolean bTags)
          Indicates whether we escape tags.
 void transform(java.io.Reader source, java.io.PrintWriter output)
          Performs a transformation/filter on FM-Classic output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformModel1

public TransformModel1()
Creates new TransformModel1
Method Detail

setAmpersands

public void setAmpersands(boolean bAmpersands)
Indicates whether we escape ampersands. This property can be set either while the model is being constructed, or via a property passed in through a TemplateMethodModel.
Parameters:
bAmpersands - should ampersand characters be escaped?

setQuotes

public void setQuotes(boolean bQuotes)
Indicates whether we escape quotes. This property can be set either while the model is being constructed, or via a property passed in through a TemplateMethodModel.
Parameters:
bQuotes - should quote characters be escaped?

setTags

public void setTags(boolean bTags)
Indicates whether we escape tags. This property can be set either while the model is being constructed, or via a property passed in through a TemplateMethodModel.
Parameters:
bTags - should tags be escaped?

setComment

public void setComment(java.lang.String aComment)
Sets a comment for this transformation. This property can be set either while the model is being constructed, or via a property passed in through a TemplateMethodModel.
Parameters:
aComment - the text to be used in place of '*' characters

transform

public void transform(java.io.Reader source,
                      java.io.PrintWriter output)
               throws java.io.IOException,
                      TemplateModelException
Performs a transformation/filter on FM-Classic output.
Specified by:
transform in interface TemplateTransformModel
Parameters:
source - the input to be transformed
output - the destination of the transformation

isEmpty

public boolean isEmpty()
                throws TemplateModelException
Is the model empty?
Specified by:
isEmpty in interface TemplateModel
Returns:
false to indicate the model is not empty