I’m nearly ready to cut a 1.0 version of nanojson. I spent some time merging the two writer interfaces into a single API.
String json = JsonWriter.string() .object() .array("a") .value(1) .value(2) .end() .value("b", false) .value("c", true) .end() .close();
There’s a new convenience static for quickly converting stuff to a string as well:
String json = JsonWriter.string(object);
I suspect I may rename the close() method to something that doesn’t infer closing of the underlying stream (maybe finish() or complete()?)
You’ll find it at Github here.Read full post