public class JsonpCharacterEscapes extends CharacterEscapes
CharacterEscapes
implementation that escapes
Unicode characters `0x2028` and `0x2029` (in addition to characters
escaped otherwise), which are apparently considered linefeeds as
per newer Javascript specifications, and consequently problematic
when using JSONP (see https://en.wikipedia.org/wiki/JSONP).ESCAPE_CUSTOM, ESCAPE_NONE, ESCAPE_STANDARD
Constructor and Description |
---|
JsonpCharacterEscapes() |
Modifier and Type | Method and Description |
---|---|
int[] |
getEscapeCodesForAscii()
Method generators can call to get lookup table for determining
escape handling for first 128 characters of Unicode (ASCII
characters.
|
SerializableString |
getEscapeSequence(int ch)
Method generators can call to get lookup table for determining
exact escape sequence to use for given character.
|
static JsonpCharacterEscapes |
instance() |
standardAsciiEscapesForJSON
public static JsonpCharacterEscapes instance()
public SerializableString getEscapeSequence(int ch)
CharacterEscapes
getEscapeSequence
in class CharacterEscapes
public int[] getEscapeCodesForAscii()
CharacterEscapes
getEscapeCodesForAscii
in class CharacterEscapes
ESCAPE_xxx
constants, or non-zero positive
integer (meaning of which is data format specific; for JSON it means
that combination of backslash and character with that value is to be used)
to indicate that specific escape sequence is to be used.Copyright © 2008-2017 FasterXML. All Rights Reserved.