Package com.alibaba.fastjson2
Class JSONReader
java.lang.Object
com.alibaba.fastjson2.JSONReader
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic enumstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected charprotected booleanprotected Objectprotected final JSONReader.Contextprotected char[]protected shortprotected intprotected intprotected intprotected intprotected booleanprotected booleanprotected intprotected byteprotected Stringprotected booleanprotected booleanprotected byteprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResolveTask(FieldReader fieldReader, Object object, JSONPath path) voidaddResolveTask(Object[] object, int i, JSONPath reference) voidaddResolveTask(Collection object, int i, JSONPath reference) 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) abstract voidclose()final charcurrent()voidendArray()voiderrorOnNoneSerializable(Class objectClass) longfeatures(long features) abstract Stringintprotected LonggetInt64()longabstract longgetObjectReader(Type type) final intabstract Stringprotected abstract intbytegetType()voidhandleResolveTasks(Object root) booleanhasComma()info()booleanisArray()booleanisBinary()booleanisEnabled(JSONReader.Feature feature) final booleanisEnd()booleanbooleanisInt()booleanisJSONB()booleanbooleanabstract booleanisNull()booleanisNumber()booleanisObject()abstract booleanbooleanisString()booleanisSupportAutoType(long features) booleanbooleanisSupportBeanArray(long features) booleanbooleanisSupportSmartMatch(long features) booleanmark()abstract voidnext()abstract booleanbooleanbooleannextIfMatch(byte type) abstract booleannextIfMatch(char ch) 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) abstract booleanbooleanbooleanabstract booleanstatic JSONReaderof(byte[] utf8Bytes) static JSONReaderof(byte[] bytes, int offset, int length) 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) 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) static JSONReaderof(InputStream is, Charset charset, JSONReader.Context context) static JSONReaderstatic JSONReaderof(Reader is, JSONReader.Context context) static JSONReaderstatic JSONReaderstatic JSONReaderof(String str, int offset, int length, JSONReader.Context context) static JSONReaderof(String str, JSONReader.Context context) static JSONReaderofJSONB(byte[] jsonbBytes) static JSONReaderofJSONB(byte[] bytes, int offset, int length) 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.<T> T<T> Tvoidread(Collection list) voidvoidvoidreadAny()Object[]voidreadArray(Collection list, Type itemType) voidbyte[]readBool()booleancharabstract doubleabstract Stringabstract longabstract longabstract floatabstract byte[]readHex()abstract booleanabstract Integerabstract intabstract Longabstract longprotected abstract LocalDateprotected abstract LocalDateprotected abstract LocalDateprotected abstract LocalDateprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimereadLocalDateTimeX(int len) protected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeabstract longlongabstract voidreadNull()abstract DatevoidreadNumber(ValueConsumer consumer, boolean quoted) protected abstract voidvoidreadObject(Object object, long features) voidreadObject(Object object, JSONReader.Feature... features) abstract Stringabstract Stringabstract StringvoidreadString(ValueConsumer consumer, boolean quoted) longabstract UUIDreadUUID()abstract longprotected abstract ZonedDateTimereadZonedDateTimeX(int len) voidreset(JSONReader.SavePoint savePoint) voidsetTypeRedirect(boolean typeRedirect) abstract voidabstract booleanskipName()abstract voidintprotected final intprotected final intprotected final longprotected final longprotected final Numberprotected final Numberprotected final Stringprotected final StringbooleanwasNull()
-
Field Details
-
context
-
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 byte scale -
mag0
protected int mag0 -
mag1
protected int mag1 -
mag2
protected int mag2 -
mag3
protected int mag3 -
stringValue
-
complex
-
typeRedirect
protected boolean typeRedirect -
doubleChars
protected char[] doubleChars
-
-
Constructor Details
-
JSONReader
-
-
Method Details
-
current
public final char current() -
isEnd
public final boolean isEnd() -
getType
public byte getType() -
isInt
public boolean isInt() -
isNull
public abstract boolean isNull() -
hasComma
public boolean hasComma() -
readNullOrNewDate
-
nextIfNull
public abstract boolean nextIfNull() -
getContext
-
errorOnNoneSerializable
-
isEnabled
-
getLocale
-
getZoneId
-
features
public long features(long features) -
handleResolveTasks
-
getObjectReader
-
isSupportSmartMatch
public boolean isSupportSmartMatch() -
isSupportSmartMatch
public boolean isSupportSmartMatch(long features) -
isSupportBeanArray
public boolean isSupportBeanArray() -
isSupportBeanArray
public boolean isSupportBeanArray(long features) -
isSupportAutoType
public boolean isSupportAutoType(long features) -
isJSONB
public boolean isJSONB() -
isIgnoreNoneSerializable
public boolean isIgnoreNoneSerializable() -
checkAutoType
-
nextIfObjectStart
public boolean nextIfObjectStart() -
nextIfEmptyString
public abstract boolean nextIfEmptyString() -
nextIfObjectEnd
public boolean nextIfObjectEnd() -
startArray
public int startArray() -
isReference
public abstract boolean isReference() -
readReference
-
addResolveTask
-
addResolveTask
-
addResolveTask
-
addResolveTask
-
isArray
public boolean isArray() -
isObject
public boolean isObject() -
isNumber
public boolean isNumber() -
isString
public boolean isString() -
endArray
public void endArray() -
nextIfMatch
public abstract boolean nextIfMatch(char ch) -
nextIfSet
public abstract boolean nextIfSet() -
nextIfInfinity
public boolean nextIfInfinity() -
readPattern
-
getOffset
public final int getOffset() -
next
public abstract void next() -
readValueHashCode
public abstract long readValueHashCode() -
readTypeHashCode
public long readTypeHashCode() -
readFieldNameHashCode
public abstract long readFieldNameHashCode() -
getNameHashCodeLCase
public abstract long getNameHashCodeLCase() -
readFieldName
-
getFieldName
-
setTypeRedirect
public void setTypeRedirect(boolean typeRedirect) -
isTypeRedirect
public boolean isTypeRedirect() -
readFieldNameHashCodeUnquote
public abstract long readFieldNameHashCodeUnquote() -
readFieldNameUnquote
-
skipName
public abstract boolean skipName() -
skipValue
public abstract void skipValue() -
isBinary
public boolean isBinary() -
readHex
public abstract byte[] readHex() -
readBinary
public byte[] readBinary() -
readInt32Value
public abstract int readInt32Value() -
nextIfMatch
public boolean nextIfMatch(byte type) -
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) -
readInt32
-
getInt32Value
public int getInt32Value() -
getInt64Value
public long getInt64Value() -
getInt64
-
readInt64Value
public abstract long readInt64Value() -
readInt64
-
readFloatValue
public abstract float readFloatValue() -
readFloat
-
readDoubleValue
public abstract double readDoubleValue() -
readDouble
-
readNumber
-
readBigInteger
-
readBigDecimal
-
readUUID
-
isLocalDate
public boolean isLocalDate() -
readLocalDate
-
isLocalDateTime
public boolean isLocalDateTime() -
readLocalDateTime
-
readZonedDateTime
-
readLocalTime
-
getStringLength
protected abstract int getStringLength() -
readInstant
-
readMillisFromString
public long readMillisFromString() -
readLocalDateTime16
-
readLocalDateTime17
-
readLocalDateTime18
-
readLocalDateTime19
-
readMillis19
public abstract long readMillis19() -
readLocalDateTimeX
-
readLocalTime5
-
readLocalTime8
-
readLocalTime10
-
readLocalTime11
-
readLocalTime12
-
readLocalTime18
-
readLocalDate8
-
readLocalDate9
-
readLocalDate10
-
readLocalDate11
-
readZonedDateTimeX
-
readNumber
-
readString
-
readNumber0
protected abstract void readNumber0() -
readString
-
readCharValue
public char readCharValue() -
readNull
public abstract void readNull() -
readIfNull
public abstract boolean readIfNull() -
getString
-
wasNull
public boolean wasNull() -
read
-
read
-
read
-
readObject
-
readObject
-
read
-
read
-
read
-
readObject
-
skipLineComment
public abstract void skipLineComment() -
readBool
-
readBoolValue
public boolean readBoolValue() -
readAny
-
readArray
-
readList
-
readArray
-
readArray
-
readArray
-
readArray
-
getBigInteger
-
getBigDecimal
-
getNumber
-
close
public abstract void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toInt32
-
toInt64
-
toLong
-
toInt
-
toNumber
-
toNumber
-
toString
-
toString
-
of
-
of
Deprecated. -
of
-
of
-
of
Deprecated. -
of
-
ofJSONB
-
ofJSONB
Deprecated. -
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
-
of
-
of
-
of
Deprecated. -
of
-
of
-
of
-
of
-
autoTypeFilter
-
autoTypeFilter
public static JSONReader.AutoTypeBeforeHandler autoTypeFilter(boolean includeBasic, String... names) -
autoTypeFilter
-
autoTypeFilter
-
mark
-
reset
-
info
-
info
-