Class JsonLexer


  • public class JsonLexer
    extends Object
    A simple JSON lexer
    Author:
    Michel Kramer
    • Constructor Detail

      • JsonLexer

        public JsonLexer​(Reader r)
        Creates a new lexer
        Parameters:
        r - the reader that provides the JSON to scan
    • Method Detail

      • readNextToken

        public JsonLexer.Type readNextToken()
                                     throws IOException
        Reads the next token from the stream
        Returns:
        the token
        Throws:
        IOException - if the stream could not be read
      • readString

        public String readString()
                          throws IOException
        Reads a string from the stream
        Returns:
        the string
        Throws:
        IOException - if the stream could not be read
      • readNumber

        public Number readNumber()
                          throws IOException
        Reads a number from the stream
        Returns:
        the number
        Throws:
        IOException - if the stream could not be read