Package com.jsoniter
Class JsonIterator
java.lang.Object
com.jsoniter.JsonIterator
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[]
(package private) Object
private static final JsonIterator.ReadArrayCallback
private static final JsonIterator.ReadObjectCallback
(package private) int
(package private) InputStream
private static boolean
(package private) char[]
(package private) final Slice
(package private) int
(package private) int
(package private) static final ValueType[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
JsonIterator
(InputStream in, byte[] buf, int head, int tail) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
final String
private Config
static final Any
deserialize
(byte[] input) static final <T> T
deserialize
(byte[] input, TypeLiteral<T> typeLiteral) static final <T> T
deserialize
(byte[] input, Class<T> clazz) static final Any
deserialize
(Config config, byte[] input) static final <T> T
deserialize
(Config config, byte[] input, TypeLiteral<T> typeLiteral) static final <T> T
deserialize
(Config config, byte[] input, Class<T> clazz) static final Any
deserialize
(Config config, String input) static final <T> T
deserialize
(Config config, String input, TypeLiteral<T> typeLiteral) static final <T> T
deserialize
(Config config, String input, Class<T> clazz) static final Any
deserialize
(String input) static final <T> T
deserialize
(String input, TypeLiteral<T> typeLiteral) static final <T> T
deserialize
(String input, Class<T> clazz) static void
private static int
findLastNotSpacePos
(byte[] input) static JsonIterator
parse
(byte[] buf) static JsonIterator
parse
(byte[] buf, int head, int tail) static JsonIterator
static JsonIterator
parse
(InputStream in, int bufSize) static JsonIterator
final Object
read()
final <T> T
read
(TypeLiteral<T> typeLiteral) final <T> T
read
(TypeLiteral<T> typeLiteral, T existingObject) try to bind to existing object, returned object might not the same instancefinal <T> T
final Object
final <T> T
read
(T existingObject) try to bind to existing object, returned object might not the same instancefinal Any
readAny()
final boolean
final boolean
readArrayCB
(JsonIterator.ReadArrayCallback callback, Object attachment) final BigDecimal
final BigInteger
final boolean
final double
final float
final int
readInt()
final long
readLong()
final boolean
readNull()
final String
final void
readObjectCB
(JsonIterator.ReadObjectCallback cb, Object attachment) final short
final String
final Slice
final JsonException
reportError
(String op, String msg) final void
reset
(byte[] buf) final void
reset
(byte[] buf, int head, int tail) final void
final void
reset
(InputStream in) static void
setMode
(DecodingMode mode) void
skip()
(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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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()
-