|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gson.stream.JsonWriter
com.google.gson.internal.bind.JsonTreeWriter
public final class JsonTreeWriter
This writer creates a JsonElement.
| Constructor Summary | |
|---|---|
JsonTreeWriter()
|
|
| Method Summary | |
|---|---|
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(double value)
Encodes value. |
JsonWriter |
value(long value)
Encodes value. |
JsonWriter |
value(Number value)
Encodes value. |
JsonWriter |
value(String value)
Encodes value. |
| Methods inherited from class com.google.gson.stream.JsonWriter |
|---|
getSerializeNulls, isHtmlSafe, isLenient, setHtmlSafe, setIndent, setLenient, setSerializeNulls |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonTreeWriter()
| Method Detail |
|---|
public JsonElement get()
public JsonWriter beginArray()
throws IOException
JsonWriterJsonWriter.endArray().
beginArray in class JsonWriterIOException
public JsonWriter endArray()
throws IOException
JsonWriter
endArray in class JsonWriterIOException
public JsonWriter beginObject()
throws IOException
JsonWriterJsonWriter.endObject().
beginObject in class JsonWriterIOException
public JsonWriter endObject()
throws IOException
JsonWriter
endObject in class JsonWriterIOException
public JsonWriter name(String name)
throws IOException
JsonWriter
name in class JsonWritername - the name of the forthcoming value. May not be null.
IOException
public JsonWriter value(String value)
throws IOException
JsonWritervalue.
value in class JsonWritervalue - the literal string value, or null to encode a null literal.
IOException
public JsonWriter nullValue()
throws IOException
JsonWriternull.
nullValue in class JsonWriterIOException
public JsonWriter value(boolean value)
throws IOException
JsonWritervalue.
value in class JsonWriterIOException
public JsonWriter value(double value)
throws IOException
JsonWritervalue.
value in class JsonWritervalue - a finite value. May not be NaNs or
infinities.
IOException
public JsonWriter value(long value)
throws IOException
JsonWritervalue.
value in class JsonWriterIOException
public JsonWriter value(Number value)
throws IOException
JsonWritervalue.
value in class JsonWritervalue - a finite value. May not be NaNs or
infinities.
IOException
public void flush()
throws IOException
JsonWriterWriter
and flushes that writer.
flush in interface Flushableflush in class JsonWriterIOException
public void close()
throws IOException
JsonWriterWriter.
close in interface Closeableclose in class JsonWriterIOException - if the JSON document is incomplete.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||