|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.velocity.tools.generic.EscapeTool
org.xwiki.velocity.tools.EscapeTool
public class EscapeTool
Tool for working with escaping in Velocity templates. It provides methods to escape outputs for Velocity, Java, JavaScript, HTML, XML and SQL.
Extends the default EscapeTool from velocity-tools since the XML escape performed by it doesn't work inside HTML
content, since apos is not a valid HTML entity name, and it always escapes non-ASCII characters, which
increases the HTML length considerably, while also making the source unreadable.
| Constructor Summary | |
|---|---|
EscapeTool()
|
|
| Method Summary | |
|---|---|
String |
b(Object content)
Encode a text using the B encoding specified in RFC 2047. |
String |
q(Object content)
Encode a text using the Q encoding specified in RFC 2047. |
String |
quotedPrintable(Object content)
Encode a text using the Quoted-Printable format, as specified in section 6.7 of RFC 2045. |
String |
url(Map<String,?> parametersMap)
Properly escape a parameter map representing a query string, so that it can be safely used in an URL. |
String |
xml(Object content)
Escapes the XML special characters in a String using numerical XML entities. |
| Methods inherited from class org.apache.velocity.tools.generic.EscapeTool |
|---|
dumpString, getB, getBackslash, getD, getDollar, getE, getExclamation, getH, getHash, getQ, getQuote, getS, getSingleQuote, html, java, javascript, propertyKey, propertyValue, sql, url |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EscapeTool()
| Method Detail |
|---|
public String xml(Object content)
String using numerical XML entities.
xml in class org.apache.velocity.tools.generic.EscapeToolcontent - the text to escape, may be null
String, null if null inputpublic String quotedPrintable(Object content)
content - the text to encode
public String q(Object content)
=?UTF-8?Q? and ending with ?=.
content - the text to encode
public String b(Object content)
=?UTF-8?B? and ending with ?=.
content - the text to encode
public String url(Map<String,?> parametersMap)
Collection. If the
parameter name is null (the key is null) then the parameter is ignored. null values are
serialized as an empty string.
parametersMap - Map representing the query string.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||