Class JsonParser


  • public class JsonParser
    extends Object
    Parses JSON tokens to maps
    Author:
    Michel Kraemer
    • Constructor Detail

      • JsonParser

        public JsonParser​(JsonLexer lexer)
        Constructs a new JSON parser
        Parameters:
        lexer - a JSON lexer to read from
    • Method Detail

      • parseObject

        public Map<String,​Object> parseObject()
                                             throws IOException
        Parses an object into a map
        Returns:
        the parsed object
        Throws:
        IOException - if the input stream could not be read or if the input stream contained an unexpected token
      • parseArray

        public List<Object> parseArray()
                                throws IOException
        Parses an array
        Returns:
        the parsed array
        Throws:
        IOException - if the input stream could not be read or if the input stream contained an unexpected token