java.lang.Object
tools.jackson.core.io.CharTypes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byte[]protected static final byte[]protected static final char[]protected static final char[]protected static final int[]Lookup table for the first 256 Unicode characters (ASCII / UTF-8) range.protected static final int[]Lookup table used for determining which input characters need special handling when contained in text segment.protected static final int[]Decoding table used to quickly determine characters that are relevant within comment content.protected static final int[]To support non-default (and non-standard) unquoted Object Property names mode, need to have alternate checking.protected static final int[]Additionally we can combine UTF-8 decoding info into similar data table.protected static final int[]This table is similar to Latin-1, except that it marks all "high-bit" code as ok.protected static final int[]Decoding table used for skipping white space and comments.protected static final int[]Lookup table used for determining which output characters in 7-bit ASCII range need to be quoted.protected static final int[]Lookup table same assOutputEscapes128NoSlashexcept that forward slash ('/') is also escaped -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendQuoted(StringBuilder sb, String content) Helper method for appending JSON-escaped version of contents into specificStringBuilder, using default JSON specification mandated minimum escaping rules.static intcharToHex(int ch) static byte[]copyHexBytes(boolean uppercase) static char[]copyHexChars(boolean uppercase) static int[]Accessor for getting a read-only encoding table for first 128 Unicode code points (single-byte UTF-8 characters).static int[]get7BitOutputEscapes(int quoteChar, boolean escapeSlash) Alternative toget7BitOutputEscapes()when either a non-standard quote character is used, or forward slash is to be escaped.static int[]static int[]static int[]static int[]static int[]static int[]static charhexToChar(int ch)
-
Field Details
-
HC
protected static final char[] HC -
HClower
protected static final char[] HClower -
HB
protected static final byte[] HB -
HBlower
protected static final byte[] HBlower -
sInputCodes
protected static final int[] sInputCodesLookup table used for determining which input characters need special handling when contained in text segment. -
sInputCodesUTF8
protected static final int[] sInputCodesUTF8Additionally we can combine UTF-8 decoding info into similar data table. -
sInputCodesJsNames
protected static final int[] sInputCodesJsNamesTo support non-default (and non-standard) unquoted Object Property names mode, need to have alternate checking. Basically this is list of 8-bit ASCII characters that are legal as part of Javascript identifier -
sInputCodesUtf8JsNames
protected static final int[] sInputCodesUtf8JsNamesThis table is similar to Latin-1, except that it marks all "high-bit" code as ok. They will be validated at a later point, when decoding name -
sInputCodesComment
protected static final int[] sInputCodesCommentDecoding table used to quickly determine characters that are relevant within comment content. -
sInputCodesWS
protected static final int[] sInputCodesWSDecoding table used for skipping white space and comments.- Since:
- 2.3
-
sOutputEscapes128NoSlash
protected static final int[] sOutputEscapes128NoSlashLookup table used for determining which output characters in 7-bit ASCII range need to be quoted. -
sOutputEscapes128WithSlash
protected static final int[] sOutputEscapes128WithSlashLookup table same assOutputEscapes128NoSlashexcept that forward slash ('/') is also escaped -
sHexValues
protected static final int[] sHexValuesLookup table for the first 256 Unicode characters (ASCII / UTF-8) range. For actual hex digits, contains corresponding value; for others -1.NOTE: before 2.10.1, was of size 128, extended for simpler handling
-
-
Constructor Details
-
CharTypes
public CharTypes()
-
-
Method Details
-
getInputCodeLatin1
public static int[] getInputCodeLatin1() -
getInputCodeUtf8
public static int[] getInputCodeUtf8() -
getInputCodeLatin1JsNames
public static int[] getInputCodeLatin1JsNames() -
getInputCodeUtf8JsNames
public static int[] getInputCodeUtf8JsNames() -
getInputCodeComment
public static int[] getInputCodeComment() -
getInputCodeWS
public static int[] getInputCodeWS() -
get7BitOutputEscapes
public static int[] get7BitOutputEscapes()Accessor for getting a read-only encoding table for first 128 Unicode code points (single-byte UTF-8 characters). Value of 0 means "no escaping"; other positive values that value is character to use after backslash; and negative values that generic (backslash - u) escaping is to be used.- Returns:
- 128-entry
int[]that contains escape definitions
-
get7BitOutputEscapes
public static int[] get7BitOutputEscapes(int quoteChar, boolean escapeSlash) Alternative toget7BitOutputEscapes()when either a non-standard quote character is used, or forward slash is to be escaped.- Parameters:
quoteChar- Character used for quoting textual values and property names; usually double-quote but sometimes changed to single-quote (apostrophe)escapeSlash- Whether forward slash ("/") is escaped by default or not.- Returns:
- 128-entry
int[]that contains escape definitions - Since:
- 2.17
-
charToHex
public static int charToHex(int ch) -
hexToChar
public static char hexToChar(int ch) -
appendQuoted
Helper method for appending JSON-escaped version of contents into specificStringBuilder, using default JSON specification mandated minimum escaping rules.- Parameters:
sb- Buffer to append escaped contents incontent- Unescaped String value to append with escaping applied
-
copyHexChars
public static char[] copyHexChars(boolean uppercase) -
copyHexBytes
public static byte[] copyHexBytes(boolean uppercase)
-