Class JsonReader


  • public class JsonReader
    extends java.lang.Object
    Beware: this is NOT a complete and fully compliant JSON parser! Its main purpose is to decode typical simple queries without third-party dependencies.
    • Field Detail

      • array

        protected byte[] array
      • offset

        protected int offset
      • next

        protected int next
    • Constructor Detail

      • JsonReader

        public JsonReader​(byte[] array)
      • JsonReader

        public JsonReader​(byte[] array,
                          int offset)
    • 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.IOException
        java.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.IOException
        java.lang.ClassNotFoundException
      • readMap

        public java.util.Map<java.lang.String,​java.lang.Object> readMap()
                                                                       throws java.io.IOException,
                                                                              java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.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.IOException
        java.lang.ClassNotFoundException
      • readObject

        public java.lang.Object readObject()
                                    throws java.io.IOException,
                                           java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • readObject

        public <T> T readObject​(java.lang.Class<T> cls)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • readObject

        public java.lang.Object readObject​(java.lang.reflect.Type type)
                                    throws java.io.IOException,
                                           java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • parseNumber

        private static java.lang.Number parseNumber​(java.lang.String number)