Class JSONParser


  • public class JSONParser
    extends java.lang.Object
    A very small JSON parser. The JSON input is parsed into an object structure in the following way:
    • Object names are represented as a String.
    • String values are represented as a String.
    • Numeric values without a decimal separator are represented as a Long.
    • Numeric values with a decimal separator are represented as a Double.
    • Boolean values are represented as a Boolean.
    • Nested JSON objects are parsed into a Map<String, Object>.
    • JSON lists are parsed into a List which may contain any of the above values.
    • Constructor Summary

      Constructors 
      Constructor Description
      JSONParser​(java.io.InputStream is)  
      JSONParser​(java.lang.CharSequence json)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> getParsed()  
      java.util.List<java.lang.Object> getParsedList()  
      • Methods inherited from class java.lang.Object

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

      • JSONParser

        public JSONParser​(java.lang.CharSequence json)
      • JSONParser

        public JSONParser​(java.io.InputStream is)
                   throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getParsed

        public java.util.Map<java.lang.String,​java.lang.Object> getParsed()
      • getParsedList

        public java.util.List<java.lang.Object> getParsedList()