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 executed:
<transform compressWhitespace>
<p>This paragraph has all whitespace removed.</p>
</transform>
...
- Version:
- $Id: LegacyCompress.java,v 1.2 2001/05/29 11:54:10 run2000 Exp $
- See Also:
CompressWhitespace
|
Method Summary |
boolean |
isEmpty()
|
void |
transform(java.io.Reader source,
java.io.PrintWriter 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 |
LegacyCompress
public LegacyCompress()
- Creates new LegacyCompress
transform
public void transform(java.io.Reader source,
java.io.PrintWriter output)
throws TemplateModelException
- Re-implementation of the <compress> FreeMarker tag.
- Specified by:
transform in interface TemplateTransformModel
- Parameters:
source - the input to be transformedoutput - the destination of the transformation
isEmpty
public boolean isEmpty()
throws TemplateModelException
- Specified by:
isEmpty in interface TemplateModel
- Returns:
- true if this object is empty.