Class JsonIterator
java.lang.Object
com.jsoniter.JsonIterator
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[](package private) Objectprivate static final JsonIterator.ReadArrayCallbackprivate static final JsonIterator.ReadObjectCallback(package private) int(package private) InputStreamprivate static boolean(package private) char[](package private) final Slice(package private) int(package private) int(package private) static final ValueType[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateJsonIterator(InputStream in, byte[] buf, int head, int tail) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()final Stringprivate Configstatic final Anydeserialize(byte[] input) static final <T> Tdeserialize(byte[] input, TypeLiteral<T> typeLiteral) static final <T> Tdeserialize(byte[] input, Class<T> clazz) static final Anydeserialize(Config config, byte[] input) static final <T> Tdeserialize(Config config, byte[] input, TypeLiteral<T> typeLiteral) static final <T> Tdeserialize(Config config, byte[] input, Class<T> clazz) static final Anydeserialize(Config config, String input) static final <T> Tdeserialize(Config config, String input, TypeLiteral<T> typeLiteral) static final <T> Tdeserialize(Config config, String input, Class<T> clazz) static final Anydeserialize(String input) static final <T> Tdeserialize(String input, TypeLiteral<T> typeLiteral) static final <T> Tdeserialize(String input, Class<T> clazz) static voidprivate static intfindLastNotSpacePos(byte[] input) static JsonIteratorparse(byte[] buf) static JsonIteratorparse(byte[] buf, int head, int tail) static JsonIteratorstatic JsonIteratorparse(InputStream in, int bufSize) static JsonIteratorfinal Objectread()final <T> Tread(TypeLiteral<T> typeLiteral) final <T> Tread(TypeLiteral<T> typeLiteral, T existingObject) try to bind to existing object, returned object might not the same instancefinal <T> Tfinal Objectfinal <T> Tread(T existingObject) try to bind to existing object, returned object might not the same instancefinal AnyreadAny()final booleanfinal booleanreadArrayCB(JsonIterator.ReadArrayCallback callback, Object attachment) final BigDecimalfinal BigIntegerfinal booleanfinal doublefinal floatfinal intreadInt()final longreadLong()final booleanreadNull()final Stringfinal voidreadObjectCB(JsonIterator.ReadObjectCallback cb, Object attachment) final shortfinal Stringfinal Slicefinal JsonExceptionreportError(String op, String msg) final voidreset(byte[] buf) final voidreset(byte[] buf, int head, int tail) final voidfinal voidreset(InputStream in) static voidsetMode(DecodingMode mode) voidskip()(package private) final void
-
Field Details
-
configCache
-
isStreamingEnabled
private static boolean isStreamingEnabled -
valueTypes
-
in
InputStream in -
buf
byte[] buf -
head
int head -
tail
int tail -
skipStartedAt
int skipStartedAt -
tempObjects
-
reusableSlice
-
reusableChars
char[] reusableChars -
existingObject
Object existingObject -
fillArray
-
fillObject
-
-
Constructor Details
-
JsonIterator
-
JsonIterator
public JsonIterator()
-
-
Method Details
-
parse
-
parse
-
parse
-
parse
-
parse
-
reset
public final void reset(byte[] buf) -
reset
public final void reset(byte[] buf, int head, int tail) -
reset
-
reset
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
unreadByte
final void unreadByte() -
reportError
-
currentBuffer
-
readNull
- Throws:
IOException
-
readBoolean
- Throws:
IOException
-
readShort
- Throws:
IOException
-
readInt
- Throws:
IOException
-
readLong
- Throws:
IOException
-
readArray
- Throws:
IOException
-
readNumberAsString
- Throws:
IOException
-
readArrayCB
public final boolean readArrayCB(JsonIterator.ReadArrayCallback callback, Object attachment) throws IOException - Throws:
IOException
-
readString
- Throws:
IOException
-
readStringAsSlice
- Throws:
IOException
-
readObject
- Throws:
IOException
-
readObjectCB
public final void readObjectCB(JsonIterator.ReadObjectCallback cb, Object attachment) throws IOException - Throws:
IOException
-
readFloat
- Throws:
IOException
-
readDouble
- Throws:
IOException
-
readBigDecimal
- Throws:
IOException
-
readBigInteger
- Throws:
IOException
-
readAny
- Throws:
IOException
-
read
- Throws:
IOException
-
read
try to bind to existing object, returned object might not the same instance- Type Parameters:
T- object type- Parameters:
existingObject- the object instance to reuse- Returns:
- data binding result, might not be the same object
- Throws:
IOException- if I/O went wrong
-
currentConfig
-
read
try to bind to existing object, returned object might not the same instance- Type Parameters:
T- object type- Parameters:
typeLiteral- the type objectexistingObject- the object instance to reuse- Returns:
- data binding result, might not be the same object
- Throws:
IOException- if I/O went wrong
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
whatIsNext
- Throws:
IOException
-
skip
- Throws:
IOException
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
deserialize
-
findLastNotSpacePos
private static int findLastNotSpacePos(byte[] input) -
setMode
-
enableStreamingSupport
public static void enableStreamingSupport()
-