Class JSON


  • public final class JSON
    extends java.lang.Object
    Static methods for working with the map textual format which is parsed by MapParser
    Author:
    bratseth
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String encode​(java.util.Map<java.lang.String,​?> map)
      Outputs a map as a JSON 'object' string, provided that the map values are either String Number Any object whose toString returns JSON
      static java.lang.String escape​(java.lang.String s)
      Returns the given string as a properly json escaped string
      • Methods inherited from class java.lang.Object

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

      • encode

        public static java.lang.String encode​(java.util.Map<java.lang.String,​?> map)
        Outputs a map as a JSON 'object' string, provided that the map values are either
        • String
        • Number
        • Any object whose toString returns JSON
      • escape

        public static java.lang.String escape​(java.lang.String s)
        Returns the given string as a properly json escaped string