|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--freemarker.ext.misc.LegacyCompress
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", freemarker.ext.misc.LegacyCompress.getInstance() ); ...
From your FM-Classic template:
The following is compressed: <transform compressWhitespace> <p>This paragraph has all whitespace removed.</p> </transform> ...
Note:
LegacyCompress
is a singleton instance. Use the
getInstance()
method to retrieve instances of this model.
CompressWhitespace
Constructor Summary | |
LegacyCompress()
Deprecated. use the getInstance() method to avoid excessive
object creation |
Method Summary | |
static LegacyCompress |
getInstance()
Retrieve a singleton instance of this class. |
boolean |
isEmpty()
Is the object empty? |
void |
transform(java.io.Reader source,
java.io.Writer output)
Re-implementation of the <compress> FM-Classic tag. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LegacyCompress()
getInstance()
method to avoid excessive
object creation
Method Detail |
public static LegacyCompress getInstance()
LegacyCompress
classpublic void transform(java.io.Reader source, java.io.Writer output) throws java.io.IOException, TemplateModelException
transform
in interface TemplateTransformModel2
source
- the input to be transformedoutput
- the destination of the transformationpublic boolean isEmpty() throws TemplateModelException
isEmpty
in interface TemplateModel
false
, to indicate this object is not empty
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |