freemarker.template.utility
Class NormalizeNewlines
java.lang.Object
freemarker.template.utility.NormalizeNewlines
- TemplateModel, TemplateTransformModel
public class NormalizeNewlines
extends java.lang.Object
Transformer that supports FreeMarker legacy behavior: all newlines appearing
within the transformed area will be transformed into the platform's default
newline. Unlike the old behavior, however, newlines generated by the data
model are also converted. Legacy behavior was to leave newlines in the
data model unaltered.
Usage:
From java:
SimpleHash root = new SimpleHash();
root.put( "normalizeNewlines", new freemarker.template.utility.NormalizeNewlines() );
...
From your FreeMarker template:
<transform normalizeNewlines>
<html>
<head>
...
<p>This template has all newlines normalized to the current platform's
default.</p>
...
</body>
</html>
</transform>
$Id: NormalizeNewlines.java,v 1.29 2003/04/11 20:57:32 revusky Exp $
Writer | getWriter(Writer out, Map args)
|
void | transform(Reader in, Writer out) - Performs newline normalization on FreeMarker output.
|
transform
public void transform(Reader in,
Writer out)
throws IOException
Performs newline normalization on FreeMarker output.
in
- the input to be transformedout
- the destination of the transformation