JSON-java
JSON-java copied to clipboard
to compact json string
I want json string not every element newline so I change the code JSONObject public Writer write(Writer writer, int indentFactor, int indent) method. just add
int coutline = 0;
while (keys.hasNext()) {
Object key = keys.next();
if (commanate) {
writer.write(',');
}
if (indentFactor > 0 && coutline%4 == 0) {
writer.write('\n');
indent(writer, newindent);
}
//indent(writer, newindent);
writer.write(quote(key.toString()));
it so works.
4 element maybe make it property is good.
Thanks, but not at this time.