/** * serialize Object as json to an stream */ public void writeJSONString(Appendable out) throws IOException { writeJSON(this, out, JSONValue.COMPRESSION); }
/** * serialize Object as json to an stream */ public void writeJSONString(Appendable out, JSONStyle compression) throws IOException { writeJSON(this, out, compression); }
public static void writeJSON(Map<String, ? extends Object> map, Appendable out) throws IOException { writeJSON(map, out, JSONValue.COMPRESSION); }
/** * serialize Object as json to an stream */ public void writeJSONString(Appendable out) throws IOException { writeJSON(this, out, JSONValue.COMPRESSION); }
/** * serialize Object as json to an stream */ public void writeJSONString(Appendable out, JSONStyle compression) throws IOException { writeJSON(this, out, compression); }
public static void writeJSON(Map<String, ? extends Object> map, Appendable out) throws IOException { writeJSON(map, out, JSONValue.COMPRESSION); }
/** * Convert a map to JSON text. The result is a JSON object. If this map is * also a JSONAware, JSONAware specific behaviours will be omitted at this * top level. * * @see net.minidev.json.JSONValue#toJSONString(Object) * * @param map * @return JSON text, or "null" if map is null. */ public static String toJSONString(Map<String, ? extends Object> map, JSONStyle compression) { StringBuilder sb = new StringBuilder(); try { writeJSON(map, sb, compression); } catch (IOException e) { // can not append on a StringBuilder } return sb.toString(); }
/** * Convert a map to JSON text. The result is a JSON object. If this map is * also a JSONAware, JSONAware specific behaviours will be omitted at this * top level. * * @see net.minidev.json.JSONValue#toJSONString(Object) * * @param map * @return JSON text, or "null" if map is null. */ public static String toJSONString(Map<String, ? extends Object> map, JSONStyle compression) { StringBuilder sb = new StringBuilder(); try { writeJSON(map, sb, compression); } catch (IOException e) { // can not append on a StringBuilder } return sb.toString(); }
@Override default void writeJson(Appendable out) { try { JSONObject.writeJSON(this.toJsonElement(), out); } catch (IOException e) { throw new BeanSerializationException("Writing json error", e); } }