public class JsonWriter extends StringWriter
This writer pretty prints JSON-formatted text to the a format where each JSON attribute and its value is on its own line, and JSON arrays are printed such that each array element has each of its own attributes on separate lines.
Example of pretty-printed output:
{
"title":"Query Count for Jul 9 1998 09:00:00 to Jul 9 1998 09:50:00",
"totalCount":322,
"data":[
{
"timestamp":"Jul 9 1998 09:20:00",
"value":54
},
{
"timestamp":"Jul 9 1998 09:45:00",
"value":51
}
]
}
Constructor and Description |
---|
JsonWriter() |
Modifier and Type | Method and Description |
---|---|
void |
write(int c) |
public void write(int c)
write
in class StringWriter
This work is licensed under a Creative Commons Attribution 4.0 International License.