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 enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected charprotected booleanprotected Objectprotected byteprotected 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(String... names) checkAutoType(Class expectClass, long expectClassHash, long features) voidclose()final charcurrent()voidendArray()longfeatures(long features) abstract Stringintprotected LonggetInt64()protected longabstract longgetObjectReader(Type type) final intabstract Stringprotected abstract intbytegetType()protected ZoneIdgetZoneId(LocalDateTime ldt, String zoneIdStr) voidhandleResolveTasks(Object root) booleanisArray()booleanisBinary()booleanisEnabled(JSONReader.Feature feature) final booleanisEnd()booleanbooleanisInt()booleanisJSONB()booleanbooleanabstract booleanisNull()booleanisNumber()booleanisObject()booleanbooleanisString()booleanisSupportAutoType(long features) booleanbooleanisSupportBeanArray(long features) booleanbooleanisSupportSmartMatch(long features) booleanabstract voidnext()booleannextIfMatch(byte type) booleannextIfMatch(byte[] bytes) booleannextIfMatch(char ch) abstract booleanbooleanbooleanbooleanstatic JSONReaderof(byte[] utf8Bytes) static JSONReaderof(byte[] bytes, int offset, int length) static JSONReaderstatic JSONReaderof(char[] chars) static JSONReaderof(char[] chars, int offset, int length) static JSONReaderof(JSONReader.Context context, byte[] utf8Bytes) static JSONReaderof(JSONReader.Context context, char[] chars) static JSONReaderof(JSONReader.Context context, String str) static JSONReaderof(InputStream is, Charset charset) static JSONReaderstatic JSONReaderstatic JSONReaderstatic JSONReaderofJSONB(byte[] jsonbBytes) static JSONReaderofJSONB(byte[] bytes, int offset, int length) static JSONReaderofJSONB(byte[] bytes, int offset, int length, JSONB.SymbolTable symbolTable) static JSONReaderofJSONB(byte[] jsonbBytes, JSONReader.Feature... features) static JSONReaderofJSONB(JSONReader.Context context, byte[] jsonbBytes) <T> T<T> TreadAny()byte[]readBool()booleanchardoubleabstract Stringabstract longlongfloatabstract booleanabstract intabstract Longabstract longprotected abstract LocalDateTimeprotected LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimeprotected LocalDateTimeprotected LocalDateTimeprotected LocalDateTimeprotected abstract LocalDateTimeprotected abstract LocalDateTimereadLocalDateTimeX(int len) protected LocalTimeprotected LocalTimeprotected abstract LocalTimeprotected abstract LocalTimeprotected abstract LocalTimelongabstract voidreadNull()voidreadNumber(ValueConsumer consumer, boolean quoted) protected abstract voidabstract Stringabstract StringvoidreadString(ValueConsumer consumer, boolean quoted) longabstract UUIDreadUUID()abstract longprotected ZonedDateTimereadZonedDateTimeX(int len) voidsetTypeRedirect(boolean typeRedirect) voidbooleanskipName()abstract voidintprotected final intprotected final intprotected final longprotected final longprotected final Numberprotected final Numberprotected final Stringprotected final StringbooleanwasNull()
-
Field Details
-
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 byte 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
-
-
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() -
readNullOrNewDate
-
nextIfNull
public abstract boolean nextIfNull() -
getContext
-
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() -
nextIfObjectEnd
public boolean nextIfObjectEnd() -
startArray
public int startArray() -
isReference
public 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 boolean nextIfMatch(char ch) -
nextIfSet
public boolean nextIfSet() -
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 long readFieldNameHashCodeUnquote() -
readFieldNameUnquote
-
skipName
public boolean skipName() -
skipValue
public abstract void skipValue() -
isBinary
public boolean isBinary() -
readBinary
public byte[] readBinary() -
readInt32Value
public abstract int readInt32Value() -
nextIfMatch
public boolean nextIfMatch(byte[] bytes) -
nextIfMatch
public boolean nextIfMatch(byte type) -
readInt32
-
getInt32Value
public int getInt32Value() -
getInt64Value
protected long getInt64Value() -
getInt64
-
readInt64Value
public abstract long readInt64Value() -
readInt64
-
readFloatValue
public float readFloatValue() -
readFloat
-
readDoubleValue
public 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
-
readLocalDateTimeX
-
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
-
readObject
-
skipLineComment
public void skipLineComment() -
readBool
-
readBoolValue
public boolean readBoolValue() -
readAny
-
readArray
-
readArray
-
getBigInteger
-
getBigDecimal
-
getNumber
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toInt32
-
toInt64
-
toLong
-
toInt
-
toNumber
-
toNumber
-
toString
-
toString
-
of
-
of
-
of
-
of
-
ofJSONB
-
ofJSONB
-
ofJSONB
-
ofJSONB
-
ofJSONB
public static JSONReader ofJSONB(byte[] bytes, int offset, int length, JSONB.SymbolTable symbolTable) -
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
autoTypeFilter
-
getZoneId
-