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(java.lang.String name)
Encodes the property name.
|
JsonWriter |
nullValue()
Encodes
null. |
JsonWriter |
value(boolean value)
Encodes
value. |
JsonWriter |
value(java.lang.Boolean value)
Encodes
value. |
JsonWriter |
value(double value)
Encodes
value. |
JsonWriter |
value(long value)
Encodes
value. |
JsonWriter |
value(java.lang.Number value)
Encodes
value. |
JsonWriter |
value(java.lang.String value)
Encodes
value. |
getSerializeNulls, isHtmlSafe, isLenient, jsonValue, setHtmlSafe, setIndent, setLenient, setSerializeNullspublic JsonElement get()
public JsonWriter beginArray() throws java.io.IOException
JsonWriterJsonWriter.endArray().beginArray in class JsonWriterjava.io.IOExceptionpublic JsonWriter endArray() throws java.io.IOException
JsonWriterendArray in class JsonWriterjava.io.IOExceptionpublic JsonWriter beginObject() throws java.io.IOException
JsonWriterJsonWriter.endObject().beginObject in class JsonWriterjava.io.IOExceptionpublic JsonWriter endObject() throws java.io.IOException
JsonWriterendObject in class JsonWriterjava.io.IOExceptionpublic JsonWriter name(java.lang.String name) throws java.io.IOException
JsonWritername in class JsonWritername - the name of the forthcoming value. May not be null.java.io.IOExceptionpublic JsonWriter value(java.lang.String value) throws java.io.IOException
JsonWritervalue.value in class JsonWritervalue - the literal string value, or null to encode a null literal.java.io.IOExceptionpublic JsonWriter nullValue() throws java.io.IOException
JsonWriternull.nullValue in class JsonWriterjava.io.IOExceptionpublic JsonWriter value(boolean value) throws java.io.IOException
JsonWritervalue.value in class JsonWriterjava.io.IOExceptionpublic JsonWriter value(java.lang.Boolean value) throws java.io.IOException
JsonWritervalue.value in class JsonWriterjava.io.IOExceptionpublic JsonWriter value(double value) throws java.io.IOException
JsonWritervalue.value in class JsonWritervalue - a finite value. May not be NaNs or
infinities.java.io.IOExceptionpublic JsonWriter value(long value) throws java.io.IOException
JsonWritervalue.value in class JsonWriterjava.io.IOExceptionpublic JsonWriter value(java.lang.Number value) throws java.io.IOException
JsonWritervalue.value in class JsonWritervalue - a finite value. May not be NaNs or
infinities.java.io.IOExceptionpublic void flush()
throws java.io.IOException
JsonWriterWriter
and flushes that writer.flush in interface java.io.Flushableflush in class JsonWriterjava.io.IOExceptionpublic void close()
throws java.io.IOException
JsonWriterWriter.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class JsonWriterjava.io.IOException - if the JSON document is incomplete.