java.lang.Object
com.grack.nanojson.JsonWriter.JsonWriterContext
- Enclosing class:
JsonWriter
Allows for additional configuration of the
JsonWriter.-
Method Summary
Modifier and TypeMethodDescriptionon(OutputStream out) Creates aJsonAppendableWriterthat can output to anOutputStreamsubclass.on(PrintStream appendable) Creates aJsonAppendableWriterthat can output to anPrintStreamsubclass.on(Appendable appendable) Creates aJsonAppendableWriterthat can output to anAppendablesubclass, such as aStringBuilder, aWriteraPrintStreamor aCharBuffer.string()Creates a newJsonStringWriter.
-
Method Details
-
string
Creates a newJsonStringWriter.String json = JsonWriter.indent(" ").string() .object() .array("a") .value(1) .value(2) .end() .value("b", false) .value("c", true) .end() .done(); -
on
Creates aJsonAppendableWriterthat can output to anAppendablesubclass, such as aStringBuilder, aWriteraPrintStreamor aCharBuffer. -
on
Creates aJsonAppendableWriterthat can output to anPrintStreamsubclass.JsonWriter.indent(" ").on(System.out) .object() .value("a", 1) .value("b", 2) .end() .done(); -
on
Creates aJsonAppendableWriterthat can output to anOutputStreamsubclass. Uses the UTF-8Charset. To specify a different charset, use theJsonWriter.on(Appendable)method with anOutputStreamWriter.JsonWriter.indent(" ").on(System.out) .object() .value("a", 1) .value("b", 2) .end() .done();
-