com.orsoncharts.util.json

## Class JSONValue

- java.lang.Object
- - com.orsoncharts.util.json.JSONValue

-     public class JSONValue
      extends java.lang.Object

  Utility methods for JSON values.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONValue()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `escape(java.lang.String s)` Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
    `static java.lang.Object` | `parse(java.io.Reader in)` Parse JSON text into java object from the input source.
    `static java.lang.Object` | `parse(java.lang.String s)` Parses an object from a string.
    `static java.lang.Object` | `parseWithException(java.io.Reader in)` Parse JSON text into java object from the input source.
    `static java.lang.Object` | `parseWithException(java.lang.String s)` Parses an object from a JSON string.
    `static java.lang.String` | `toJSONString(java.lang.Object value)` Convert an object to JSON text.
    `static void` | `writeJSONString(java.lang.Object value, java.io.Writer out)` Encode an object into JSON text and write it to out.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JSONValue

          public JSONValue()

  - ### Method Detail

    - #### parse

          public static java.lang.Object parse(java.io.Reader in)

      Parse JSON text into java object from the input source. Please use parseWithException() if you don't want to ignore the exception.
      Parameters:
        `in` - the input reader.
      Returns:
        Instance of the following: com.orsoncharts.util.json.JSONObject, com.orsoncharts.util.json.JSONArray, java.lang.String, java.lang.Number, java.lang.Boolean, null
      See Also:
        `JSONParser.parse(Reader)`, `parseWithException(Reader)`

    - #### parse

          public static java.lang.Object parse(java.lang.String s)

      Parses an object from a string.
      Parameters:
        `s` - the string.
      Returns:
        An object.

    - #### parseWithException

          public static java.lang.Object parseWithException(java.io.Reader in)
                                                     throws java.io.IOException,
                                                            ParseException

      Parse JSON text into java object from the input source.
      Parameters:
        `in` - the input reader (`null` not permitted).
      Returns:
        Instance of the following: com.orsoncharts.util.json.JSONObject, com.orsoncharts.util.json.JSONArray, java.lang.String, java.lang.Number, java.lang.Boolean, null
      Throws:
        `java.io.IOException` - if there is an I/O problem.
        `ParseException` - if there is a parsing problem.
      See Also:
        `JSONParser`

    - #### parseWithException

          public static java.lang.Object parseWithException(java.lang.String s)
                                                     throws ParseException

      Parses an object from a JSON string.
      Parameters:
        `s` - the string.
      Returns:
        An object.
      Throws:
        `ParseException` - if there is a parsing problem.

    - #### writeJSONString

          public static void writeJSONString(java.lang.Object value,
                                             java.io.Writer out)
                                      throws java.io.IOException

      Encode an object into JSON text and write it to out.

      If this object is a `Map` or a `List`, and it's also a `JSONStreamAware` or a `JSONAware`, `JSONStreamAware` or `JSONAware` will be considered firstly.

      DO NOT call this method from writeJSONString(Writer) of a class that implements both JSONStreamAware and (Map or List) with "this" as the first parameter, use JSONObject.writeJSONString(Map, Writer) or JSONArray.writeJSONString(List, Writer) instead.

      Parameters:
        `value` - the value.
        `out` - the output writer.
      Throws:
        `java.io.IOException` - if there is an I/O problem.
      See Also:
        `JSONObject.writeJSONString(Map, Writer)`, `JSONArray.writeJSONString(List, Writer)`

    - #### toJSONString

          public static java.lang.String toJSONString(java.lang.Object value)

      Convert an object to JSON text.

      If this object is a Map or a List, and it's also a JSONAware, JSONAware will be considered firstly.

      DO NOT call this method from toJSONString() of a class that implements both JSONAware and Map or List with "this" as the parameter, use JSONObject.toJSONString(Map) or JSONArray.toJSONString(List) instead.

      Parameters:
        `value` - the value.
      Returns:
        JSON text, or "null" if value is null or it's an NaN or an INF number.
      See Also:
        `JSONObject.toJSONString(Map)`, `JSONArray.toJSONString(List)`

    - #### escape

          public static java.lang.String escape(java.lang.String s)

      Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).
      Parameters:
        `s` - the string to be escaped (`null` permitted).
      Returns:
        A string.