public class StringEscapeUtils extends Object
Escapes and unescapes Strings for
Java, Java Script, HTML, XML, and SQL.
#ThreadSafe#
| Constructor and Description |
|---|
StringEscapeUtils()
StringEscapeUtils instances should NOT be constructed in
standard programming. |
| Modifier and Type | Method and Description |
|---|---|
static String |
unescapeUnicode(String str)
Unescapes any Java literals found in the
String. |
static void |
unescapeUnicode(Writer out,
String str)
Unescapes any Java literals found in the
String to a
Writer. |
public StringEscapeUtils()
StringEscapeUtils instances should NOT be constructed in
standard programming.
Instead, the class should be used as:
StringEscapeUtils.escapeJava("foo");
This constructor is public to permit tools that require a JavaBean instance to operate.
public static String unescapeUnicode(String str)
Unescapes any Java literals found in the String.
For example, it will turn a sequence of '\' and
'n' into a newline character, unless the '\'
is preceded by another '\'.
str - the String to unescape, may be nullString, null if null string inputpublic static void unescapeUnicode(Writer out, String str) throws IOException
Unescapes any Java literals found in the String to a
Writer.
For example, it will turn a sequence of '\' and
'n' into a newline character, unless the '\'
is preceded by another '\'.
A null string input has no effect.
out - the Writer used to output unescaped charactersstr - the String to unescape, may be nullIllegalArgumentException - if the Writer is nullIOException - if error occurs on underlying WriterCopyright © 2018 Denim Group, Ltd.; Secure Decisions, A Division of Applied Visions, Inc.. All rights reserved.