Package nxt.util

Class JSON

java.lang.Object
nxt.util.JSON

public final class JSON extends Object
  • Field Details

    • emptyJSON

      public static final org.json.simple.JSONStreamAware emptyJSON
  • Method Details

    • prepare

      public static org.json.simple.JSONStreamAware prepare(org.json.simple.JSONObject json)
    • toString

      public static String toString(org.json.simple.JSONStreamAware jsonStreamAware)
    • toJSONString

      public static String toJSONString(org.json.simple.JSONAware json)
      Create a formatted JSON string
      Parameters:
      json - JSON list or map
      Returns:
      Formatted string
    • writeJSONString

      public static void writeJSONString(org.json.simple.JSONStreamAware json, Writer writer) throws IOException
      Write a formatted JSON string
      Parameters:
      json - JSON list or map
      writer - Writer
      Throws:
      IOException - I/O error occurred
    • encodeObject

      public static void encodeObject(Map<?,?> map, Appendable sb)
      Create a formatted string from a map
      Parameters:
      map - Map
      sb - String builder
    • encodeValue

      public static void encodeValue(Object value, Appendable sb) throws IOException
      Encode a JSON value
      Parameters:
      value - JSON value
      sb - String builder
      Throws:
      IOException - I/O error occurred
    • jsonArrayCollector

      public static <T> Collector<T,?,org.json.simple.JSONArray> jsonArrayCollector()