Closeable, Flushable, AutoCloseable, JsonGeneratorpublic class JsonPrettyGeneratorImpl extends Object
PRETTY_PRINTING| Constructor | Description |
|---|---|
JsonPrettyGeneratorImpl(OutputStream out,
Charset encoding,
BufferPool bufferPool) |
|
JsonPrettyGeneratorImpl(OutputStream out,
BufferPool bufferPool) |
|
JsonPrettyGeneratorImpl(Writer writer,
BufferPool bufferPool) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes this generator and frees any resources associated with it.
|
void |
flush() |
Flushes the underlying output source.
|
JsonGenerator |
write(boolean value) |
Writes a JSON true or false value within the current array, field or root context.
|
JsonGenerator |
write(double value) |
Writes the specified value as a JSON number value within the current
array, field or root context.
|
JsonGenerator |
write(int value) |
Writes the specified value as a JSON number value within
the current array, field or root context.
|
JsonGenerator |
write(long value) |
Writes the specified value as a JSON number value within
the current array, field or root context.
|
JsonGenerator |
write(String value) |
Writes the specified value as a JSON string value within
the current array, field or root context.
|
JsonGenerator |
write(String name,
boolean value) |
Writes a JSON name/boolean value pair in the current object context.
|
JsonGenerator |
write(String name,
double value) |
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(String name,
int value) |
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(String name,
long value) |
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(String name,
String fieldValue) |
Writes a JSON name/string value pair in the current object context.
|
JsonGenerator |
write(String name,
BigDecimal value) |
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(String name,
BigInteger value) |
Writes a JSON name/number value pair in the current object context.
|
JsonGenerator |
write(String name,
JsonValue value) |
Writes a JSON name/value pair in the current object context.
|
JsonGenerator |
write(BigDecimal value) |
Writes the specified value as a JSON number value within
the current array, field or root context.
|
JsonGenerator |
write(BigInteger value) |
Writes the specified value as a JSON number value within
the current array, field or root context.
|
JsonGenerator |
write(JsonValue value) |
Writes the specified value as a JSON value within
the current array, field or root context.
|
protected void |
writeColon() |
|
protected void |
writeComma() |
|
JsonGenerator |
writeEnd() |
Writes the end of the current context.
|
JsonGenerator |
writeKey(String name) |
Writes the JSON name with a colon.
|
JsonGenerator |
writeNull() |
Writes a JSON null value within the current array, field or root context.
|
JsonGenerator |
writeNull(String name) |
Writes a JSON name/null value pair in an current object context.
|
JsonGenerator |
writeStartArray() |
Writes the JSON start array character.
|
JsonGenerator |
writeStartArray(String name) |
Writes the JSON name/start array character pair with in the current
object context.
|
JsonGenerator |
writeStartObject() |
Writes the JSON start object character.
|
JsonGenerator |
writeStartObject(String name) |
Writes the JSON name/start object character pair in the current
object context.
|
public JsonPrettyGeneratorImpl(Writer writer, BufferPool bufferPool)
public JsonPrettyGeneratorImpl(OutputStream out, BufferPool bufferPool)
public JsonPrettyGeneratorImpl(OutputStream out, Charset encoding, BufferPool bufferPool)
public JsonGenerator writeStartObject()
JsonGeneratorwriteStartObject in interface JsonGeneratorpublic JsonGenerator writeStartObject(String name)
JsonGeneratorwriteStartObject in interface JsonGeneratorname - a name within the JSON name/object pair to be writtenpublic JsonGenerator writeStartArray()
JsonGeneratorwriteStartArray in interface JsonGeneratorpublic JsonGenerator writeStartArray(String name)
JsonGeneratorwriteStartArray in interface JsonGeneratorname - a name within the JSON name/array pair to be writtenpublic JsonGenerator writeEnd()
JsonGeneratorwriteEnd in interface JsonGeneratorprotected void writeComma()
protected void writeColon()
public void flush()
JsonGeneratorflush in interface Flushableflush in interface JsonGeneratorpublic JsonGenerator write(String name, String fieldValue)
JsonGeneratorwrite in interface JsonGeneratorname - a name in the JSON name/string pair to be written in
current JSON objectfieldValue - a value in the JSON name/string pair to be written in
current JSON objectpublic JsonGenerator write(String name, int value)
JsonGeneratornew BigDecimal(value).toString() is used as the text value
for writing.write in interface JsonGeneratorname - a name in the JSON name/number pair to be written in
current JSON objectvalue - a value in the JSON name/number pair to be written in
current JSON objectpublic JsonGenerator write(String name, long value)
JsonGeneratornew BigDecimal(value).toString() is used as the text
value for writing.write in interface JsonGeneratorname - a name in the JSON name/number pair to be written in
current JSON objectvalue - a value in the JSON name/number pair to be written in
current JSON objectpublic JsonGenerator write(String name, double value)
JsonGeneratorBigDecimal.valueOf(double).toString()
is used as the text value for writing.write in interface JsonGeneratorname - a name in the JSON name/number pair to be written in
current JSON objectvalue - a value in the JSON name/number pair to be written in
current JSON objectpublic JsonGenerator write(String name, BigInteger value)
JsonGeneratornew BigDecimal(value).toString()
is used as the text value for writing.write in interface JsonGeneratorname - a name in the JSON name/number pair to be written in
current JSON objectvalue - a value in the JSON name/number pair to be written in
current JSON objectpublic JsonGenerator write(String name, BigDecimal value)
JsonGeneratortoString() is used as the text value for writing.write in interface JsonGeneratorname - a name in the JSON name/number pair to be written in
current JSON objectvalue - a value in the JSON name/number pair to be written in
current JSON objectpublic JsonGenerator write(String name, boolean value)
JsonGeneratortrue value, otherwise
it writes the JSON false value.write in interface JsonGeneratorname - a name in the JSON name/boolean pair to be written in
current JSON objectvalue - a value in the JSON name/boolean pair to be written in
current JSON objectpublic JsonGenerator writeNull(String name)
JsonGeneratorwriteNull in interface JsonGeneratorname - a name in the JSON name/null pair to be written in
current JSON objectpublic JsonGenerator write(JsonValue value)
JsonGeneratorwrite in interface JsonGeneratorvalue - a value to be written in current JSON arraypublic JsonGenerator write(String name, JsonValue value)
JsonGeneratorwrite in interface JsonGeneratorname - a name in the JSON name/value pair to be written in
current JSON objectvalue - a value in the JSON name/value pair to be written in
current JSON objectpublic JsonGenerator write(String value)
JsonGeneratorwrite in interface JsonGeneratorvalue - a value to be written in current JSON arraypublic JsonGenerator write(int value)
JsonGeneratornew BigDecimal(value).toString()
is used as the text value for writing.write in interface JsonGeneratorvalue - a value to be written in current JSON arraypublic JsonGenerator write(long value)
JsonGeneratornew BigDecimal(value).toString()
is used as the text value for writing.write in interface JsonGeneratorvalue - a value to be written in current JSON arraypublic JsonGenerator write(double value)
JsonGeneratorBigDecimal.valueOf(value).toString()
is used as the text value for writing.write in interface JsonGeneratorvalue - a value to be written in current JSON arraypublic JsonGenerator write(BigInteger value)
JsonGeneratornew BigDecimal(value).toString()
is used as the text value for writing.write in interface JsonGeneratorvalue - a value to be written in current JSON arrayJsonNumberpublic JsonGenerator write(BigDecimal value)
JsonGeneratortoString()
is used as the the text value for writing.write in interface JsonGeneratorvalue - a value to be written in current JSON arrayJsonNumberpublic JsonGenerator write(boolean value)
JsonGeneratortrue value,
otherwise it writes the JSON false value.write in interface JsonGeneratorvalue - a boolean valuepublic JsonGenerator writeNull()
JsonGeneratorwriteNull in interface JsonGeneratorpublic JsonGenerator writeKey(String name)
JsonGeneratorwriteKey in interface JsonGeneratorname - name of json fieldpublic void close()
JsonGeneratorclose in interface AutoCloseableclose in interface Closeableclose in interface JsonGeneratorCopyright © 2017 Oracle. All rights reserved.