public final class SourceCodeEscapers
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static char[] |
HEX_DIGITS |
private static com.google.common.escape.Escaper |
JAVASCRIPT_ESCAPER
An Escaper for javascript strings.
|
private static char |
PRINTABLE_ASCII_MAX |
private static char |
PRINTABLE_ASCII_MIN |
Modifier | Constructor and Description |
---|---|
private |
SourceCodeEscapers() |
Modifier and Type | Method and Description |
---|---|
private static char[] |
asUnicodeHexEscape(char c) |
static com.google.common.escape.Escaper |
javascriptEscaper()
Returns an
Escaper instance that replaces non-ASCII characters
in a string with their equivalent Javascript UTF-16 escape sequences
"\unnnn", "\xnn" or special replacement sequences "\b", "\t",
"\n", "\f", "\r" or "\\". |
private static final char PRINTABLE_ASCII_MIN
private static final char PRINTABLE_ASCII_MAX
private static final char[] HEX_DIGITS
private static final com.google.common.escape.Escaper JAVASCRIPT_ESCAPER
public static com.google.common.escape.Escaper javascriptEscaper()
Escaper
instance that replaces non-ASCII characters
in a string with their equivalent Javascript UTF-16 escape sequences
"\unnnn", "\xnn" or special replacement sequences "\b", "\t",
"\n", "\f", "\r" or "\\".
Warning: This escaper is not suitable for JSON. JSON users may wish to use GSON or other high-level APIs when possible.
private static char[] asUnicodeHexEscape(char c)