public class HTMLEscaper extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeToHTML(String text)
Convert a text by converting XML escaped characters to corresponding HTML entities.
|
static String |
escapeToXML(String text)
Convert a text with HTML entities to be usable in XML.
|
static String |
escapeToXML(String text,
boolean escapeSpecial)
Convert a text with HTML entities to be usable in XML.
|
static String |
escapeToXML(String text,
boolean escapeSpecial,
boolean toXMLEscape)
Convert a text with HTML entities to be usable in XML.
|
static String |
escapeXMLAttribute(String text)
Escape a text to be usable in XML attributes.
|
static String |
escapeXMLCDATA(String text)
Escape a text to be usable in XML CDATA.
|
static String |
escapeXMLToText(String text)
Convert a text with XML escaped characters to non-escaped text.
|
public static String escapeToXML(String text)
The é or è text will be converted to The é or è texttext - the textpublic static String escapeToXML(String text, boolean escapeSpecial)
The é or è text will be converted to The é or è texttext - the textescapeSpecial - true if the special XML characters (&, > and <) must be escapedpublic static String escapeToXML(String text, boolean escapeSpecial, boolean toXMLEscape)
toXMLEscape is true):
The é or è text will be converted to The é or è texttext - the textescapeSpecial - true if the special XML characters (&, > and <) must be escapedtoXMLEscape - true if non ASCII characters must be escaped with XML escape sequencespublic static String escapeXMLToText(String text)
text - the text with XML escaped characterspublic static String escapeXMLCDATA(String text)
text - the textpublic static String escapeXMLAttribute(String text)
text - the text