Class JsonReaderSupport

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean eof
      Flag indicating the end of the stream was reached
      protected java.io.Reader in
      The Reader to read from
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean isWhitespace​(char c)
      Returns whether the given character is whitespace.
      protected java.lang.Object parseValue​(java.lang.String text)
      Parses a null, boolean or numeric value from the given text.
      protected java.util.List<java.lang.Object> readArray()
      Reads a JSON array from the input stream.
      protected java.util.Map<java.lang.String,​java.lang.Object> readObject()
      Reads the next JSON object from the stream.
      protected java.lang.String readString()
      Reads a JSON string value from the input stream.
      protected char readUnicode()
      Reads a Unicode character in JSON format.
      protected void setReader​(java.io.Reader in)
      Set the Reader to read from.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • in

        protected java.io.Reader in
        The Reader to read from
      • eof

        protected boolean eof
        Flag indicating the end of the stream was reached
    • Method Detail

      • setReader

        protected void setReader​(java.io.Reader in)
        Set the Reader to read from.
        Parameters:
        in - the Reader
      • readObject

        protected java.util.Map<java.lang.String,​java.lang.Object> readObject()
                                                                             throws java.io.IOException
        Reads the next JSON object from the stream.
        Returns:
        the JSON object Map
        Throws:
        java.io.IOException
      • readArray

        protected java.util.List<java.lang.Object> readArray()
                                                      throws java.io.IOException
        Reads a JSON array from the input stream.
        Returns:
        the parsed JSON array
        Throws:
        java.io.IOException
      • parseValue

        protected java.lang.Object parseValue​(java.lang.String text)
                                       throws java.io.IOException
        Parses a null, boolean or numeric value from the given text.
        Parameters:
        text - the text to parse
        Returns:
        the parsed value: either null, Boolean, Double, Long or Integer
        Throws:
        java.io.IOException
      • readString

        protected java.lang.String readString()
                                       throws java.io.IOException
        Reads a JSON string value from the input stream.
        Returns:
        the JSON string value
        Throws:
        java.io.IOException
      • readUnicode

        protected char readUnicode()
                            throws java.io.IOException
        Reads a Unicode character in JSON format.
        Returns:
        the Unicode character
        Throws:
        java.io.IOException
      • isWhitespace

        protected boolean isWhitespace​(char c)
        Returns whether the given character is whitespace.
        Parameters:
        c - the character to test
        Returns:
        true if whitespace, false othereise