freemarker.template.utility
Class LegacyCompress

java.lang.Object
  |
  +--freemarker.template.utility.LegacyCompress
All Implemented Interfaces:
TemplateModel, TemplateTransformModel

public class LegacyCompress
extends java.lang.Object
implements TemplateTransformModel

A re-implementation of the <compress> template instruction as a TemplateTransformModel. This implementation behaves exactly the same way as the compress tag.

Usage:
From java:

 TemplateModelRoot root = new SimpleHash();

 root.put( "compressWhitespace", new freemarker.template.utility.LegacyCompress() );

 ...
 

From your FreeMarker template:


 The following is compressed:
 <transform compressWhitespace>
   <p>This paragraph has all whitespace removed.</p>
 </transform>

 ...
 

Version:
$Id: LegacyCompress.java,v 1.6 2002/03/09 20:57:05 revusky Exp $
See Also:
CompressWhitespace

Constructor Summary
LegacyCompress()
          Creates new LegacyCompress
 
Method Summary
 boolean isEmpty()
           
 void transform(java.io.Reader source, java.io.Writer output)
          Re-implementation of the <compress> FreeMarker tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegacyCompress

public LegacyCompress()
Creates new LegacyCompress
Method Detail

transform

public void transform(java.io.Reader source,
                      java.io.Writer output)
               throws TemplateModelException
Re-implementation of the <compress> FreeMarker tag.
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
Specified by:
isEmpty in interface TemplateModel
Returns:
true if this object is empty.