public static String toPrettyJson(Object object) { CharBuf buf = CharBuf.createCharBuf(); return buf.prettyPrintObject(object, false, 0).toString(); }
public static String toPrettyJson(Object object) { CharBuf buf = CharBuf.createCharBuf(); return buf.prettyPrintObject(object, false, 0).toString(); }
public static String toPrettyJsonWithTypes(Object object) { CharBuf buf = CharBuf.createCharBuf(); return buf.prettyPrintObject(object, true, 0).toString(); }
public static String toPrettyJsonWithTypes(Object object) { CharBuf buf = CharBuf.createCharBuf(); return buf.prettyPrintObject(object, true, 0).toString(); }
public static String toPrettyJsonWithTypes(Object object) { CharBuf buf = CharBuf.createCharBuf(); return buf.prettyPrintObject(object, true, 0).toString(); }
public static String toPrettyJson(Object object) { CharBuf buf = CharBuf.createCharBuf(); return buf.prettyPrintObject(object, false, 0).toString(); }
public CharBuf prettyPrintCollection(Collection values, boolean type, int indent) { add('['); for (Object value : values) { prettyPrintObject(value, type, indent); add(','); } if (values.size()>0) { removeLastChar(); } add(']'); return this; }
public CharBuf prettyPrintCollection(Collection values, boolean type, int indent) { add('['); for (Object value : values) { prettyPrintObject(value, type, indent); add(','); } if (values.size()>0) { removeLastChar(); } add(']'); return this; }
public CharBuf prettyPrintCollection(Collection values, boolean type, int indent) { add('['); for (Object value : values) { prettyPrintObject(value, type, indent); add(','); } if (values.size()>0) { removeLastChar(); } add(']'); return this; }
public CharBuf prettyPrintMap(Map map, final int indent) { final Set set = map.entrySet(); final Iterator iterator = set.iterator(); indent(indent * 4).add("{\n"); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry)iterator.next(); indent((indent + 1) * 4); addJsonEscapedString(entry.getKey().toString().toCharArray()); add(" : "); Object value = entry.getValue(); prettyPrintObject(value, true, indent); add(",\n"); } if (map.size()>0) { removeLastChar(); removeLastChar(); add("\n"); } indent(indent * 4).add('}'); return this; }
public CharBuf prettyPrintMap(Map map, final int indent) { final Set set = map.entrySet(); final Iterator iterator = set.iterator(); indent(indent * 4).add("{\n"); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry)iterator.next(); indent((indent + 1) * 4); addJsonEscapedString(entry.getKey().toString().toCharArray()); add(" : "); Object value = entry.getValue(); prettyPrintObject(value, true, indent); add(",\n"); } if (map.size()>0) { removeLastChar(); removeLastChar(); add("\n"); } indent(indent * 4).add('}'); return this; }
public CharBuf prettyPrintMap(Map map, final int indent) { final Set set = map.entrySet(); final Iterator iterator = set.iterator(); indent(indent * 4).add("{\n"); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry)iterator.next(); indent((indent + 1) * 4); addJsonEscapedString(entry.getKey().toString().toCharArray()); add(" : "); Object value = entry.getValue(); prettyPrintObject(value, true, indent); add(",\n"); } if (map.size()>0) { removeLastChar(); removeLastChar(); add("\n"); } indent(indent * 4).add('}'); return this; }
charBuf.recycle(); returnString = prettyPrintBuf().prettyPrintObject(returnValue, false, 0).toString(); } else { returnString = jsonSerializer().serialize(returnValue).toString();