freemarker.testcase.models
Class TransformModel2

java.lang.Object
  extended by freemarker.testcase.models.TransformModel2
All Implemented Interfaces:
TemplateModel, TemplateTransformModel2

public final class TransformModel2
extends java.lang.Object
implements TemplateTransformModel2

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: TransformModel2.java 1003 2004-10-16 14:54:58Z run2000 $

Constructor Summary
TransformModel2()
          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.Writer 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

TransformModel2

public TransformModel2()
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.Writer output)
               throws java.io.IOException,
                      TemplateModelException
Performs a transformation/filter on FM-Classic output.

Specified by:
transform in interface TemplateTransformModel2
Parameters:
source - the input to be transformed
output - the destination of the transformation
Throws:
java.io.IOException
TemplateModelException

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
Throws:
TemplateModelException