public abstract class JSONReader
extends java.lang.Object
implements java.io.Closeable
JSONReader supports multiple input sources including strings, byte arrays, streams, and readers. It also supports different character encodings such as UTF-8, UTF-16, and ASCII.
Example usage:
String json = "{\"name\":\"John\", \"age\":30}";
try (JSONReader reader = JSONReader.of(json)) {
JSONObject obj = reader.readObject();
String name = (String) obj.get("name");
Integer age = (Integer) obj.get("age");
}
| Modifier and Type | Class and Description |
|---|---|
static interface |
JSONReader.AutoTypeBeforeHandler |
(package private) static class |
JSONReader.BigIntegerCreator |
static class |
JSONReader.Context
Context holds the configuration and state information for JSON reading operations.
|
static class |
JSONReader.Feature
Feature is used to control the behavior of JSON reading and parsing in FASTJSON2.
|
(package private) static class |
JSONReader.ResolveTask |
static class |
JSONReader.SavePoint |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
boolValue |
protected char |
ch |
(package private) static byte[] |
CHAR1_ESCAPED |
protected boolean |
comma |
protected java.lang.Object |
complex |
protected JSONReader.Context |
context |
protected byte[] |
doubleChars |
(package private) static char |
EOI |
protected short |
exponent |
(package private) static boolean[] |
INT_VALUE_END |
(package private) static byte |
JSON_TYPE_ARRAY |
(package private) static byte |
JSON_TYPE_BIG_DEC |
(package private) static byte |
JSON_TYPE_BOOL |
(package private) static byte |
JSON_TYPE_DEC |
(package private) static byte |
JSON_TYPE_DOUBLE |
(package private) static byte |
JSON_TYPE_FLOAT |
(package private) static byte |
JSON_TYPE_INT |
(package private) static byte |
JSON_TYPE_INT16 |
(package private) static byte |
JSON_TYPE_INT64 |
(package private) static byte |
JSON_TYPE_INT8 |
(package private) static byte |
JSON_TYPE_NaN |
(package private) static byte |
JSON_TYPE_NULL |
(package private) static byte |
JSON_TYPE_OBJECT |
(package private) static byte |
JSON_TYPE_STRING |
boolean |
jsonb |
protected int |
level |
protected int |
mag0 |
protected int |
mag1 |
protected int |
mag2 |
protected int |
mag3 |
protected static long |
MASK_ALLOW_UN_QUOTED_FIELD_NAMES |
protected static long |
MASK_DISABLE_REFERENCE_DETECT |
protected static long |
MASK_DISABLE_SINGLE_QUOTE |
protected static long |
MASK_EMPTY_STRING_AS_NULL |
protected static long |
MASK_ERROR_ON_NONE_SERIALIZABLE |
protected static long |
MASK_FIELD_BASED |
protected static long |
MASK_IGNORE_NONE_SERIALIZABLE |
protected static long |
MASK_INIT_STRING_FIELD_AS_EMPTY |
protected static long |
MASK_SUPPORT_ARRAY_TO_BEAN |
protected static long |
MASK_SUPPORT_AUTO_TYPE |
protected static long |
MASK_SUPPORT_SMART_MATCH |
protected static long |
MASK_TRIM_STRING |
(package private) static int |
MAX_EXP |
(package private) static int |
MAX_NUMBER_DIGITS |
protected int |
nameBegin |
protected boolean |
nameEscape |
protected boolean |
negative |
protected int |
offset |
(package private) java.util.List<JSONReader.ResolveTask> |
resolveTasks |
protected short |
scale |
(package private) static long |
SPACE |
protected java.lang.String |
stringValue |
protected boolean |
typeRedirect |
boolean |
utf8 |
protected boolean |
valueEscape |
protected byte |
valueType |
protected boolean |
wasNull |
| Constructor and Description |
|---|
JSONReader(JSONReader.Context context,
boolean jsonb,
boolean utf8)
Constructs a new JSONReader with the specified context and configuration.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
add(java.util.List<java.lang.Object> list,
int i,
java.lang.Object val) |
void |
addResolveTask(java.util.Collection object,
int i,
JSONPath reference) |
void |
addResolveTask(FieldReader fieldReader,
java.lang.Object object,
JSONPath path) |
void |
addResolveTask(java.util.Map object,
java.lang.Object key,
JSONPath reference) |
void |
addResolveTask(java.lang.Object[] object,
int i,
JSONPath reference) |
static JSONReader.AutoTypeBeforeHandler |
autoTypeFilter(boolean includeBasic,
java.lang.Class... types) |
static JSONReader.AutoTypeBeforeHandler |
autoTypeFilter(boolean includeBasic,
java.lang.String... names) |
static JSONReader.AutoTypeBeforeHandler |
autoTypeFilter(java.lang.Class... types) |
static JSONReader.AutoTypeBeforeHandler |
autoTypeFilter(java.lang.String... names) |
(package private) void |
bigInt(byte[] chars,
int off,
int len) |
(package private) void |
bigInt(char[] chars,
int off,
int len) |
(package private) char |
char1(int c) |
protected JSONException |
char1Error(int c) |
(package private) static char |
char2(int c1,
int c2) |
ObjectReader |
checkAutoType(java.lang.Class expectClass,
long expectClassHash,
long features)
Checks the auto type for the specified class and hash, considering additional features.
|
(package private) boolean |
checkNameBegin(int quote) |
abstract void |
close() |
char |
current()
Gets the current character being processed by the reader.
|
protected java.math.BigDecimal |
decimal(JSONObject object) |
void |
endArray()
Advances the reader to the end of the current JSON array.
|
(package private) JSONException |
error() |
(package private) JSONException |
error(int offset,
int ch) |
(package private) JSONException |
error(java.lang.String message) |
(package private) JSONException |
error(java.lang.String message,
java.lang.Exception cause) |
(package private) JSONException |
error(java.lang.String message,
int ch) |
void |
errorOnNoneSerializable(java.lang.Class objectClass)
Throws a JSONException if the specified class is not serializable and the
ErrorOnNoneSerializable feature is enabled.
|
long |
features(long features)
Combines the context features with the specified additional features.
|
java.math.BigDecimal |
getBigDecimal() |
java.math.BigInteger |
getBigInteger() |
JSONReader.Context |
getContext()
Gets the reading context for this JSONReader.
|
double |
getDoubleValue() |
abstract java.lang.String |
getFieldName()
Gets the current field name in a JSON object.
|
float |
getFloatValue() |
int |
getInt32Value() |
long |
getInt64Value() |
java.util.Locale |
getLocale()
Gets the locale used for parsing in this JSONReader.
|
abstract long |
getNameHashCodeLCase()
Reads the hash code of the current field name in lowercase.
|
java.lang.Number |
getNumber() |
ObjectReader |
getObjectReader(java.lang.reflect.Type type)
Gets an ObjectReader for the specified type from the context's provider.
|
ObjectReader |
getObjectReaderAutoType(long typeHash,
java.lang.Class expectClass,
long features)
Gets an ObjectReader for the specified type hash, expected class, and features.
|
int |
getOffset() |
abstract int |
getRawInt()
Gets the raw integer value from the current position in the JSON data.
|
abstract long |
getRawLong()
Gets the raw long value from the current position in the JSON data.
|
abstract java.lang.String |
getString()
Gets the current string value from the JSON data.
|
protected abstract int |
getStringLength()
Gets the length of the current string value in the JSON data.
|
byte |
getType()
Gets the type of the current JSON value.
|
java.time.ZoneId |
getZoneId()
Gets the zone ID used for date/time parsing in this JSONReader.
|
void |
handleResolveTasks(java.lang.Object root)
Handles resolve tasks for circular references in the JSON data.
|
boolean |
hasAutoTypeBeforeHandler()
Checks if there is an auto-type before handler configured in the context.
|
boolean |
hasComma()
Checks if the reader has encountered a comma.
|
java.lang.String |
info() |
java.lang.String |
info(java.lang.String message) |
boolean |
isArray()
Checks if the current character represents the start of a JSON array.
|
boolean |
isBinary()
Checks if the current value represents binary data.
|
boolean |
isBool()
Checks if the current character represents the start of a JSON boolean.
|
boolean |
isDate()
Checks if the current value represents a date.
|
boolean |
isEnabled(JSONReader.Feature feature)
Checks if a specific feature is enabled in the reading context.
|
boolean |
isEnd()
Checks if the reader has reached the end of the input.
|
(package private) static boolean |
isFirstIdentifier(int ch) |
boolean |
isIgnoreNoneSerializable()
Checks if the IgnoreNoneSerializable feature is enabled in the context.
|
boolean |
isInitStringFieldAsEmpty()
Checks if the InitStringFieldAsEmpty feature is enabled in the context.
|
boolean |
isInt()
Checks if the current character represents the start of an integer value.
|
boolean |
isJSONB()
Checks if this reader is using JSONB binary format.
|
abstract boolean |
isNull()
Checks if the current JSON value is null.
|
boolean |
isNumber()
Checks if the current character represents the start of a JSON number.
|
boolean |
isObject()
Checks if the current character represents the start of a JSON object.
|
abstract boolean |
isReference()
Checks if the current value represents a reference.
|
boolean |
isString()
Checks if the current character represents the start of a JSON string.
|
boolean |
isSupportAutoType(long features)
Checks if the SupportAutoType feature is enabled, considering additional features.
|
boolean |
isSupportAutoTypeOrHandler(long features)
Checks if the SupportAutoType feature or handler is enabled, considering additional features.
|
boolean |
isSupportBeanArray()
Checks if the SupportArrayToBean feature is enabled in the context.
|
boolean |
isSupportBeanArray(long features)
Checks if the SupportArrayToBean feature is enabled, considering additional features.
|
boolean |
isSupportSmartMatch()
Checks if the SmartMatch feature is enabled in the context.
|
boolean |
isSupportSmartMatch(long features)
Checks if the SmartMatch feature is enabled, considering additional features.
|
boolean |
isTypeRedirect()
Checks if type redirection is enabled for this reader.
|
JSONReader.SavePoint |
mark() |
protected static int |
newCapacity(int minCapacity,
int oldCapacity) |
abstract void |
next()
Advances the reader to the next character in the JSON data.
|
abstract boolean |
nextIfArrayEnd()
Checks if the current character is the end of a JSON array (']') and advances the reader if it is.
|
abstract boolean |
nextIfArrayStart()
Checks if the current character is the start of a JSON array ('[') and advances the reader if it is.
|
abstract boolean |
nextIfComma()
Checks if the current character is a comma (',') and advances the reader if it is.
|
abstract boolean |
nextIfInfinity()
Checks if the current value represents infinity and advances the reader if it is.
|
boolean |
nextIfMatch(byte type)
Checks if the next value matches the specified type and advances the reader if it does.
|
abstract boolean |
nextIfMatch(char ch)
Checks if the current character matches the specified character and advances the reader if it does.
|
abstract boolean |
nextIfMatchIdent(char c0,
char c1) |
abstract boolean |
nextIfMatchIdent(char c0,
char c1,
char c2) |
abstract boolean |
nextIfMatchIdent(char c0,
char c1,
char c2,
char c3) |
abstract boolean |
nextIfMatchIdent(char c0,
char c1,
char c2,
char c3,
char c4) |
abstract boolean |
nextIfMatchIdent(char c0,
char c1,
char c2,
char c3,
char c4,
char c5) |
boolean |
nextIfMatchTypedAny()
Checks if the next value matches any type and advances the reader if it does.
|
abstract boolean |
nextIfName4Match10(long name1)
Checks if the next field name matches a 10-character pattern.
|
abstract boolean |
nextIfName4Match11(long name1)
Checks if the next field name matches an 11-character pattern.
|
abstract boolean |
nextIfName4Match12(long name1,
byte name2)
Checks if the next field name matches a 12-character pattern.
|
abstract boolean |
nextIfName4Match13(long name1,
int name2)
Checks if the next field name matches a 13-character pattern.
|
boolean |
nextIfName4Match14(long name1,
int name2)
Checks if the next field name matches a 14-character pattern.
|
boolean |
nextIfName4Match15(long name1,
int name2)
Checks if the next field name matches a 15-character pattern.
|
abstract boolean |
nextIfName4Match16(long name1,
int name2,
byte name3)
Checks if the next field name matches a 16-character pattern.
|
abstract boolean |
nextIfName4Match17(long name1,
long name2)
Checks if the next field name matches a 17-character pattern.
|
abstract boolean |
nextIfName4Match18(long name1,
long name2)
Checks if the next field name matches an 18-character pattern.
|
boolean |
nextIfName4Match19(long name1,
long name2)
Checks if the next field name matches a 19-character pattern.
|
abstract boolean |
nextIfName4Match2()
Checks if the next field name matches a 2-character pattern.
|
abstract boolean |
nextIfName4Match20(long name1,
long name2,
byte name3)
Checks if the next field name matches a 20-character pattern.
|
boolean |
nextIfName4Match21(long name1,
long name2,
int name3)
Checks if the next field name matches a 21-character pattern.
|
abstract boolean |
nextIfName4Match22(long name1,
long name2,
int name3)
Checks if the next field name matches a 22-character pattern.
|
abstract boolean |
nextIfName4Match23(long name1,
long name2,
int name3)
Checks if the next field name matches a 23-character pattern.
|
abstract boolean |
nextIfName4Match24(long name1,
long name2,
int name3,
byte name4)
Checks if the next field name matches a 24-character pattern.
|
abstract boolean |
nextIfName4Match25(long name1,
long name2,
long name3)
Checks if the next field name matches a 25-character pattern.
|
abstract boolean |
nextIfName4Match26(long name1,
long name2,
long name3)
Checks if the next field name matches a 26-character pattern.
|
abstract boolean |
nextIfName4Match27(long name1,
long name2,
long name3)
Checks if the next field name matches a 27-character pattern.
|
abstract boolean |
nextIfName4Match28(long name1,
long name2,
long name3,
byte c28)
Checks if the next field name matches a 28-character pattern.
|
abstract boolean |
nextIfName4Match29(long name1,
long name2,
long name3,
int name4)
Checks if the next field name matches a 29-character pattern.
|
abstract boolean |
nextIfName4Match3()
Checks if the next field name matches a 3-character pattern.
|
abstract boolean |
nextIfName4Match30(long name1,
long name2,
long name3,
int name4)
Checks if the next field name matches a 30-character pattern.
|
abstract boolean |
nextIfName4Match31(long name1,
long name2,
long name3,
int name4)
Checks if the next field name matches a 31-character pattern.
|
abstract boolean |
nextIfName4Match32(long name1,
long name2,
long name3,
int name4,
byte c32)
Checks if the next field name matches a 32-character pattern.
|
abstract boolean |
nextIfName4Match33(long name1,
long name2,
long name3,
long name4)
Checks if the next field name matches a 33-character pattern.
|
abstract boolean |
nextIfName4Match34(long name1,
long name2,
long name3,
long name4)
Checks if the next field name matches a 34-character pattern.
|
abstract boolean |
nextIfName4Match35(long name1,
long name2,
long name3,
long name4)
Checks if the next field name matches a 35-character pattern.
|
abstract boolean |
nextIfName4Match36(long name1,
long name2,
long name3,
long name4,
byte c35)
Checks if the next field name matches a 36-character pattern.
|
abstract boolean |
nextIfName4Match37(long name1,
long name2,
long name3,
long name4,
int name5)
Checks if the next field name matches a 37-character pattern.
|
abstract boolean |
nextIfName4Match38(long name1,
long name2,
long name3,
long name4,
int name5)
Checks if the next field name matches a 38-character pattern.
|
abstract boolean |
nextIfName4Match39(long name1,
long name2,
long name3,
long name4,
int name5)
Checks if the next field name matches a 39-character pattern.
|
abstract boolean |
nextIfName4Match4(byte c4)
Checks if the next field name matches a 4-character pattern.
|
abstract boolean |
nextIfName4Match40(long name1,
long name2,
long name3,
long name4,
int name5,
byte c40)
Checks if the next field name matches a 40-character pattern.
|
abstract boolean |
nextIfName4Match41(long name1,
long name2,
long name3,
long name4,
long name5)
Checks if the next field name matches a 41-character pattern.
|
abstract boolean |
nextIfName4Match42(long name1,
long name2,
long name3,
long name4,
long name5)
Checks if the next field name matches a 42-character pattern.
|
abstract boolean |
nextIfName4Match43(long name1,
long name2,
long name3,
long name4,
long name5)
Checks if the next field name matches a 43-character pattern.
|
abstract boolean |
nextIfName4Match5(int name1)
Checks if the next field name matches a 5-character pattern.
|
abstract boolean |
nextIfName4Match6(int name1)
Checks if the next field name matches a 6-character pattern.
|
abstract boolean |
nextIfName4Match7(int name1)
Checks if the next field name matches a 7-character pattern.
|
abstract boolean |
nextIfName4Match8(int name1,
byte c8)
Checks if the next field name matches an 8-character pattern.
|
abstract boolean |
nextIfName4Match9(long name1)
Checks if the next field name matches a 9-character pattern.
|
boolean |
nextIfName8Match0()
Checks if the next field name matches an 8-character pattern with no additional characters.
|
boolean |
nextIfName8Match1()
Checks if the next field name matches an 8-character pattern with 1 additional character.
|
boolean |
nextIfName8Match2()
Checks if the next field name matches an 8-character pattern with 2 additional characters.
|
abstract boolean |
nextIfNull()
Checks if the current JSON value is null and advances the reader if it is.
|
abstract boolean |
nextIfNullOrEmptyString()
Checks if the current value is a null or empty string and advances the reader if it is.
|
abstract boolean |
nextIfObjectEnd()
Checks if the current character is the end of a JSON object ('}') and advances the reader if it is.
|
abstract boolean |
nextIfObjectStart()
Checks if the current character is the start of a JSON object ('{') and advances the reader if it is.
|
abstract boolean |
nextIfSet()
Checks if the current value represents a Set and advances the reader if it is.
|
boolean |
nextIfValue4Match10(long name1)
Checks if the next value matches a 10-character pattern.
|
boolean |
nextIfValue4Match11(long name1)
Checks if the next value matches an 11-character pattern.
|
boolean |
nextIfValue4Match2()
Checks if the next value matches a 2-character pattern.
|
boolean |
nextIfValue4Match3()
Checks if the next value matches a 3-character pattern.
|
boolean |
nextIfValue4Match4(byte c4)
Checks if the next value matches a 4-character pattern.
|
boolean |
nextIfValue4Match5(byte c4,
byte c5)
Checks if the next value matches a 5-character pattern.
|
boolean |
nextIfValue4Match6(int name1)
Checks if the next value matches a 6-character pattern.
|
boolean |
nextIfValue4Match7(int name1)
Checks if the next value matches a 7-character pattern.
|
boolean |
nextIfValue4Match8(int name1,
byte c8)
Checks if the next value matches an 8-character pattern.
|
boolean |
nextIfValue4Match9(int name1,
byte c8,
byte c9)
Checks if the next value matches a 9-character pattern.
|
void |
nextWithoutComment()
Advances the reader to the next character in the JSON data, skipping comment processing.
|
(package private) JSONException |
notSupportName() |
(package private) JSONException |
numberError() |
(package private) static JSONException |
numberError(int offset,
int ch) |
static JSONReader |
of(byte[] utf8Bytes)
Creates a JSONReader from a byte array containing UTF-8 encoded JSON.
|
static JSONReader |
of(byte[] bytes,
int offset,
int length) |
static JSONReader |
of(byte[] bytes,
int offset,
int length,
java.nio.charset.Charset charset) |
static JSONReader |
of(byte[] bytes,
int offset,
int length,
java.nio.charset.Charset charset,
JSONReader.Context context) |
static JSONReader |
of(byte[] bytes,
int offset,
int length,
JSONReader.Context context) |
static JSONReader |
of(byte[] utf8Bytes,
JSONReader.Context context) |
static JSONReader |
of(java.nio.ByteBuffer buffer,
java.nio.charset.Charset charset) |
static JSONReader |
of(java.nio.ByteBuffer buffer,
java.nio.charset.Charset charset,
JSONReader.Context context) |
static JSONReader |
of(char[] chars)
Creates a JSONReader from a character array containing JSON data.
|
static JSONReader |
of(char[] chars,
int offset,
int length) |
static JSONReader |
of(char[] chars,
int offset,
int length,
JSONReader.Context context) |
static JSONReader |
of(char[] chars,
JSONReader.Context context) |
static JSONReader |
of(java.io.InputStream is,
java.nio.charset.Charset charset)
Creates a JSONReader from an InputStream containing JSON data.
|
static JSONReader |
of(java.io.InputStream is,
java.nio.charset.Charset charset,
JSONReader.Context context) |
static JSONReader |
of(JSONReader.Context context,
byte[] utf8Bytes)
Deprecated.
|
static JSONReader |
of(JSONReader.Context context,
char[] chars)
Deprecated.
|
static JSONReader |
of(JSONReader.Context context,
java.lang.String str)
Deprecated.
|
static JSONReader |
of(java.io.Reader is)
Creates a JSONReader from a Reader containing JSON data.
|
static JSONReader |
of(java.io.Reader is,
JSONReader.Context context) |
static JSONReader |
of(java.lang.String str)
Creates a JSONReader from a String containing JSON data.
|
static JSONReader |
of(java.lang.String str,
int offset,
int length)
Creates a JSONReader from a substring of a String containing JSON data.
|
static JSONReader |
of(java.lang.String str,
int offset,
int length,
JSONReader.Context context) |
static JSONReader |
of(java.lang.String str,
JSONReader.Context context) |
static JSONReader |
of(java.net.URL url,
JSONReader.Context context) |
static JSONReader |
ofJSONB(byte[] jsonbBytes)
Creates a JSONReader from a byte array containing JSONB (binary JSON) data.
|
static JSONReader |
ofJSONB(byte[] bytes,
int offset,
int length) |
static JSONReader |
ofJSONB(byte[] bytes,
int offset,
int length,
JSONReader.Context context) |
static JSONReader |
ofJSONB(byte[] bytes,
int offset,
int length,
SymbolTable symbolTable) |
static JSONReader |
ofJSONB(byte[] jsonbBytes,
JSONReader.Context context) |
static JSONReader |
ofJSONB(byte[] jsonbBytes,
JSONReader.Feature... features) |
static JSONReader |
ofJSONB(java.io.InputStream in,
JSONReader.Context context) |
static JSONReader |
ofJSONB(JSONReader.Context context,
byte[] jsonbBytes)
Deprecated.
|
private static JSONReader |
ofUTF16(byte[] bytes,
int offset,
int length,
JSONReader.Context ctx) |
private static JSONReader |
ofUTF16(java.lang.String str,
char[] chars,
int offset,
int length,
JSONReader.Context ctx) |
<T> T |
read(java.lang.Class<T> type) |
void |
read(java.util.Collection list) |
void |
read(java.util.List list) |
void |
read(java.util.Map object,
long features)
Reads JSON data into a Map with specified features.
|
void |
read(java.util.Map object,
ObjectReader itemReader,
long features)
Reads JSON data into a Map using a specified ObjectReader for the values.
|
void |
read(java.util.Map object,
java.lang.reflect.Type keyType,
java.lang.reflect.Type valueType,
long features)
Reads JSON data into a Map with specified key and value types.
|
<T> T |
read(java.lang.reflect.Type type) |
java.lang.Object |
readAny()
Reads any JSON value and returns it as an Object.
|
java.util.List |
readArray()
Reads a JSON array and returns it as a List.
|
void |
readArray(java.util.Collection list,
java.lang.reflect.Type itemType) |
void |
readArray(java.util.List list,
java.lang.reflect.Type itemType) |
java.util.List |
readArray(java.lang.reflect.Type itemType)
Reads a JSON array with elements of a specified type.
|
java.lang.Object[] |
readArray(java.lang.reflect.Type[] types)
Reads a JSON array with elements of specified types into an Object array.
|
byte[] |
readBase64()
Reads a Base64 encoded string from JSON data and decodes it to bytes.
|
abstract java.math.BigDecimal |
readBigDecimal()
Reads a BigDecimal value from JSON data.
|
java.math.BigInteger |
readBigInteger()
Reads a BigInteger value from JSON data.
|
byte[] |
readBinary()
Reads binary data from JSON data.
|
java.lang.Boolean |
readBool()
Reads a boolean value from JSON data.
|
abstract boolean |
readBoolValue()
Reads a boolean value from JSON data.
|
java.util.Calendar |
readCalendar()
Reads a Calendar value from JSON data.
|
java.lang.Character |
readCharacter()
Reads a Character object from JSON data.
|
char |
readCharValue()
Reads a character value from JSON data.
|
java.util.Date |
readDate()
Reads a Date value from JSON data.
|
java.lang.Double |
readDouble()
Reads a Double object from JSON data.
|
abstract double |
readDoubleValue()
Reads a double value from JSON data.
|
abstract java.lang.String |
readFieldName()
Reads the current field name in a JSON object.
|
abstract long |
readFieldNameHashCode()
Reads the hash code of the current field name in a JSON object.
|
long |
readFieldNameHashCode(int keySie,
int min,
int max) |
long |
readFieldNameHashCodeE(int size0,
int size1,
int size3) |
protected long |
readFieldNameHashCodeError(int nameBegin,
int ch) |
abstract long |
readFieldNameHashCodeUnquote()
Reads the hash code of the current field name in a JSON object without requiring quotes.
|
java.lang.String |
readFieldNameUnquote()
Reads the current field name in a JSON object without requiring quotes.
|
java.lang.Float |
readFloat()
Reads a Float object from JSON data.
|
abstract float |
readFloatValue()
Reads a float value from JSON data.
|
abstract byte[] |
readHex()
Reads a hexadecimal string from JSON data and converts it to a byte array.
|
abstract boolean |
readIfNull()
Checks if the current JSON value is null and advances the reader if it is.
|
java.time.Instant |
readInstant()
Reads an Instant value from JSON data.
|
java.lang.Short |
readInt16()
Reads a Short object from JSON data.
|
short |
readInt16Value()
Reads a short value from JSON data.
|
abstract java.lang.Integer |
readInt32()
Reads an Integer object from JSON data.
|
abstract int |
readInt32Value()
Reads a 32-bit integer value from JSON data.
|
int[] |
readInt32ValueArray()
Reads an array of 32-bit integer values from JSON data.
|
protected int |
readInt32ValueOverflow()
Reads a 32-bit integer value from JSON data, handling overflow conditions.
|
abstract java.lang.Long |
readInt64()
Reads a Long object from JSON data.
|
abstract long |
readInt64Value()
Reads a 64-bit long value from JSON data.
|
long[] |
readInt64ValueArray()
Reads an array of 64-bit long values from JSON data.
|
protected long |
readInt64ValueOverflow()
Reads a 64-bit long value from JSON data, handling overflow conditions.
|
java.lang.Byte |
readInt8()
Reads a Byte object from JSON data.
|
byte |
readInt8Value()
Reads a byte value from JSON data.
|
JSONArray |
readJSONArray()
Reads a JSON array and returns it as a JSONArray.
|
JSONObject |
readJSONObject()
Reads a JSON object and returns it as a JSONObject.
|
java.util.List |
readList(java.lang.reflect.Type[] types)
Reads a JSON array with elements of specified types.
|
java.time.LocalDate |
readLocalDate()
Reads a LocalDate value from JSON data.
|
protected abstract java.time.LocalDate |
readLocalDate10() |
protected abstract java.time.LocalDate |
readLocalDate11() |
protected abstract java.time.LocalDate |
readLocalDate8() |
protected abstract java.time.LocalDate |
readLocalDate9() |
java.time.LocalDateTime |
readLocalDateTime()
Reads a LocalDateTime value from JSON data.
|
protected abstract java.time.LocalDateTime |
readLocalDateTime12() |
protected abstract java.time.LocalDateTime |
readLocalDateTime14() |
protected abstract java.time.LocalDateTime |
readLocalDateTime16() |
protected abstract java.time.LocalDateTime |
readLocalDateTime17() |
protected abstract java.time.LocalDateTime |
readLocalDateTime18() |
protected abstract java.time.LocalDateTime |
readLocalDateTime19() |
protected abstract java.time.LocalDateTime |
readLocalDateTime20() |
protected abstract java.time.LocalDateTime |
readLocalDateTimeX(int len) |
java.time.LocalTime |
readLocalTime()
Reads a LocalTime value from JSON data.
|
protected abstract java.time.LocalTime |
readLocalTime10() |
protected abstract java.time.LocalTime |
readLocalTime11() |
protected abstract java.time.LocalTime |
readLocalTime12() |
protected abstract java.time.LocalTime |
readLocalTime15() |
protected abstract java.time.LocalTime |
readLocalTime18() |
protected abstract java.time.LocalTime |
readLocalTime5() |
protected abstract java.time.LocalTime |
readLocalTime6() |
protected abstract java.time.LocalTime |
readLocalTime7() |
protected abstract java.time.LocalTime |
readLocalTime8() |
protected abstract java.time.LocalTime |
readLocalTime9() |
abstract long |
readMillis19()
Reads milliseconds from a 19-character date string in JSON data.
|
long |
readMillisFromString()
Reads milliseconds from a string value in JSON data.
|
protected double |
readNaN() |
abstract void |
readNull()
Reads a null value from JSON data and advances the reader.
|
abstract java.util.Date |
readNullOrNewDate()
Reads a Date value from JSON data, returning null if the value is null.
|
java.lang.Number |
readNumber()
Reads a Number value from JSON data.
|
void |
readNumber(ValueConsumer consumer,
boolean quoted)
Reads a number value from JSON data and passes it to a consumer.
|
protected abstract void |
readNumber0()
Reads a number value from JSON data and stores it in internal fields.
|
java.util.Map<java.lang.String,java.lang.Object> |
readObject()
Reads JSON data and returns it as a Map.
|
void |
readObject(java.lang.Object object,
JSONReader.Feature... features) |
void |
readObject(java.lang.Object object,
long features) |
abstract java.time.OffsetDateTime |
readOffsetDateTime() |
abstract java.time.OffsetTime |
readOffsetTime() |
abstract java.lang.String |
readPattern()
Reads a pattern string from the JSON data.
|
abstract java.lang.String |
readReference()
Reads a reference value from JSON data.
|
boolean |
readReference(java.util.Collection list,
int i)
Reads a reference value from JSON data and adds it to the specified collection at the given index.
|
boolean |
readReference(java.util.List list,
int i)
Reads a reference value from JSON data and adds it to the specified list at the given index.
|
private boolean |
readReference0(java.util.Collection list,
int i) |
abstract java.lang.String |
readString()
Reads a string value from JSON data.
|
void |
readString(ValueConsumer consumer,
boolean quoted)
Reads a string value from JSON data and passes it to a consumer.
|
java.lang.String[] |
readStringArray()
Reads a JSON array of strings and returns it as a String array.
|
protected java.lang.String |
readStringNotMatch() |
long |
readTypeHashCode()
Reads the hash code of the current type in the JSON data.
|
abstract java.util.UUID |
readUUID()
Reads a UUID value from JSON data.
|
abstract long |
readValueHashCode()
Reads the hash code of the current JSON value.
|
java.time.ZonedDateTime |
readZonedDateTime()
Reads a ZonedDateTime value from JSON data.
|
protected abstract java.time.ZonedDateTime |
readZonedDateTimeX(int len) |
void |
reset(JSONReader.SavePoint savePoint) |
void |
setTypeRedirect(boolean typeRedirect)
Sets the type redirect flag for this reader.
|
abstract void |
skipComment()
Skips a comment in the JSON data, advancing the reader to the end of the comment.
|
abstract boolean |
skipName()
Skips the current field name in a JSON object.
|
abstract void |
skipValue()
Skips the current JSON value, advancing the reader to the next value or end of the current structure.
|
int |
startArray()
Starts reading a JSON array, advancing the reader to the first element.
|
protected static java.lang.String |
stringValue(java.lang.String str,
long features) |
(package private) static JSONException |
syntaxError(int ch) |
(package private) static JSONException |
syntaxError(int offset,
int ch) |
protected int |
toInt(java.util.List list) |
protected int |
toInt32(java.lang.String val) |
protected long |
toInt64(java.lang.String val) |
protected long |
toLong(java.util.Map map) |
protected java.lang.Number |
toNumber(java.util.List list) |
protected java.lang.Number |
toNumber(java.util.Map map) |
protected java.lang.String |
toString(java.util.List array) |
protected java.lang.String |
toString(java.util.Map object) |
(package private) JSONException |
valueError() |
boolean |
wasNull() |
static final int MAX_EXP
static final int MAX_NUMBER_DIGITS
static final byte JSON_TYPE_INT
static final byte JSON_TYPE_DEC
static final byte JSON_TYPE_STRING
static final byte JSON_TYPE_BOOL
static final byte JSON_TYPE_NULL
static final byte JSON_TYPE_OBJECT
static final byte JSON_TYPE_ARRAY
static final byte JSON_TYPE_BIG_DEC
static final byte JSON_TYPE_INT8
static final byte JSON_TYPE_INT16
static final byte JSON_TYPE_INT64
static final byte JSON_TYPE_FLOAT
static final byte JSON_TYPE_DOUBLE
static final byte JSON_TYPE_NaN
static final char EOI
static final long SPACE
static final boolean[] INT_VALUE_END
static final byte[] CHAR1_ESCAPED
protected final JSONReader.Context context
public final boolean jsonb
public final boolean utf8
java.util.List<JSONReader.ResolveTask> resolveTasks
protected int offset
protected char ch
protected boolean comma
protected int nameBegin
protected boolean nameEscape
protected boolean valueEscape
protected boolean wasNull
protected boolean boolValue
protected boolean negative
protected byte valueType
protected short exponent
protected short scale
protected int mag0
protected int mag1
protected int mag2
protected int mag3
protected int level
protected java.lang.String stringValue
protected java.lang.Object complex
protected boolean typeRedirect
protected byte[] doubleChars
protected static final long MASK_FIELD_BASED
protected static final long MASK_IGNORE_NONE_SERIALIZABLE
protected static final long MASK_ERROR_ON_NONE_SERIALIZABLE
protected static final long MASK_SUPPORT_ARRAY_TO_BEAN
protected static final long MASK_INIT_STRING_FIELD_AS_EMPTY
protected static final long MASK_SUPPORT_AUTO_TYPE
protected static final long MASK_SUPPORT_SMART_MATCH
protected static final long MASK_TRIM_STRING
protected static final long MASK_ALLOW_UN_QUOTED_FIELD_NAMES
protected static final long MASK_EMPTY_STRING_AS_NULL
protected static final long MASK_DISABLE_SINGLE_QUOTE
protected static final long MASK_DISABLE_REFERENCE_DETECT
public JSONReader(JSONReader.Context context, boolean jsonb, boolean utf8)
context - the reading context to usejsonb - whether to use JSONB binary formatutf8 - whether to use UTF-8 encodingprotected static int newCapacity(int minCapacity,
int oldCapacity)
public final char current()
public boolean isEnd()
public byte getType()
public boolean isInt()
public abstract boolean isNull()
public final boolean hasComma()
public abstract java.util.Date readNullOrNewDate()
public abstract boolean nextIfNull()
public final JSONReader.Context getContext()
public final void errorOnNoneSerializable(java.lang.Class objectClass)
objectClass - The class to check for serializabilityJSONException - if the class is not serializable and the feature is enabledpublic final boolean isEnabled(JSONReader.Feature feature)
feature - The feature to checkpublic final java.util.Locale getLocale()
public final java.time.ZoneId getZoneId()
public final long features(long features)
features - Additional features to combine with context featurespublic abstract int getRawInt()
public abstract long getRawLong()
public abstract boolean nextIfName4Match2()
public boolean nextIfValue4Match2()
public abstract boolean nextIfName4Match3()
public boolean nextIfValue4Match3()
public abstract boolean nextIfName4Match4(byte c4)
c4 - the fourth character to matchpublic boolean nextIfValue4Match4(byte c4)
c4 - the fourth character to matchpublic abstract boolean nextIfName4Match5(int name1)
name1 - the first 4 bytes of the name to matchpublic boolean nextIfValue4Match5(byte c4,
byte c5)
c4 - the fourth character to matchc5 - the fifth character to matchpublic abstract boolean nextIfName4Match6(int name1)
name1 - the first 4 bytes of the name to matchpublic boolean nextIfValue4Match6(int name1)
name1 - the first 4 bytes of the name to matchpublic abstract boolean nextIfName4Match7(int name1)
name1 - the first 4 bytes of the name to matchpublic boolean nextIfValue4Match7(int name1)
name1 - the first 4 bytes of the name to matchpublic abstract boolean nextIfName4Match8(int name1,
byte c8)
name1 - the first 4 bytes of the name to matchc8 - the eighth character to matchpublic boolean nextIfValue4Match8(int name1,
byte c8)
name1 - the first 4 bytes of the name to matchc8 - the eighth character to matchpublic abstract boolean nextIfName4Match9(long name1)
name1 - the first 8 bytes of the name to matchpublic boolean nextIfValue4Match9(int name1,
byte c8,
byte c9)
name1 - the first 4 bytes of the name to matchc8 - the eighth character to matchc9 - the ninth character to matchpublic abstract boolean nextIfName4Match10(long name1)
name1 - the first 8 bytes of the name to matchpublic boolean nextIfValue4Match10(long name1)
name1 - the first 8 bytes of the name to matchpublic abstract boolean nextIfName4Match11(long name1)
name1 - the first 8 bytes of the name to matchpublic boolean nextIfValue4Match11(long name1)
name1 - the first 8 bytes of the name to matchpublic abstract boolean nextIfName4Match12(long name1,
byte name2)
name1 - the first 8 bytes of the name to matchname2 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match13(long name1,
int name2)
name1 - the first 8 bytes of the name to matchname2 - the last 4 bytes of the name to matchpublic boolean nextIfName4Match14(long name1,
int name2)
name1 - the first 8 bytes of the name to matchname2 - the last 4 bytes of the name to matchpublic boolean nextIfName4Match15(long name1,
int name2)
name1 - the first 8 bytes of the name to matchname2 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match16(long name1,
int name2,
byte name3)
name1 - the first 8 bytes of the name to matchname2 - the middle 4 bytes of the name to matchname3 - the last byte of the name to matchpublic abstract boolean nextIfName4Match17(long name1,
long name2)
name1 - the first 8 bytes of the name to matchname2 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match18(long name1,
long name2)
name1 - the first 8 bytes of the name to matchname2 - the last 8 bytes of the name to matchpublic boolean nextIfName4Match19(long name1,
long name2)
name1 - the first 8 bytes of the name to matchname2 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match20(long name1,
long name2,
byte name3)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the last byte of the name to matchpublic boolean nextIfName4Match21(long name1,
long name2,
int name3)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match22(long name1,
long name2,
int name3)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match23(long name1,
long name2,
int name3)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match24(long name1,
long name2,
int name3,
byte name4)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second to last 4 bytes of the name to matchname4 - the last byte of the name to matchpublic abstract boolean nextIfName4Match25(long name1,
long name2,
long name3)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match26(long name1,
long name2,
long name3)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match27(long name1,
long name2,
long name3)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match28(long name1,
long name2,
long name3,
byte c28)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second to last 8 bytes of the name to matchc28 - the last byte of the name to matchpublic abstract boolean nextIfName4Match29(long name1,
long name2,
long name3,
int name4)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second to last 8 bytes of the name to matchname4 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match30(long name1,
long name2,
long name3,
int name4)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second to last 8 bytes of the name to matchname4 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match31(long name1,
long name2,
long name3,
int name4)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second to last 8 bytes of the name to matchname4 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match32(long name1,
long name2,
long name3,
int name4,
byte c32)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second to last 8 bytes of the name to matchname4 - the second to last 4 bytes of the name to matchc32 - the last byte of the name to matchpublic abstract boolean nextIfName4Match33(long name1,
long name2,
long name3,
long name4)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match34(long name1,
long name2,
long name3,
long name4)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match35(long name1,
long name2,
long name3,
long name4)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match36(long name1,
long name2,
long name3,
long name4,
byte c35)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the second to last 8 bytes of the name to matchc35 - the last byte of the name to matchpublic abstract boolean nextIfName4Match37(long name1,
long name2,
long name3,
long name4,
int name5)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the third to last 8 bytes of the name to matchname5 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match38(long name1,
long name2,
long name3,
long name4,
int name5)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the third to last 8 bytes of the name to matchname5 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match39(long name1,
long name2,
long name3,
long name4,
int name5)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the third to last 8 bytes of the name to matchname5 - the last 4 bytes of the name to matchpublic abstract boolean nextIfName4Match40(long name1,
long name2,
long name3,
long name4,
int name5,
byte c40)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the third to last 8 bytes of the name to matchname5 - the second to last 4 bytes of the name to matchc40 - the last byte of the name to matchpublic abstract boolean nextIfName4Match41(long name1,
long name2,
long name3,
long name4,
long name5)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the third middle 8 bytes of the name to matchname5 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match42(long name1,
long name2,
long name3,
long name4,
long name5)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the third middle 8 bytes of the name to matchname5 - the last 8 bytes of the name to matchpublic abstract boolean nextIfName4Match43(long name1,
long name2,
long name3,
long name4,
long name5)
name1 - the first 8 bytes of the name to matchname2 - the middle 8 bytes of the name to matchname3 - the second middle 8 bytes of the name to matchname4 - the third middle 8 bytes of the name to matchname5 - the last 8 bytes of the name to matchpublic boolean nextIfName8Match0()
public boolean nextIfName8Match1()
public boolean nextIfName8Match2()
public final void handleResolveTasks(java.lang.Object root)
root - The root object of the parsed JSON structurepublic final ObjectReader getObjectReader(java.lang.reflect.Type type)
type - The type for which to get an ObjectReaderpublic final boolean isSupportSmartMatch()
public final boolean isInitStringFieldAsEmpty()
public final boolean isSupportSmartMatch(long features)
features - Additional features to considerpublic final boolean isSupportBeanArray()
public final boolean isSupportBeanArray(long features)
features - Additional features to considerpublic final boolean isSupportAutoType(long features)
features - Additional features to considerpublic final boolean isSupportAutoTypeOrHandler(long features)
features - Additional features to considerpublic final boolean isJSONB()
public final boolean isIgnoreNoneSerializable()
public boolean hasAutoTypeBeforeHandler()
public ObjectReader checkAutoType(java.lang.Class expectClass, long expectClassHash, long features)
expectClass - The expected classexpectClassHash - The expected class hashfeatures - Additional features to considerfinal char char1(int c)
protected JSONException char1Error(int c)
static char char2(int c1,
int c2)
public abstract boolean nextIfObjectStart()
public abstract boolean nextIfNullOrEmptyString()
public abstract boolean nextIfObjectEnd()
public int startArray()
JSONException - if the current character is not the start of an array ('[')public abstract boolean isReference()
public abstract java.lang.String readReference()
public final boolean readReference(java.util.List list,
int i)
list - The list to which the reference should be addedi - The index at which to add the reference in the listpublic boolean readReference(java.util.Collection list,
int i)
list - The collection to which the reference should be addedi - The index at which to add the reference in the collectionprivate boolean readReference0(java.util.Collection list,
int i)
public final void addResolveTask(FieldReader fieldReader, java.lang.Object object, JSONPath path)
public final void addResolveTask(java.util.Map object,
java.lang.Object key,
JSONPath reference)
public final void addResolveTask(java.util.Collection object,
int i,
JSONPath reference)
public final void addResolveTask(java.lang.Object[] object,
int i,
JSONPath reference)
public boolean isArray()
public boolean isObject()
public boolean isNumber()
public boolean isString()
public boolean isBool()
public void endArray()
public abstract boolean nextIfMatch(char ch)
ch - The character to matchpublic abstract boolean nextIfComma()
public abstract boolean nextIfArrayStart()
public abstract boolean nextIfArrayEnd()
public abstract boolean nextIfSet()
public abstract boolean nextIfInfinity()
public abstract java.lang.String readPattern()
public final int getOffset()
public abstract void next()
public void nextWithoutComment()
public abstract long readValueHashCode()
public long readTypeHashCode()
public abstract long readFieldNameHashCode()
public long readFieldNameHashCode(int keySie,
int min,
int max)
public long readFieldNameHashCodeE(int size0,
int size1,
int size3)
public abstract long getNameHashCodeLCase()
public abstract java.lang.String readFieldName()
public abstract java.lang.String getFieldName()
public final void setTypeRedirect(boolean typeRedirect)
typeRedirect - true to enable type redirection, false to disablepublic final boolean isTypeRedirect()
public abstract long readFieldNameHashCodeUnquote()
public final java.lang.String readFieldNameUnquote()
JSONException - if the field name is null or emptypublic abstract boolean skipName()
public abstract void skipValue()
public boolean isBinary()
public abstract byte[] readHex()
public byte[] readBinary()
JSONException - if there is an error parsing the binary datapublic abstract int readInt32Value()
public int[] readInt32ValueArray()
JSONException - if there is an error parsing the JSONpublic boolean nextIfMatch(byte type)
type - The type to matchJSONException - as this operation is not supportedpublic boolean nextIfMatchTypedAny()
JSONException - as this operation is not supportedpublic abstract boolean nextIfMatchIdent(char c0,
char c1)
public abstract boolean nextIfMatchIdent(char c0,
char c1,
char c2)
public abstract boolean nextIfMatchIdent(char c0,
char c1,
char c2,
char c3)
public abstract boolean nextIfMatchIdent(char c0,
char c1,
char c2,
char c3,
char c4)
public abstract boolean nextIfMatchIdent(char c0,
char c1,
char c2,
char c3,
char c4,
char c5)
public final java.lang.Byte readInt8()
public byte readInt8Value()
public final java.lang.Short readInt16()
public short readInt16Value()
public abstract java.lang.Integer readInt32()
protected final int readInt32ValueOverflow()
protected final long readInt64ValueOverflow()
public final int getInt32Value()
public final long getInt64Value()
public final double getDoubleValue()
public final float getFloatValue()
public long[] readInt64ValueArray()
JSONException - if there is an error parsing the JSONpublic abstract long readInt64Value()
public abstract java.lang.Long readInt64()
public abstract float readFloatValue()
public java.lang.Float readFloat()
public abstract double readDoubleValue()
public final java.lang.Double readDouble()
public java.lang.Number readNumber()
public java.math.BigInteger readBigInteger()
public abstract java.math.BigDecimal readBigDecimal()
public abstract java.util.UUID readUUID()
public java.time.LocalDate readLocalDate()
JSONException - if there is an error parsing the datepublic java.time.LocalDateTime readLocalDateTime()
JSONException - if there is an error parsing the date/timepublic abstract java.time.OffsetDateTime readOffsetDateTime()
public java.time.ZonedDateTime readZonedDateTime()
JSONException - if there is an error parsing the date/timepublic abstract java.time.OffsetTime readOffsetTime()
public java.util.Calendar readCalendar()
JSONException - if there is an error parsing the datepublic java.util.Date readDate()
JSONException - if there is an error parsing the datepublic java.time.LocalTime readLocalTime()
JSONException - if there is an error parsing the timeprotected abstract int getStringLength()
public boolean isDate()
public java.time.Instant readInstant()
JSONException - if there is an error parsing the instantpublic final long readMillisFromString()
JSONException - if there is an error parsing the stringprotected abstract java.time.LocalDateTime readLocalDateTime12()
protected abstract java.time.LocalDateTime readLocalDateTime14()
protected abstract java.time.LocalDateTime readLocalDateTime16()
protected abstract java.time.LocalDateTime readLocalDateTime17()
protected abstract java.time.LocalDateTime readLocalDateTime18()
protected abstract java.time.LocalDateTime readLocalDateTime19()
protected abstract java.time.LocalDateTime readLocalDateTime20()
public abstract long readMillis19()
protected abstract java.time.LocalDateTime readLocalDateTimeX(int len)
protected abstract java.time.LocalTime readLocalTime5()
protected abstract java.time.LocalTime readLocalTime6()
protected abstract java.time.LocalTime readLocalTime7()
protected abstract java.time.LocalTime readLocalTime8()
protected abstract java.time.LocalTime readLocalTime9()
protected abstract java.time.LocalTime readLocalTime10()
protected abstract java.time.LocalTime readLocalTime11()
protected abstract java.time.LocalTime readLocalTime12()
protected abstract java.time.LocalTime readLocalTime15()
protected abstract java.time.LocalTime readLocalTime18()
protected abstract java.time.LocalDate readLocalDate8()
protected abstract java.time.LocalDate readLocalDate9()
protected abstract java.time.LocalDate readLocalDate10()
protected abstract java.time.LocalDate readLocalDate11()
protected abstract java.time.ZonedDateTime readZonedDateTimeX(int len)
public void readNumber(ValueConsumer consumer, boolean quoted)
consumer - The consumer to accept the number valuequoted - Whether the number should be quoted in the outputpublic void readString(ValueConsumer consumer, boolean quoted)
consumer - The consumer to accept the string valuequoted - Whether the string should be quoted in the outputpublic abstract java.lang.String readString()
protected abstract void readNumber0()
public byte[] readBase64()
public java.lang.String[] readStringArray()
JSONException - if there is an error parsing the JSONpublic char readCharValue()
public java.lang.Character readCharacter()
public abstract void readNull()
protected double readNaN()
public abstract boolean readIfNull()
public abstract java.lang.String getString()
public boolean wasNull()
public <T> T read(java.lang.reflect.Type type)
public final void read(java.util.List list)
public final void read(java.util.Collection list)
public final void readObject(java.lang.Object object,
JSONReader.Feature... features)
public final void readObject(java.lang.Object object,
long features)
public void read(java.util.Map object,
ObjectReader itemReader,
long features)
object - The Map to populate with dataitemReader - The ObjectReader to use for reading valuesfeatures - Reader features to apply during readingpublic void read(java.util.Map object,
long features)
object - The Map to populate with datafeatures - Reader features to apply during readingpublic final void read(java.util.Map object,
java.lang.reflect.Type keyType,
java.lang.reflect.Type valueType,
long features)
object - The Map to populate with datakeyType - The type of keys in the mapvalueType - The type of values in the mapfeatures - Reader features to apply during readingpublic <T> T read(java.lang.Class<T> type)
public java.util.Map<java.lang.String,java.lang.Object> readObject()
JSONException - if there is an error parsing the JSONpublic abstract void skipComment()
public java.lang.Boolean readBool()
JSONException - if there is an error parsing the JSONpublic abstract boolean readBoolValue()
public java.lang.Object readAny()
public java.util.List readArray(java.lang.reflect.Type itemType)
itemType - The type of elements in the arraypublic java.util.List readList(java.lang.reflect.Type[] types)
types - The types of elements in the arraypublic final java.lang.Object[] readArray(java.lang.reflect.Type[] types)
types - The types of elements in the arraypublic final void readArray(java.util.List list,
java.lang.reflect.Type itemType)
public void readArray(java.util.Collection list,
java.lang.reflect.Type itemType)
public final JSONArray readJSONArray()
public final JSONObject readJSONObject()
public java.util.List readArray()
private void add(java.util.List<java.lang.Object> list,
int i,
java.lang.Object val)
public final java.math.BigInteger getBigInteger()
public final java.math.BigDecimal getBigDecimal()
public final java.lang.Number getNumber()
public abstract void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableprotected final int toInt32(java.lang.String val)
protected final long toInt64(java.lang.String val)
protected final long toLong(java.util.Map map)
protected final int toInt(java.util.List list)
protected final java.lang.Number toNumber(java.util.Map map)
protected final java.math.BigDecimal decimal(JSONObject object)
protected final java.lang.Number toNumber(java.util.List list)
protected final java.lang.String toString(java.util.List array)
protected final java.lang.String toString(java.util.Map object)
public static JSONReader of(byte[] utf8Bytes)
utf8Bytes - The byte array containing UTF-8 encoded JSON@Deprecated public static JSONReader of(JSONReader.Context context, byte[] utf8Bytes)
public static JSONReader of(byte[] utf8Bytes, JSONReader.Context context)
public static JSONReader of(char[] chars)
chars - The character array containing JSON data@Deprecated public static JSONReader of(JSONReader.Context context, char[] chars)
public static JSONReader of(char[] chars, JSONReader.Context context)
public static JSONReader ofJSONB(byte[] jsonbBytes)
jsonbBytes - The byte array containing JSONB data@Deprecated public static JSONReader ofJSONB(JSONReader.Context context, byte[] jsonbBytes)
public static JSONReader ofJSONB(byte[] jsonbBytes, JSONReader.Context context)
public static JSONReader ofJSONB(java.io.InputStream in, JSONReader.Context context)
public static JSONReader ofJSONB(byte[] jsonbBytes, JSONReader.Feature... features)
public static JSONReader ofJSONB(byte[] bytes, int offset, int length)
public static JSONReader ofJSONB(byte[] bytes, int offset, int length, JSONReader.Context context)
public static JSONReader ofJSONB(byte[] bytes, int offset, int length, SymbolTable symbolTable)
public static JSONReader of(byte[] bytes, int offset, int length, java.nio.charset.Charset charset)
private static JSONReader ofUTF16(byte[] bytes, int offset, int length, JSONReader.Context ctx)
private static JSONReader ofUTF16(java.lang.String str, char[] chars, int offset, int length, JSONReader.Context ctx)
public static JSONReader of(byte[] bytes, int offset, int length, java.nio.charset.Charset charset, JSONReader.Context context)
public static JSONReader of(byte[] bytes, int offset, int length)
public static JSONReader of(byte[] bytes, int offset, int length, JSONReader.Context context)
public static JSONReader of(char[] chars, int offset, int length)
public static JSONReader of(char[] chars, int offset, int length, JSONReader.Context context)
public static JSONReader of(java.net.URL url, JSONReader.Context context) throws java.io.IOException
java.io.IOExceptionpublic static JSONReader of(java.io.InputStream is, java.nio.charset.Charset charset)
is - The InputStream containing JSON datacharset - The character encoding of the JSON datapublic static JSONReader of(java.io.InputStream is, java.nio.charset.Charset charset, JSONReader.Context context)
public static JSONReader of(java.io.Reader is)
is - The Reader containing JSON datapublic static JSONReader of(java.io.Reader is, JSONReader.Context context)
public static JSONReader of(java.nio.ByteBuffer buffer, java.nio.charset.Charset charset)
public static JSONReader of(java.nio.ByteBuffer buffer, java.nio.charset.Charset charset, JSONReader.Context context)
@Deprecated public static JSONReader of(JSONReader.Context context, java.lang.String str)
public static JSONReader of(java.lang.String str)
str - The String containing JSON datapublic static JSONReader of(java.lang.String str, JSONReader.Context context)
public static JSONReader of(java.lang.String str, int offset, int length)
str - The String containing JSON dataoffset - The starting position of the substringlength - The length of the substringpublic static JSONReader of(java.lang.String str, int offset, int length, JSONReader.Context context)
final void bigInt(char[] chars,
int off,
int len)
final void bigInt(byte[] chars,
int off,
int len)
public static JSONReader.AutoTypeBeforeHandler autoTypeFilter(java.lang.String... names)
public static JSONReader.AutoTypeBeforeHandler autoTypeFilter(boolean includeBasic, java.lang.String... names)
public static JSONReader.AutoTypeBeforeHandler autoTypeFilter(java.lang.Class... types)
public static JSONReader.AutoTypeBeforeHandler autoTypeFilter(boolean includeBasic, java.lang.Class... types)
public JSONReader.SavePoint mark()
public void reset(JSONReader.SavePoint savePoint)
final boolean checkNameBegin(int quote)
final JSONException notSupportName()
final JSONException valueError()
final JSONException error(java.lang.String message)
final JSONException error(java.lang.String message, int ch)
final JSONException error(java.lang.String message, java.lang.Exception cause)
final JSONException error()
final JSONException error(int offset, int ch)
static JSONException syntaxError(int ch)
static JSONException syntaxError(int offset, int ch)
static JSONException numberError(int offset, int ch)
JSONException numberError()
public final java.lang.String info()
public java.lang.String info(java.lang.String message)
static boolean isFirstIdentifier(int ch)
public ObjectReader getObjectReaderAutoType(long typeHash, java.lang.Class expectClass, long features)
typeHash - The hash code of the typeexpectClass - The expected classfeatures - Additional features to considerprotected final java.lang.String readStringNotMatch()
protected static java.lang.String stringValue(java.lang.String str,
long features)
protected final long readFieldNameHashCodeError(int nameBegin,
int ch)