Package com.alibaba.fastjson2
Class JSONReader
java.lang.Object
com.alibaba.fastjson2.JSONReader
- All Implemented Interfaces:
Closeable,AutoCloseable
JSONReader is the core class for reading and parsing JSON data in FASTJSON2.
It provides methods to read various data types from JSON including primitives,
objects, arrays, dates, and custom types.
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");
}
- Since:
- 2.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final classContext holds the configuration and state information for JSON reading operations.static enumFeature is used to control the behavior of JSON reading and parsing in FASTJSON2.static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected charprotected booleanprotected Objectprotected final JSONReader.Contextprotected byte[]protected shortfinal booleanprotected intprotected intprotected intprotected intprotected intprotected static final longprotected static final longprotected static final longprotected static final longprotected static final longprotected static final longprotected static final longprotected static final longprotected static final longprotected static final longprotected static final longprotected static final longprotected booleanprotected booleanprotected intprotected shortprotected Stringprotected booleanfinal booleanprotected booleanprotected byteprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionJSONReader(JSONReader.Context context, boolean jsonb, boolean utf8) Constructs a new JSONReader with the specified context and configuration. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddResolveTask(FieldReader fieldReader, Object object, JSONPath path) final voidaddResolveTask(Object[] object, int i, JSONPath reference) final voidaddResolveTask(Collection object, int i, JSONPath reference) final voidaddResolveTask(Map object, Object key, JSONPath reference) autoTypeFilter(boolean includeBasic, Class... types) autoTypeFilter(boolean includeBasic, String... names) autoTypeFilter(Class... types) autoTypeFilter(String... names) checkAutoType(Class expectClass, long expectClassHash, long features) Checks the auto type for the specified class and hash, considering additional features.abstract voidclose()final charcurrent()Gets the current character being processed by the reader.protected final BigDecimaldecimal(JSONObject object) voidendArray()Advances the reader to the end of the current JSON array.final voiderrorOnNoneSerializable(Class objectClass) Throws a JSONException if the specified class is not serializable and the ErrorOnNoneSerializable feature is enabled.final longfeatures(long features) Combines the context features with the specified additional features.final BigDecimalfinal BigIntegerfinal JSONReader.ContextGets the reading context for this JSONReader.final doubleabstract StringGets the current field name in a JSON object.final floatfinal intfinal longfinal LocaleGets the locale used for parsing in this JSONReader.abstract longReads the hash code of the current field name in lowercase.final Numberfinal ObjectReadergetObjectReader(Type type) Gets an ObjectReader for the specified type from the context's provider.getObjectReaderAutoType(long typeHash, Class expectClass, long features) Gets an ObjectReader for the specified type hash, expected class, and features.final intabstract intGets the raw integer value from the current position in the JSON data.abstract longGets the raw long value from the current position in the JSON data.abstract StringGets the current string value from the JSON data.protected abstract intGets the length of the current string value in the JSON data.bytegetType()Gets the type of the current JSON value.final ZoneIdGets the zone ID used for date/time parsing in this JSONReader.final voidhandleResolveTasks(Object root) Handles resolve tasks for circular references in the JSON data.booleanChecks if there is an auto-type before handler configured in the context.final booleanhasComma()Checks if the reader has encountered a comma.final Stringinfo()booleanisArray()Checks if the current character represents the start of a JSON array.booleanisBinary()Checks if the current value represents binary data.booleanisDate()Checks if the current value represents a date.final booleanisEnabled(JSONReader.Feature feature) Checks if a specific feature is enabled in the reading context.booleanisEnd()Checks if the reader has reached the end of the input.final booleanChecks if the IgnoreNoneSerializable feature is enabled in the context.final booleanChecks if the InitStringFieldAsEmpty feature is enabled in the context.booleanisInt()Checks if the current character represents the start of an integer value.final booleanisJSONB()Checks if this reader is using JSONB binary format.abstract booleanisNull()Checks if the current JSON value is null.booleanisNumber()Checks if the current character represents the start of a JSON number.booleanisObject()Checks if the current character represents the start of a JSON object.abstract booleanChecks if the current value represents a reference.booleanisString()Checks if the current character represents the start of a JSON string.final booleanisSupportAutoType(long features) Checks if the SupportAutoType feature is enabled, considering additional features.final booleanisSupportAutoTypeOrHandler(long features) Checks if the SupportAutoType feature or handler is enabled, considering additional features.final booleanChecks if the SupportArrayToBean feature is enabled in the context.final booleanisSupportBeanArray(long features) Checks if the SupportArrayToBean feature is enabled, considering additional features.final booleanChecks if the SmartMatch feature is enabled in the context.final booleanisSupportSmartMatch(long features) Checks if the SmartMatch feature is enabled, considering additional features.final booleanChecks if type redirection is enabled for this reader.mark()abstract voidnext()Advances the reader to the next character in the JSON data.abstract booleanChecks if the current character is the end of a JSON array (']') and advances the reader if it is.abstract booleanChecks if the current character is the start of a JSON array ('[') and advances the reader if it is.abstract booleanChecks if the current character is a comma (',') and advances the reader if it is.abstract booleanChecks if the current value represents infinity and advances the reader if it is.booleannextIfMatch(byte type) Checks if the next value matches the specified type and advances the reader if it does.abstract booleannextIfMatch(char ch) Checks if the current character matches the specified character and advances the reader if it does.abstract booleannextIfMatchIdent(char c0, char c1) abstract booleannextIfMatchIdent(char c0, char c1, char c2) abstract booleannextIfMatchIdent(char c0, char c1, char c2, char c3) abstract booleannextIfMatchIdent(char c0, char c1, char c2, char c3, char c4) abstract booleannextIfMatchIdent(char c0, char c1, char c2, char c3, char c4, char c5) booleanChecks if the next value matches any type and advances the reader if it does.abstract booleannextIfName4Match10(long name1) Checks if the next field name matches a 10-character pattern.abstract booleannextIfName4Match11(long name1) Checks if the next field name matches an 11-character pattern.abstract booleannextIfName4Match12(long name1, byte name2) Checks if the next field name matches a 12-character pattern.abstract booleannextIfName4Match13(long name1, int name2) Checks if the next field name matches a 13-character pattern.booleannextIfName4Match14(long name1, int name2) Checks if the next field name matches a 14-character pattern.booleannextIfName4Match15(long name1, int name2) Checks if the next field name matches a 15-character pattern.abstract booleannextIfName4Match16(long name1, int name2, byte name3) Checks if the next field name matches a 16-character pattern.abstract booleannextIfName4Match17(long name1, long name2) Checks if the next field name matches a 17-character pattern.abstract booleannextIfName4Match18(long name1, long name2) Checks if the next field name matches an 18-character pattern.booleannextIfName4Match19(long name1, long name2) Checks if the next field name matches a 19-character pattern.abstract booleanChecks if the next field name matches a 2-character pattern.abstract booleannextIfName4Match20(long name1, long name2, byte name3) Checks if the next field name matches a 20-character pattern.booleannextIfName4Match21(long name1, long name2, int name3) Checks if the next field name matches a 21-character pattern.abstract booleannextIfName4Match22(long name1, long name2, int name3) Checks if the next field name matches a 22-character pattern.abstract booleannextIfName4Match23(long name1, long name2, int name3) Checks if the next field name matches a 23-character pattern.abstract booleannextIfName4Match24(long name1, long name2, int name3, byte name4) Checks if the next field name matches a 24-character pattern.abstract booleannextIfName4Match25(long name1, long name2, long name3) Checks if the next field name matches a 25-character pattern.abstract booleannextIfName4Match26(long name1, long name2, long name3) Checks if the next field name matches a 26-character pattern.abstract booleannextIfName4Match27(long name1, long name2, long name3) Checks if the next field name matches a 27-character pattern.abstract booleannextIfName4Match28(long name1, long name2, long name3, byte c28) Checks if the next field name matches a 28-character pattern.abstract booleannextIfName4Match29(long name1, long name2, long name3, int name4) Checks if the next field name matches a 29-character pattern.abstract booleanChecks if the next field name matches a 3-character pattern.abstract booleannextIfName4Match30(long name1, long name2, long name3, int name4) Checks if the next field name matches a 30-character pattern.abstract booleannextIfName4Match31(long name1, long name2, long name3, int name4) Checks if the next field name matches a 31-character pattern.abstract booleannextIfName4Match32(long name1, long name2, long name3, int name4, byte c32) Checks if the next field name matches a 32-character pattern.abstract booleannextIfName4Match33(long name1, long name2, long name3, long name4) Checks if the next field name matches a 33-character pattern.abstract booleannextIfName4Match34(long name1, long name2, long name3, long name4) Checks if the next field name matches a 34-character pattern.abstract booleannextIfName4Match35(long name1, long name2, long name3, long name4) Checks if the next field name matches a 35-character pattern.abstract booleannextIfName4Match36(long name1, long name2, long name3, long name4, byte c35) Checks if the next field name matches a 36-character pattern.abstract booleannextIfName4Match37(long name1, long name2, long name3, long name4, int name5) Checks if the next field name matches a 37-character pattern.abstract booleannextIfName4Match38(long name1, long name2, long name3, long name4, int name5) Checks if the next field name matches a 38-character pattern.abstract booleannextIfName4Match39(long name1, long name2, long name3, long name4, int name5) Checks if the next field name matches a 39-character pattern.abstract booleannextIfName4Match4(byte c4) Checks if the next field name matches a 4-character pattern.abstract booleannextIfName4Match40(long name1, long name2, long name3, long name4, int name5, byte c40) Checks if the next field name matches a 40-character pattern.abstract booleannextIfName4Match41(long name1, long name2, long name3, long name4, long name5) Checks if the next field name matches a 41-character pattern.abstract booleannextIfName4Match42(long name1, long name2, long name3, long name4, long name5) Checks if the next field name matches a 42-character pattern.abstract booleannextIfName4Match43(long name1, long name2, long name3, long name4, long name5) Checks if the next field name matches a 43-character pattern.abstract booleannextIfName4Match5(int name1) Checks if the next field name matches a 5-character pattern.abstract booleannextIfName4Match6(int name1) Checks if the next field name matches a 6-character pattern.abstract booleannextIfName4Match7(int name1) Checks if the next field name matches a 7-character pattern.abstract booleannextIfName4Match8(int name1, byte c8) Checks if the next field name matches an 8-character pattern.abstract booleannextIfName4Match9(long name1) Checks if the next field name matches a 9-character pattern.booleanChecks if the next field name matches an 8-character pattern with no additional characters.booleanChecks if the next field name matches an 8-character pattern with 1 additional character.booleanChecks if the next field name matches an 8-character pattern with 2 additional characters.abstract booleanChecks if the current JSON value is null and advances the reader if it is.abstract booleanChecks if the current value is a null or empty string and advances the reader if it is.abstract booleanChecks if the current character is the end of a JSON object ('}') and advances the reader if it is.abstract booleanChecks if the current character is the start of a JSON object ('{') and advances the reader if it is.abstract booleanChecks if the current value represents a Set and advances the reader if it is.booleannextIfValue4Match10(long name1) Checks if the next value matches a 10-character pattern.booleannextIfValue4Match11(long name1) Checks if the next value matches an 11-character pattern.booleanChecks if the next value matches a 2-character pattern.booleanChecks if the next value matches a 3-character pattern.booleannextIfValue4Match4(byte c4) Checks if the next value matches a 4-character pattern.booleannextIfValue4Match5(byte c4, byte c5) Checks if the next value matches a 5-character pattern.booleannextIfValue4Match6(int name1) Checks if the next value matches a 6-character pattern.booleannextIfValue4Match7(int name1) Checks if the next value matches a 7-character pattern.booleannextIfValue4Match8(int name1, byte c8) Checks if the next value matches an 8-character pattern.booleannextIfValue4Match9(int name1, byte c8, byte c9) Checks if the next value matches a 9-character pattern.voidAdvances the reader to the next character in the JSON data, skipping comment processing.static JSONReaderof(byte[] utf8Bytes) Creates a JSONReader from a byte array containing UTF-8 encoded JSON.static JSONReaderof(byte[] bytes, int offset, int length) static JSONReaderof(byte[] bytes, int offset, int length, JSONReader.Context context) static JSONReaderstatic JSONReaderof(byte[] bytes, int offset, int length, Charset charset, JSONReader.Context context) static JSONReaderof(byte[] utf8Bytes, JSONReader.Context context) static JSONReaderof(char[] chars) Creates a JSONReader from a character array containing JSON data.static JSONReaderof(char[] chars, int offset, int length) static JSONReaderof(char[] chars, int offset, int length, JSONReader.Context context) static JSONReaderof(char[] chars, JSONReader.Context context) static JSONReaderof(JSONReader.Context context, byte[] utf8Bytes) Deprecated.static JSONReaderof(JSONReader.Context context, char[] chars) Deprecated.static JSONReaderof(JSONReader.Context context, String str) Deprecated.static JSONReaderof(InputStream is, Charset charset) Creates a JSONReader from an InputStream containing JSON data.static JSONReaderof(InputStream is, Charset charset, JSONReader.Context context) static JSONReaderCreates a JSONReader from a Reader containing JSON data.static JSONReaderof(Reader is, JSONReader.Context context) static JSONReaderCreates a JSONReader from a String containing JSON data.static JSONReaderCreates a JSONReader from a substring of a String containing JSON data.static JSONReaderof(String str, int offset, int length, JSONReader.Context context) static JSONReaderof(String str, JSONReader.Context context) static JSONReaderof(URL url, JSONReader.Context context) static JSONReaderof(ByteBuffer buffer, Charset charset) static JSONReaderof(ByteBuffer buffer, Charset charset, JSONReader.Context context) static JSONReaderofJSONB(byte[] jsonbBytes) Creates a JSONReader from a byte array containing JSONB (binary JSON) data.static JSONReaderofJSONB(byte[] bytes, int offset, int length) static JSONReaderofJSONB(byte[] bytes, int offset, int length, JSONReader.Context context) static JSONReaderofJSONB(byte[] bytes, int offset, int length, SymbolTable symbolTable) static JSONReaderofJSONB(byte[] jsonbBytes, JSONReader.Context context) static JSONReaderofJSONB(byte[] jsonbBytes, JSONReader.Feature... features) static JSONReaderofJSONB(JSONReader.Context context, byte[] jsonbBytes) Deprecated.static JSONReaderofJSONB(InputStream in, JSONReader.Context context) <T> T<T> Tfinal voidread(Collection list) final voidvoidReads JSON data into a Map with specified features.voidread(Map object, ObjectReader itemReader, long features) Reads JSON data into a Map using a specified ObjectReader for the values.final voidReads JSON data into a Map with specified key and value types.readAny()Reads any JSON value and returns it as an Object.Reads a JSON array and returns it as a List.Reads a JSON array with elements of a specified type.final Object[]Reads a JSON array with elements of specified types into an Object array.voidreadArray(Collection list, Type itemType) final voidbyte[]Reads a Base64 encoded string from JSON data and decodes it to bytes.abstract BigDecimalReads a BigDecimal value from JSON data.Reads a BigInteger value from JSON data.byte[]Reads binary data from JSON data.readBool()Reads a boolean value from JSON data.abstract booleanReads a boolean value from JSON data.Reads a Calendar value from JSON data.Reads a Character object from JSON data.charReads a character value from JSON data.readDate()Reads a Date value from JSON data.final DoubleReads a Double object from JSON data.abstract doubleReads a double value from JSON data.abstract StringReads the current field name in a JSON object.abstract longReads the hash code of the current field name in a JSON object.abstract longReads the hash code of the current field name in a JSON object without requiring quotes.final StringReads the current field name in a JSON object without requiring quotes.Reads a Float object from JSON data.abstract floatReads a float value from JSON data.abstract byte[]readHex()Reads a hexadecimal string from JSON data and converts it to a byte array.abstract booleanChecks if the current JSON value is null and advances the reader if it is.Reads an Instant value from JSON data.final ShortReads a Short object from JSON data.shortReads a short value from JSON data.abstract IntegerReads an Integer object from JSON data.abstract intReads a 32-bit integer value from JSON data.int[]Reads an array of 32-bit integer values from JSON data.protected final intReads a 32-bit integer value from JSON data, handling overflow conditions.abstract LongReads a Long object from JSON data.abstract longReads a 64-bit long value from JSON data.long[]Reads an array of 64-bit long values from JSON data.protected final longReads a 64-bit long value from JSON data, handling overflow conditions.final BytereadInt8()Reads a Byte object from JSON data.byteReads a byte value from JSON data.final JSONArrayReads a JSON array and returns it as a JSONArray.final JSONObjectReads a JSON object and returns it as a JSONObject.Reads a JSON array with elements of specified types.Reads a LocalDate value from JSON data.protected abstract LocalDateprotected abstract LocalDateprotected abstract LocalDateprotected abstract LocalDateReads a LocalDateTime value from JSON data.protected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimereadLocalDateTimeX(int len) Reads a LocalTime value from JSON data.protected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeabstract longReads milliseconds from a 19-character date string in JSON data.final longReads milliseconds from a string value in JSON data.protected doublereadNaN()abstract voidreadNull()Reads a null value from JSON data and advances the reader.abstract DateReads a Date value from JSON data, returning null if the value is null.Reads a Number value from JSON data.voidreadNumber(ValueConsumer consumer, boolean quoted) Reads a number value from JSON data and passes it to a consumer.protected abstract voidReads a number value from JSON data and stores it in internal fields.Reads JSON data and returns it as a Map.final voidreadObject(Object object, long features) final voidreadObject(Object object, JSONReader.Feature... features) abstract OffsetDateTimeabstract OffsetTimeabstract StringReads a pattern string from the JSON data.abstract StringReads a reference value from JSON data.booleanreadReference(Collection list, int i) Reads a reference value from JSON data and adds it to the specified collection at the given index.final booleanreadReference(List list, int i) Reads a reference value from JSON data and adds it to the specified list at the given index.abstract StringReads a string value from JSON data.voidreadString(ValueConsumer consumer, boolean quoted) Reads a string value from JSON data and passes it to a consumer.String[]Reads a JSON array of strings and returns it as a String array.protected final StringlongReads the hash code of the current type in the JSON data.abstract UUIDreadUUID()Reads a UUID value from JSON data.abstract longReads the hash code of the current JSON value.Reads a ZonedDateTime value from JSON data.protected abstract ZonedDateTimereadZonedDateTimeX(int len) voidreset(JSONReader.SavePoint savePoint) final voidsetTypeRedirect(boolean typeRedirect) Sets the type redirect flag for this reader.abstract voidSkips a comment in the JSON data, advancing the reader to the end of the comment.abstract booleanskipName()Skips the current field name in a JSON object.abstract voidSkips the current JSON value, advancing the reader to the next value or end of the current structure.intStarts reading a JSON array, advancing the reader to the first element.protected static StringstringValue(String str, long features) protected final intprotected final intprotected final longprotected final longprotected final Numberprotected final Numberprotected final Stringprotected final StringbooleanwasNull()
-
Field Details
-
context
-
jsonb
public final boolean jsonb -
utf8
public final boolean utf8 -
offset
protected int offset -
ch
protected char ch -
comma
protected boolean comma -
nameEscape
protected boolean nameEscape -
valueEscape
protected boolean valueEscape -
wasNull
protected boolean wasNull -
boolValue
protected boolean boolValue -
negative
protected boolean negative -
valueType
protected byte valueType -
exponent
protected short exponent -
scale
protected short scale -
mag0
protected int mag0 -
mag1
protected int mag1 -
mag2
protected int mag2 -
mag3
protected int mag3 -
level
protected int level -
stringValue
-
complex
-
typeRedirect
protected boolean typeRedirect -
doubleChars
protected byte[] doubleChars -
MASK_FIELD_BASED
protected static final long MASK_FIELD_BASED- See Also:
-
MASK_IGNORE_NONE_SERIALIZABLE
protected static final long MASK_IGNORE_NONE_SERIALIZABLE- See Also:
-
MASK_ERROR_ON_NONE_SERIALIZABLE
protected static final long MASK_ERROR_ON_NONE_SERIALIZABLE- See Also:
-
MASK_SUPPORT_ARRAY_TO_BEAN
protected static final long MASK_SUPPORT_ARRAY_TO_BEAN- See Also:
-
MASK_INIT_STRING_FIELD_AS_EMPTY
protected static final long MASK_INIT_STRING_FIELD_AS_EMPTY- See Also:
-
MASK_SUPPORT_AUTO_TYPE
protected static final long MASK_SUPPORT_AUTO_TYPE- See Also:
-
MASK_SUPPORT_SMART_MATCH
protected static final long MASK_SUPPORT_SMART_MATCH- See Also:
-
MASK_TRIM_STRING
protected static final long MASK_TRIM_STRING- See Also:
-
MASK_ALLOW_UN_QUOTED_FIELD_NAMES
protected static final long MASK_ALLOW_UN_QUOTED_FIELD_NAMES- See Also:
-
MASK_EMPTY_STRING_AS_NULL
protected static final long MASK_EMPTY_STRING_AS_NULL- See Also:
-
MASK_DISABLE_SINGLE_QUOTE
protected static final long MASK_DISABLE_SINGLE_QUOTE- See Also:
-
MASK_DISABLE_REFERENCE_DETECT
protected static final long MASK_DISABLE_REFERENCE_DETECT- See Also:
-
-
Constructor Details
-
JSONReader
Constructs a new JSONReader with the specified context and configuration.- Parameters:
context- the reading context to usejsonb- whether to use JSONB binary formatutf8- whether to use UTF-8 encoding- Since:
- 2.0.51
-
-
Method Details
-
current
public final char current()Gets the current character being processed by the reader.- Returns:
- The current character
-
isEnd
public boolean isEnd()Checks if the reader has reached the end of the input.- Returns:
- true if at the end of input, false otherwise
-
getType
public byte getType()Gets the type of the current JSON value. This method returns a byte value representing the type of the current JSON value being processed by the reader.- Returns:
- The type of the current JSON value, or -128 if not applicable
- Since:
- 2.0.51
-
isInt
public boolean isInt()Checks if the current character represents the start of an integer value.- Returns:
- true if the current character is '-', '+', or a digit, false otherwise
-
isNull
public abstract boolean isNull()Checks if the current JSON value is null.- Returns:
- true if the current value is null, false otherwise
-
hasComma
public final boolean hasComma()Checks if the reader has encountered a comma.- Returns:
- true if a comma was encountered, false otherwise
-
readNullOrNewDate
Reads a Date value from JSON data, returning null if the value is null.- Returns:
- The Date value, or null if the value is null in JSON
-
nextIfNull
public abstract boolean nextIfNull()Checks if the current JSON value is null and advances the reader if it is.- Returns:
- true if the current value is null, false otherwise
-
getContext
Gets the reading context for this JSONReader.- Returns:
- The Context object
-
errorOnNoneSerializable
Throws a JSONException if the specified class is not serializable and the ErrorOnNoneSerializable feature is enabled.- Parameters:
objectClass- The class to check for serializability- Throws:
JSONException- if the class is not serializable and the feature is enabled
-
isEnabled
Checks if a specific feature is enabled in the reading context.- Parameters:
feature- The feature to check- Returns:
- true if the feature is enabled, false otherwise
-
getLocale
Gets the locale used for parsing in this JSONReader.- Returns:
- The Locale object
-
getZoneId
Gets the zone ID used for date/time parsing in this JSONReader.- Returns:
- The ZoneId object
-
features
public final long features(long features) Combines the context features with the specified additional features.- Parameters:
features- Additional features to combine with context features- Returns:
- The combined features bitmask
-
getRawInt
public abstract int getRawInt()Gets the raw integer value from the current position in the JSON data.- Returns:
- The raw integer value
-
getRawLong
public abstract long getRawLong()Gets the raw long value from the current position in the JSON data.- Returns:
- The raw long value
-
nextIfName4Match2
public abstract boolean nextIfName4Match2()Checks if the next field name matches a 2-character pattern. This method is used for optimized field name matching in JSONB format.- Returns:
- true if the field name matches the 2-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match2
public boolean nextIfValue4Match2()Checks if the next value matches a 2-character pattern. This method is used for optimized value matching in JSONB format.- Returns:
- true if the value matches the 2-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match3
public abstract boolean nextIfName4Match3()Checks if the next field name matches a 3-character pattern. This method is used for optimized field name matching in JSONB format.- Returns:
- true if the field name matches the 3-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match3
public boolean nextIfValue4Match3()Checks if the next value matches a 3-character pattern. This method is used for optimized value matching in JSONB format.- Returns:
- true if the value matches the 3-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match4
public abstract boolean nextIfName4Match4(byte c4) Checks if the next field name matches a 4-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
c4- the fourth character to match- Returns:
- true if the field name matches the 4-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match4
public boolean nextIfValue4Match4(byte c4) Checks if the next value matches a 4-character pattern. This method is used for optimized value matching in JSONB format.- Parameters:
c4- the fourth character to match- Returns:
- true if the value matches the 4-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match5
public abstract boolean nextIfName4Match5(int name1) Checks if the next field name matches a 5-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 4 bytes of the name to match- Returns:
- true if the field name matches the 5-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match5
public boolean nextIfValue4Match5(byte c4, byte c5) Checks if the next value matches a 5-character pattern. This method is used for optimized value matching in JSONB format.- Parameters:
c4- the fourth character to matchc5- the fifth character to match- Returns:
- true if the value matches the 5-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match6
public abstract boolean nextIfName4Match6(int name1) Checks if the next field name matches a 6-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 4 bytes of the name to match- Returns:
- true if the field name matches the 6-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match6
public boolean nextIfValue4Match6(int name1) Checks if the next value matches a 6-character pattern. This method is used for optimized value matching in JSONB format.- Parameters:
name1- the first 4 bytes of the name to match- Returns:
- true if the value matches the 6-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match7
public abstract boolean nextIfName4Match7(int name1) Checks if the next field name matches a 7-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 4 bytes of the name to match- Returns:
- true if the field name matches the 7-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match7
public boolean nextIfValue4Match7(int name1) Checks if the next value matches a 7-character pattern. This method is used for optimized value matching in JSONB format.- Parameters:
name1- the first 4 bytes of the name to match- Returns:
- true if the value matches the 7-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match8
public abstract boolean nextIfName4Match8(int name1, byte c8) Checks if the next field name matches an 8-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 4 bytes of the name to matchc8- the eighth character to match- Returns:
- true if the field name matches the 8-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match8
public boolean nextIfValue4Match8(int name1, byte c8) Checks if the next value matches an 8-character pattern. This method is used for optimized value matching in JSONB format.- Parameters:
name1- the first 4 bytes of the name to matchc8- the eighth character to match- Returns:
- true if the value matches the 8-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match9
public abstract boolean nextIfName4Match9(long name1) Checks if the next field name matches a 9-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to match- Returns:
- true if the field name matches the 9-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match9
public boolean nextIfValue4Match9(int name1, byte c8, byte c9) Checks if the next value matches a 9-character pattern. This method is used for optimized value matching in JSONB format.- Parameters:
name1- the first 4 bytes of the name to matchc8- the eighth character to matchc9- the ninth character to match- Returns:
- true if the value matches the 9-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match10
public abstract boolean nextIfName4Match10(long name1) Checks if the next field name matches a 10-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to match- Returns:
- true if the field name matches the 10-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match10
public boolean nextIfValue4Match10(long name1) Checks if the next value matches a 10-character pattern. This method is used for optimized value matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to match- Returns:
- true if the value matches the 10-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match11
public abstract boolean nextIfName4Match11(long name1) Checks if the next field name matches an 11-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to match- Returns:
- true if the field name matches the 11-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfValue4Match11
public boolean nextIfValue4Match11(long name1) Checks if the next value matches an 11-character pattern. This method is used for optimized value matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to match- Returns:
- true if the value matches the 11-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match12
public abstract boolean nextIfName4Match12(long name1, byte name2) Checks if the next field name matches a 12-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to matchname2- the last 4 bytes of the name to match- Returns:
- true if the field name matches the 12-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match13
public abstract boolean nextIfName4Match13(long name1, int name2) Checks if the next field name matches a 13-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to matchname2- the last 4 bytes of the name to match- Returns:
- true if the field name matches the 13-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match14
public boolean nextIfName4Match14(long name1, int name2) Checks if the next field name matches a 14-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to matchname2- the last 4 bytes of the name to match- Returns:
- true if the field name matches the 14-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match15
public boolean nextIfName4Match15(long name1, int name2) Checks if the next field name matches a 15-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to matchname2- the last 4 bytes of the name to match- Returns:
- true if the field name matches the 15-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match16
public abstract boolean nextIfName4Match16(long name1, int name2, byte name3) Checks if the next field name matches a 16-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 16-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match17
public abstract boolean nextIfName4Match17(long name1, long name2) Checks if the next field name matches a 17-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to matchname2- the last 8 bytes of the name to match- Returns:
- true if the field name matches the 17-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match18
public abstract boolean nextIfName4Match18(long name1, long name2) Checks if the next field name matches an 18-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to matchname2- the last 8 bytes of the name to match- Returns:
- true if the field name matches the 18-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match19
public boolean nextIfName4Match19(long name1, long name2) Checks if the next field name matches a 19-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
name1- the first 8 bytes of the name to matchname2- the last 8 bytes of the name to match- Returns:
- true if the field name matches the 19-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match20
public abstract boolean nextIfName4Match20(long name1, long name2, byte name3) Checks if the next field name matches a 20-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 20-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match21
public boolean nextIfName4Match21(long name1, long name2, int name3) Checks if the next field name matches a 21-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 21-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match22
public abstract boolean nextIfName4Match22(long name1, long name2, int name3) Checks if the next field name matches a 22-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 22-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match23
public abstract boolean nextIfName4Match23(long name1, long name2, int name3) Checks if the next field name matches a 23-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 23-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match24
public abstract boolean nextIfName4Match24(long name1, long name2, int name3, byte name4) Checks if the next field name matches a 24-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 24-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match25
public abstract boolean nextIfName4Match25(long name1, long name2, long name3) Checks if the next field name matches a 25-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 25-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match26
public abstract boolean nextIfName4Match26(long name1, long name2, long name3) Checks if the next field name matches a 26-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 26-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match27
public abstract boolean nextIfName4Match27(long name1, long name2, long name3) Checks if the next field name matches a 27-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 27-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match28
public abstract boolean nextIfName4Match28(long name1, long name2, long name3, byte c28) Checks if the next field name matches a 28-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 28-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match29
public abstract boolean nextIfName4Match29(long name1, long name2, long name3, int name4) Checks if the next field name matches a 29-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 29-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match30
public abstract boolean nextIfName4Match30(long name1, long name2, long name3, int name4) Checks if the next field name matches a 30-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 30-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match31
public abstract boolean nextIfName4Match31(long name1, long name2, long name3, int name4) Checks if the next field name matches a 31-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 31-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match32
public abstract boolean nextIfName4Match32(long name1, long name2, long name3, int name4, byte c32) Checks if the next field name matches a 32-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 32-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match33
public abstract boolean nextIfName4Match33(long name1, long name2, long name3, long name4) Checks if the next field name matches a 33-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 33-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match34
public abstract boolean nextIfName4Match34(long name1, long name2, long name3, long name4) Checks if the next field name matches a 34-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 34-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match35
public abstract boolean nextIfName4Match35(long name1, long name2, long name3, long name4) Checks if the next field name matches a 35-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 35-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match36
public abstract boolean nextIfName4Match36(long name1, long name2, long name3, long name4, byte c35) Checks if the next field name matches a 36-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 36-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match37
public abstract boolean nextIfName4Match37(long name1, long name2, long name3, long name4, int name5) Checks if the next field name matches a 37-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 37-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match38
public abstract boolean nextIfName4Match38(long name1, long name2, long name3, long name4, int name5) Checks if the next field name matches a 38-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 38-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match39
public abstract boolean nextIfName4Match39(long name1, long name2, long name3, long name4, int name5) Checks if the next field name matches a 39-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 39-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match40
public 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. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 40-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match41
public abstract boolean nextIfName4Match41(long name1, long name2, long name3, long name4, long name5) Checks if the next field name matches a 41-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 41-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match42
public abstract boolean nextIfName4Match42(long name1, long name2, long name3, long name4, long name5) Checks if the next field name matches a 42-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 42-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName4Match43
public abstract boolean nextIfName4Match43(long name1, long name2, long name3, long name4, long name5) Checks if the next field name matches a 43-character pattern. This method is used for optimized field name matching in JSONB format.- Parameters:
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 match- Returns:
- true if the field name matches the 43-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName8Match0
public boolean nextIfName8Match0()Checks if the next field name matches an 8-character pattern with no additional characters. This method is used for optimized field name matching in JSONB format.- Returns:
- true if the field name matches the 8-character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName8Match1
public boolean nextIfName8Match1()Checks if the next field name matches an 8-character pattern with 1 additional character. This method is used for optimized field name matching in JSONB format.- Returns:
- true if the field name matches the 8+1 character pattern, false otherwise
- Since:
- 2.0.51
-
nextIfName8Match2
public boolean nextIfName8Match2()Checks if the next field name matches an 8-character pattern with 2 additional characters. This method is used for optimized field name matching in JSONB format.- Returns:
- true if the field name matches the 8+2 character pattern, false otherwise
- Since:
- 2.0.51
-
handleResolveTasks
Handles resolve tasks for circular references in the JSON data. This method processes all pending reference resolution tasks after the main parsing is complete, resolving circular references and updating the object graph.- Parameters:
root- The root object of the parsed JSON structure
-
getObjectReader
Gets an ObjectReader for the specified type from the context's provider.- Parameters:
type- The type for which to get an ObjectReader- Returns:
- An ObjectReader for the specified type
-
isSupportSmartMatch
public final boolean isSupportSmartMatch()Checks if the SmartMatch feature is enabled in the context.- Returns:
- true if SmartMatch is enabled, false otherwise
-
isInitStringFieldAsEmpty
public final boolean isInitStringFieldAsEmpty()Checks if the InitStringFieldAsEmpty feature is enabled in the context.- Returns:
- true if InitStringFieldAsEmpty is enabled, false otherwise
-
isSupportSmartMatch
public final boolean isSupportSmartMatch(long features) Checks if the SmartMatch feature is enabled, considering additional features.- Parameters:
features- Additional features to consider- Returns:
- true if SmartMatch is enabled with the given features, false otherwise
-
isSupportBeanArray
public final boolean isSupportBeanArray()Checks if the SupportArrayToBean feature is enabled in the context.- Returns:
- true if SupportArrayToBean is enabled, false otherwise
-
isSupportBeanArray
public final boolean isSupportBeanArray(long features) Checks if the SupportArrayToBean feature is enabled, considering additional features.- Parameters:
features- Additional features to consider- Returns:
- true if SupportArrayToBean is enabled with the given features, false otherwise
-
isSupportAutoType
public final boolean isSupportAutoType(long features) Checks if the SupportAutoType feature is enabled, considering additional features.- Parameters:
features- Additional features to consider- Returns:
- true if SupportAutoType is enabled with the given features, false otherwise
-
isSupportAutoTypeOrHandler
public final boolean isSupportAutoTypeOrHandler(long features) Checks if the SupportAutoType feature or handler is enabled, considering additional features.- Parameters:
features- Additional features to consider- Returns:
- true if SupportAutoType or a handler is enabled with the given features, false otherwise
-
isJSONB
public final boolean isJSONB()Checks if this reader is using JSONB binary format.- Returns:
- true if using JSONB format, false otherwise
-
isIgnoreNoneSerializable
public final boolean isIgnoreNoneSerializable()Checks if the IgnoreNoneSerializable feature is enabled in the context.- Returns:
- true if IgnoreNoneSerializable is enabled, false otherwise
-
hasAutoTypeBeforeHandler
public boolean hasAutoTypeBeforeHandler()Checks if there is an auto-type before handler configured in the context.- Returns:
- true if there is an auto-type before handler, false otherwise
-
checkAutoType
Checks the auto type for the specified class and hash, considering additional features.- Parameters:
expectClass- The expected classexpectClassHash- The expected class hashfeatures- Additional features to consider- Returns:
- An ObjectReader for the auto-detected type, or null if not found
-
nextIfObjectStart
public abstract boolean nextIfObjectStart()Checks if the current character is the start of a JSON object ('{') and advances the reader if it is.- Returns:
- true if the current character is '{', false otherwise
-
nextIfNullOrEmptyString
public abstract boolean nextIfNullOrEmptyString()Checks if the current value is a null or empty string and advances the reader if it is.- Returns:
- true if the current value is null or an empty string, false otherwise
-
nextIfObjectEnd
public abstract boolean nextIfObjectEnd()Checks if the current character is the end of a JSON object ('}') and advances the reader if it is.- Returns:
- true if the current character is '}', false otherwise
-
startArray
public int startArray()Starts reading a JSON array, advancing the reader to the first element.- Returns:
- The maximum integer value as a placeholder
- Throws:
JSONException- if the current character is not the start of an array ('[')
-
isReference
public abstract boolean isReference()Checks if the current value represents a reference.- Returns:
- true if the current value represents a reference, false otherwise
-
readReference
Reads a reference value from JSON data.- Returns:
- The reference value as a string
-
readReference
Reads a reference value from JSON data and adds it to the specified list at the given index.- Parameters:
list- The list to which the reference should be addedi- The index at which to add the reference in the list- Returns:
- true if a reference was read and added, false otherwise
-
readReference
Reads a reference value from JSON data and adds it to the specified collection at the given index.- Parameters:
list- The collection to which the reference should be addedi- The index at which to add the reference in the collection- Returns:
- true if a reference was read and added, false otherwise
-
addResolveTask
-
addResolveTask
-
addResolveTask
-
addResolveTask
-
isArray
public boolean isArray()Checks if the current character represents the start of a JSON array.- Returns:
- true if the current character is '[', false otherwise
-
isObject
public boolean isObject()Checks if the current character represents the start of a JSON object.- Returns:
- true if the current character is '{', false otherwise
-
isNumber
public boolean isNumber()Checks if the current character represents the start of a JSON number.- Returns:
- true if the current character is a digit or sign, false otherwise
-
isString
public boolean isString()Checks if the current character represents the start of a JSON string.- Returns:
- true if the current character is a quote, false otherwise
-
endArray
public void endArray()Advances the reader to the end of the current JSON array. -
nextIfMatch
public abstract boolean nextIfMatch(char ch) Checks if the current character matches the specified character and advances the reader if it does.- Parameters:
ch- The character to match- Returns:
- true if the current character matches the specified character, false otherwise
-
nextIfComma
public abstract boolean nextIfComma()Checks if the current character is a comma (',') and advances the reader if it is.- Returns:
- true if the current character is a comma, false otherwise
-
nextIfArrayStart
public abstract boolean nextIfArrayStart()Checks if the current character is the start of a JSON array ('[') and advances the reader if it is.- Returns:
- true if the current character is '[', false otherwise
-
nextIfArrayEnd
public abstract boolean nextIfArrayEnd()Checks if the current character is the end of a JSON array (']') and advances the reader if it is.- Returns:
- true if the current character is ']', false otherwise
-
nextIfSet
public abstract boolean nextIfSet()Checks if the current value represents a Set and advances the reader if it is. This method is used to detect Set-type collections during JSON parsing.- Returns:
- true if the current value represents a Set, false otherwise
- Since:
- 2.0.51
-
nextIfInfinity
public abstract boolean nextIfInfinity()Checks if the current value represents infinity and advances the reader if it is. This method is used to detect infinity values during JSON parsing.- Returns:
- true if the current value represents infinity, false otherwise
- Since:
- 2.0.51
-
readPattern
Reads a pattern string from the JSON data. This method is used to read regular expression patterns or other pattern strings.- Returns:
- The pattern string read from the JSON data
- Since:
- 2.0.51
-
getOffset
public final int getOffset() -
next
public abstract void next()Advances the reader to the next character in the JSON data. -
nextWithoutComment
public void nextWithoutComment()Advances the reader to the next character in the JSON data, skipping comment processing. -
readValueHashCode
public abstract long readValueHashCode()Reads the hash code of the current JSON value.- Returns:
- The hash code of the current value
-
readTypeHashCode
public long readTypeHashCode()Reads the hash code of the current type in the JSON data.- Returns:
- The hash code of the current type
-
readFieldNameHashCode
public abstract long readFieldNameHashCode()Reads the hash code of the current field name in a JSON object.- Returns:
- The hash code of the current field name
-
getNameHashCodeLCase
public abstract long getNameHashCodeLCase()Reads the hash code of the current field name in lowercase.- Returns:
- The hash code of the current field name in lowercase
-
readFieldName
Reads the current field name in a JSON object.- Returns:
- The current field name
-
getFieldName
Gets the current field name in a JSON object.- Returns:
- The current field name
-
setTypeRedirect
public final void setTypeRedirect(boolean typeRedirect) Sets the type redirect flag for this reader.- Parameters:
typeRedirect- true to enable type redirection, false to disable
-
isTypeRedirect
public final boolean isTypeRedirect()Checks if type redirection is enabled for this reader.- Returns:
- true if type redirection is enabled, false otherwise
-
readFieldNameHashCodeUnquote
public abstract long readFieldNameHashCodeUnquote()Reads the hash code of the current field name in a JSON object without requiring quotes.- Returns:
- The hash code of the current field name
-
readFieldNameUnquote
Reads the current field name in a JSON object without requiring quotes.- Returns:
- The current field name
- Throws:
JSONException- if the field name is null or empty
-
skipName
public abstract boolean skipName()Skips the current field name in a JSON object.- Returns:
- true if the field name was successfully skipped, false otherwise
-
skipValue
public abstract void skipValue()Skips the current JSON value, advancing the reader to the next value or end of the current structure. -
isBinary
public boolean isBinary()Checks if the current value represents binary data.- Returns:
- true if the current value is binary data, false otherwise
-
readHex
public abstract byte[] readHex()Reads a hexadecimal string from JSON data and converts it to a byte array.- Returns:
- The byte array representation of the hexadecimal string
-
readBinary
public byte[] readBinary()Reads binary data from JSON data.- Returns:
- The byte array representation of the binary data
- Throws:
JSONException- if there is an error parsing the binary data
-
readInt32Value
public abstract int readInt32Value()Reads a 32-bit integer value from JSON data.- Returns:
- The 32-bit integer value
-
readInt32ValueArray
public int[] readInt32ValueArray()Reads an array of 32-bit integer values from JSON data.- Returns:
- The array of 32-bit integer values
- Throws:
JSONException- if there is an error parsing the JSON
-
nextIfMatch
public boolean nextIfMatch(byte type) Checks if the next value matches the specified type and advances the reader if it does.- Parameters:
type- The type to match- Returns:
- true if the next value matches the specified type, false otherwise
- Throws:
JSONException- as this operation is not supported
-
nextIfMatchTypedAny
public boolean nextIfMatchTypedAny()Checks if the next value matches any type and advances the reader if it does.- Returns:
- true if the next value matches any type, false otherwise
- Throws:
JSONException- as this operation is not supported
-
nextIfMatchIdent
public abstract boolean nextIfMatchIdent(char c0, char c1) -
nextIfMatchIdent
public abstract boolean nextIfMatchIdent(char c0, char c1, char c2) -
nextIfMatchIdent
public abstract boolean nextIfMatchIdent(char c0, char c1, char c2, char c3) -
nextIfMatchIdent
public abstract boolean nextIfMatchIdent(char c0, char c1, char c2, char c3, char c4) -
nextIfMatchIdent
public abstract boolean nextIfMatchIdent(char c0, char c1, char c2, char c3, char c4, char c5) -
readInt8
Reads a Byte object from JSON data.- Returns:
- The Byte object, or null if the value is null in JSON
-
readInt8Value
public byte readInt8Value()Reads a byte value from JSON data.- Returns:
- The byte value
-
readInt16
Reads a Short object from JSON data.- Returns:
- The Short object, or null if the value is null in JSON
-
readInt16Value
public short readInt16Value()Reads a short value from JSON data.- Returns:
- The short value
-
readInt32
Reads an Integer object from JSON data.- Returns:
- The Integer object, or null if the value is null in JSON
-
readInt32ValueOverflow
protected final int readInt32ValueOverflow()Reads a 32-bit integer value from JSON data, handling overflow conditions.- Returns:
- The 32-bit integer value
-
readInt64ValueOverflow
protected final long readInt64ValueOverflow()Reads a 64-bit long value from JSON data, handling overflow conditions.- Returns:
- The 64-bit long value
-
getInt32Value
public final int getInt32Value() -
getInt64Value
public final long getInt64Value() -
getDoubleValue
public final double getDoubleValue() -
getFloatValue
public final float getFloatValue() -
readInt64ValueArray
public long[] readInt64ValueArray()Reads an array of 64-bit long values from JSON data.- Returns:
- The array of 64-bit long values
- Throws:
JSONException- if there is an error parsing the JSON
-
readInt64Value
public abstract long readInt64Value()Reads a 64-bit long value from JSON data.- Returns:
- The 64-bit long value
-
readInt64
Reads a Long object from JSON data.- Returns:
- The Long object, or null if the value is null in JSON
-
readFloatValue
public abstract float readFloatValue()Reads a float value from JSON data.- Returns:
- The float value
-
readFloat
Reads a Float object from JSON data.- Returns:
- The Float object, or null if the value is null in JSON
-
readDoubleValue
public abstract double readDoubleValue()Reads a double value from JSON data.- Returns:
- The double value
-
readDouble
Reads a Double object from JSON data.- Returns:
- The Double object, or null if the value is null in JSON
-
readNumber
Reads a Number value from JSON data.- Returns:
- The Number value
-
readBigInteger
Reads a BigInteger value from JSON data.- Returns:
- The BigInteger value
-
readBigDecimal
Reads a BigDecimal value from JSON data.- Returns:
- The BigDecimal value
-
readUUID
Reads a UUID value from JSON data.- Returns:
- The UUID value
-
readLocalDate
Reads a LocalDate value from JSON data.- Returns:
- The LocalDate value, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the date
-
readLocalDateTime
Reads a LocalDateTime value from JSON data.- Returns:
- The LocalDateTime value, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the date/time
-
readOffsetDateTime
-
readZonedDateTime
Reads a ZonedDateTime value from JSON data.- Returns:
- The ZonedDateTime value, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the date/time
-
readOffsetTime
-
readCalendar
Reads a Calendar value from JSON data.- Returns:
- The Calendar value, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the date
-
readDate
Reads a Date value from JSON data.- Returns:
- The Date value, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the date
-
readLocalTime
Reads a LocalTime value from JSON data.- Returns:
- The LocalTime value, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the time
-
getStringLength
protected abstract int getStringLength()Gets the length of the current string value in the JSON data.- Returns:
- The length of the current string value
-
isDate
public boolean isDate()Checks if the current value represents a date.- Returns:
- true if the current value represents a date, false otherwise
-
readInstant
Reads an Instant value from JSON data.- Returns:
- The Instant value, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the instant
-
readMillisFromString
public final long readMillisFromString()Reads milliseconds from a string value in JSON data.- Returns:
- The milliseconds value
- Throws:
JSONException- if there is an error parsing the string
-
readLocalDateTime12
-
readLocalDateTime14
-
readLocalDateTime16
-
readLocalDateTime17
-
readLocalDateTime18
-
readLocalDateTime19
-
readLocalDateTime20
-
readMillis19
public abstract long readMillis19()Reads milliseconds from a 19-character date string in JSON data.- Returns:
- The milliseconds value
-
readLocalDateTimeX
-
readLocalTime5
-
readLocalTime6
-
readLocalTime7
-
readLocalTime8
-
readLocalTime9
-
readLocalTime10
-
readLocalTime11
-
readLocalTime12
-
readLocalTime15
-
readLocalTime18
-
readLocalDate8
-
readLocalDate9
-
readLocalDate10
-
readLocalDate11
-
readZonedDateTimeX
-
readNumber
Reads a number value from JSON data and passes it to a consumer.- Parameters:
consumer- The consumer to accept the number valuequoted- Whether the number should be quoted in the output
-
readString
Reads a string value from JSON data and passes it to a consumer.- Parameters:
consumer- The consumer to accept the string valuequoted- Whether the string should be quoted in the output
-
readString
Reads a string value from JSON data.- Returns:
- The string value
-
readNumber0
protected abstract void readNumber0()Reads a number value from JSON data and stores it in internal fields. This is a low-level method used by other number reading methods. -
readBase64
public byte[] readBase64()Reads a Base64 encoded string from JSON data and decodes it to bytes.- Returns:
- The decoded byte array
-
readStringArray
Reads a JSON array of strings and returns it as a String array.- Returns:
- The String array, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the JSON
-
readCharValue
public char readCharValue()Reads a character value from JSON data.- Returns:
- The character value
-
readCharacter
Reads a Character object from JSON data.- Returns:
- The Character object, or null if the value is null in JSON
-
readNull
public abstract void readNull()Reads a null value from JSON data and advances the reader. -
readNaN
protected double readNaN() -
readIfNull
public abstract boolean readIfNull()Checks if the current JSON value is null and advances the reader if it is.- Returns:
- true if the current value is null, false otherwise
-
getString
Gets the current string value from the JSON data.- Returns:
- The current string value
-
wasNull
public boolean wasNull() -
read
-
read
-
read
-
readObject
-
readObject
-
read
Reads JSON data into a Map using a specified ObjectReader for the values.- Parameters:
object- The Map to populate with dataitemReader- The ObjectReader to use for reading valuesfeatures- Reader features to apply during reading- Since:
- 2.0.35
-
read
Reads JSON data into a Map with specified features.- Parameters:
object- The Map to populate with datafeatures- Reader features to apply during reading
-
read
Reads JSON data into a Map with specified key and value types.- Parameters:
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 reading
-
read
-
readObject
Reads JSON data and returns it as a Map.- Returns:
- A Map representation of the JSON data
- Throws:
JSONException- if there is an error parsing the JSON
-
skipComment
public abstract void skipComment()Skips a comment in the JSON data, advancing the reader to the end of the comment. -
readBool
Reads a boolean value from JSON data.- Returns:
- The boolean value, or null if the value is null in JSON
- Throws:
JSONException- if there is an error parsing the JSON
-
readBoolValue
public abstract boolean readBoolValue()Reads a boolean value from JSON data.- Returns:
- The boolean value
-
readAny
Reads any JSON value and returns it as an Object.- Returns:
- The JSON value as an Object
-
readArray
Reads a JSON array with elements of a specified type.- Parameters:
itemType- The type of elements in the array- Returns:
- A List containing the array elements
-
readList
Reads a JSON array with elements of specified types.- Parameters:
types- The types of elements in the array- Returns:
- A List containing the array elements
-
readArray
Reads a JSON array with elements of specified types into an Object array.- Parameters:
types- The types of elements in the array- Returns:
- An Object array containing the array elements
-
readArray
-
readArray
-
readJSONArray
Reads a JSON array and returns it as a JSONArray.- Returns:
- A JSONArray representation of the JSON array
-
readJSONObject
Reads a JSON object and returns it as a JSONObject.- Returns:
- A JSONObject representation of the JSON object
-
readArray
Reads a JSON array and returns it as a List.- Returns:
- A List representation of the JSON array
-
getBigInteger
-
getBigDecimal
-
getNumber
-
close
public abstract void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toInt32
-
toInt64
-
toLong
-
toInt
-
toNumber
-
decimal
-
toNumber
-
toString
-
toString
-
of
Creates a JSONReader from a byte array containing UTF-8 encoded JSON.- Parameters:
utf8Bytes- The byte array containing UTF-8 encoded JSON- Returns:
- A JSONReader instance
-
of
Deprecated. -
of
-
of
Creates a JSONReader from a character array containing JSON data.- Parameters:
chars- The character array containing JSON data- Returns:
- A JSONReader instance
-
of
Deprecated. -
of
-
ofJSONB
Creates a JSONReader from a byte array containing JSONB (binary JSON) data.- Parameters:
jsonbBytes- The byte array containing JSONB data- Returns:
- A JSONReader instance for JSONB data
-
ofJSONB
Deprecated. -
ofJSONB
-
ofJSONB
-
ofJSONB
-
ofJSONB
-
ofJSONB
-
ofJSONB
-
of
-
of
public static JSONReader of(byte[] bytes, int offset, int length, Charset charset, JSONReader.Context context) -
of
-
of
-
of
-
of
-
of
- Throws:
IOException
-
of
Creates a JSONReader from an InputStream containing JSON data.- Parameters:
is- The InputStream containing JSON datacharset- The character encoding of the JSON data- Returns:
- A JSONReader instance
-
of
-
of
Creates a JSONReader from a Reader containing JSON data.- Parameters:
is- The Reader containing JSON data- Returns:
- A JSONReader instance
-
of
-
of
-
of
-
of
Deprecated. -
of
Creates a JSONReader from a String containing JSON data.- Parameters:
str- The String containing JSON data- Returns:
- A JSONReader instance
-
of
-
of
Creates a JSONReader from a substring of a String containing JSON data.- Parameters:
str- The String containing JSON dataoffset- The starting position of the substringlength- The length of the substring- Returns:
- A JSONReader instance
-
of
-
autoTypeFilter
-
autoTypeFilter
public static JSONReader.AutoTypeBeforeHandler autoTypeFilter(boolean includeBasic, String... names) -
autoTypeFilter
-
autoTypeFilter
-
mark
-
reset
-
info
-
info
-
getObjectReaderAutoType
Gets an ObjectReader for the specified type hash, expected class, and features. This method handles auto-type detection and applies any configured auto-type before handlers.- Parameters:
typeHash- The hash code of the typeexpectClass- The expected classfeatures- Additional features to consider- Returns:
- An ObjectReader for the specified type, or null if not found
-
readStringNotMatch
-
stringValue
-