|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.ext.misc.HtmlEscape
public final class HtmlEscape
Performs an HTML escape of a given template fragment. Specifically, < > " and & are all turned into entities.
Usage:
From java:
TemplateModelRoot root = new SimpleHash(); root.put( "htmlEscape", freemarker.ext.misc.HtmlEscape.getInstance() ); ...
From your FM-Classic template:
The following is HTML-escaped: <transform htmlEscape> <p>This paragraph has all HTML special characters escaped.</p> </transform> ...
Note:
HtmlEscape is a singleton instance. Use the
getInstance() method to retrieve instances of this model.
XmlEscape,
Serialized Form| Method Summary | |
|---|---|
static HtmlEscape |
getInstance()
Retrieve a singleton instance of this class. |
boolean |
isEmpty()
Is the object empty? |
void |
transform(java.io.Reader source,
java.io.Writer output)
Transforms an HTML-unescaped stream into HTML-escaped form. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static HtmlEscape getInstance()
HtmlEscape class
public void transform(java.io.Reader source,
java.io.Writer output)
throws java.io.IOException,
TemplateModelException
transform in interface TemplateTransformModel2source - the input to be transformedoutput - the destination of the transformation
java.io.IOException
TemplateModelException
public boolean isEmpty()
throws TemplateModelException
isEmpty in interface TemplateModelfalse, to indicate this object is not empty
TemplateModelException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||