public final class JsonTreeWriter extends JsonWriter
| Constructor and Description |
|---|
JsonTreeWriter() |
| Modifier and Type | Method and Description |
|---|---|
JsonWriter |
beginArray()
Begins encoding a new array.
|
JsonWriter |
beginObject()
Begins encoding a new object.
|
void |
close()
Flushes and closes this writer and the underlying
Writer. |
JsonWriter |
endArray()
Ends encoding the current array.
|
JsonWriter |
endObject()
Ends encoding the current object.
|
void |
flush()
Ensures all buffered data is written to the underlying
Writer and
flushes that writer. |
JsonElement |
get()
Returns the top level object produced by this writer.
|
JsonWriter |
name(String name)
Encodes the property name.
|
JsonWriter |
nullValue()
Encodes
null. |
JsonWriter |
value(boolean value)
Encodes
value. |
JsonWriter |
value(Boolean value)
Encodes
value. |
JsonWriter |
value(double value)
Encodes
value. |
JsonWriter |
value(long value)
Encodes
value. |
JsonWriter |
value(Number value)
Encodes
value. |
JsonWriter |
value(String value)
Encodes
value. |
getSerializeNulls, isHtmlSafe, isLenient, jsonValue, setHtmlSafe, setIndent, setLenient, setSerializeNullspublic JsonElement get()
public JsonWriter beginArray() throws IOException
JsonWriterJsonWriter.endArray().beginArray in class JsonWriterIOExceptionpublic JsonWriter endArray() throws IOException
JsonWriterendArray in class JsonWriterIOExceptionpublic JsonWriter beginObject() throws IOException
JsonWriterJsonWriter.endObject().beginObject in class JsonWriterIOExceptionpublic JsonWriter endObject() throws IOException
JsonWriterendObject in class JsonWriterIOExceptionpublic JsonWriter name(String name) throws IOException
JsonWritername in class JsonWritername - the name of the forthcoming value. May not be null.IOExceptionpublic JsonWriter value(String value) throws IOException
JsonWritervalue.value in class JsonWritervalue - the literal string value, or null to encode a null literal.IOExceptionpublic JsonWriter nullValue() throws IOException
JsonWriternull.nullValue in class JsonWriterIOExceptionpublic JsonWriter value(boolean value) throws IOException
JsonWritervalue.value in class JsonWriterIOExceptionpublic JsonWriter value(Boolean value) throws IOException
JsonWritervalue.value in class JsonWriterIOExceptionpublic JsonWriter value(double value) throws IOException
JsonWritervalue.value in class JsonWritervalue - a finite value. May not be NaNs or
infinities.IOExceptionpublic JsonWriter value(long value) throws IOException
JsonWritervalue.value in class JsonWriterIOExceptionpublic JsonWriter value(Number value) throws IOException
JsonWritervalue.value in class JsonWritervalue - a finite value. May not be NaNs or
infinities.IOExceptionpublic void flush()
throws IOException
JsonWriterWriter and
flushes that writer.flush in interface Flushableflush in class JsonWriterIOExceptionpublic void close()
throws IOException
JsonWriterWriter.close in interface Closeableclose in interface AutoCloseableclose in class JsonWriterIOException - if the JSON document is incomplete.