Package one.nio.serial
Class JsonReader
- java.lang.Object
-
- one.nio.serial.JsonReader
-
public class JsonReader extends java.lang.ObjectBeware: this is NOT a complete and fully compliant JSON parser! Its main purpose is to decode typical simple queries without third-party dependencies.
-
-
Constructor Summary
Constructors Constructor Description JsonReader(byte[] array)JsonReader(byte[] array, int offset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.IOExceptionexception(java.lang.String message)voidexpect(int b, java.lang.String message)intnext()private static java.lang.NumberparseNumber(java.lang.String number)protected intread()java.util.ArrayList<java.lang.Object>readArray()java.util.ArrayList<java.lang.Object>readArray(java.lang.reflect.Type elementType)byte[]readBinary()booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()charreadEscapeChar()floatreadFloat()intreadHexChar()intreadInt()longreadLong()java.util.Map<java.lang.String,java.lang.Object>readMap()<K> java.util.Map<K,java.lang.Object>readMap(java.lang.Class<K> keyClass, java.lang.reflect.Type valueType)java.lang.ObjectreadNull()java.lang.StringreadNumber()java.lang.ObjectreadObject()<T> TreadObject(java.lang.Class<T> cls)java.lang.ObjectreadObject(java.lang.reflect.Type type)shortreadShort()java.lang.StringreadString()intskipWhitespace()
-
-
-
Method Detail
-
read
protected int read()
-
next
public final int next()
-
skipWhitespace
public final int skipWhitespace()
-
exception
public final java.io.IOException exception(java.lang.String message)
-
expect
public final void expect(int b, java.lang.String message) throws java.io.IOException- Throws:
java.io.IOException
-
readBoolean
public final boolean readBoolean() throws java.io.IOException- Throws:
java.io.IOException
-
readByte
public final byte readByte() throws java.io.IOException- Throws:
java.io.IOException
-
readShort
public final short readShort() throws java.io.IOException- Throws:
java.io.IOException
-
readChar
public final char readChar() throws java.io.IOException- Throws:
java.io.IOException
-
readInt
public final int readInt() throws java.io.IOException- Throws:
java.io.IOException
-
readLong
public final long readLong() throws java.io.IOException- Throws:
java.io.IOException
-
readFloat
public float readFloat() throws java.io.IOException- Throws:
java.io.IOException
-
readDouble
public final double readDouble() throws java.io.IOException- Throws:
java.io.IOException
-
readNumber
public final java.lang.String readNumber() throws java.io.IOException- Throws:
java.io.IOException
-
readHexChar
public final int readHexChar() throws java.io.IOException- Throws:
java.io.IOException
-
readEscapeChar
public final char readEscapeChar() throws java.io.IOException- Throws:
java.io.IOException
-
readNull
public java.lang.Object readNull() throws java.io.IOException- Throws:
java.io.IOException
-
readString
public java.lang.String readString() throws java.io.IOException- Throws:
java.io.IOException
-
readBinary
public byte[] readBinary() throws java.io.IOException- Throws:
java.io.IOException
-
readArray
public java.util.ArrayList<java.lang.Object> readArray() throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readArray
public java.util.ArrayList<java.lang.Object> readArray(java.lang.reflect.Type elementType) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readMap
public java.util.Map<java.lang.String,java.lang.Object> readMap() throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readMap
public <K> java.util.Map<K,java.lang.Object> readMap(java.lang.Class<K> keyClass, java.lang.reflect.Type valueType) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readObject
public java.lang.Object readObject() throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readObject
public <T> T readObject(java.lang.Class<T> cls) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readObject
public java.lang.Object readObject(java.lang.reflect.Type type) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
parseNumber
private static java.lang.Number parseNumber(java.lang.String number)
-
-