Class JsonParser


  • public class JsonParser
    extends java.lang.Object
    Parses JSON tokens to maps
    Author:
    Michel Kraemer
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonParser​(JsonLexer lexer)
      Constructs a new JSON parser
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.Object> parseArray()
      Parses an array
      java.util.Map<java.lang.String,​java.lang.Object> parseObject()
      Parses an object into a map
      • Methods inherited from class java.lang.Object

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

      • JsonParser

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

      • parseObject

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

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