public class JsonPrettyGeneratorImpl extends Object
PRETTY_PRINTING
Constructor and Description |
---|
JsonPrettyGeneratorImpl(OutputStream out,
BufferPool bufferPool) |
JsonPrettyGeneratorImpl(OutputStream out,
Charset encoding,
BufferPool bufferPool) |
JsonPrettyGeneratorImpl(Writer writer,
BufferPool bufferPool) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this generator and frees any resources associated with it.
|
void |
flush()
Flushes the underlying output source.
|
JsonGenerator |
write(BigDecimal value)
Writes the specified value as a JSON number value within
the current array context.
|
JsonGenerator |
write(BigInteger value)
Writes the specified value as a JSON number value within
the current array context.
|
JsonGenerator |
write(boolean value)
Writes a JSON true or false value within the current array context.
|
JsonGenerator |
write(double value)
Writes the specified value as a JSON number value within the current
array context.
|
JsonGenerator |
write(int value)
Writes the specified value as a JSON number value within
the current array context.
|
JsonGenerator |
write(JsonValue value)
Writes the specified value as a JSON value within
the current array context.
|
JsonGenerator |
write(long value)
Writes the specified value as a JSON number value within
the current array context.
|
JsonGenerator |
write(String value)
Writes the specified value as a JSON string value within
the current array 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,
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,
JsonValue value)
Writes a JSON name/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.
|
protected void |
writeComma() |
JsonGenerator |
writeEnd()
Writes the end of the current context.
|
JsonGenerator |
writeNull()
Writes a JSON null value within the current array 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()
JsonGenerator
writeStartObject
in interface JsonGenerator
public JsonGenerator writeStartObject(String name)
JsonGenerator
writeStartObject
in interface JsonGenerator
name
- a name within the JSON name/object pair to be writtenpublic JsonGenerator writeStartArray()
JsonGenerator
writeStartArray
in interface JsonGenerator
public JsonGenerator writeStartArray(String name)
JsonGenerator
writeStartArray
in interface JsonGenerator
name
- a name within the JSON name/array pair to be writtenpublic JsonGenerator writeEnd()
JsonGenerator
writeEnd
in interface JsonGenerator
protected void writeComma()
public void flush()
JsonGenerator
flush
in interface Flushable
flush
in interface JsonGenerator
public JsonGenerator write(String name, String fieldValue)
JsonGenerator
write
in interface JsonGenerator
name
- 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)
JsonGenerator
new BigDecimal(value).toString()
is used as the text value
for writing.write
in interface JsonGenerator
name
- 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)
JsonGenerator
new BigDecimal(value).toString()
is used as the text
value for writing.write
in interface JsonGenerator
name
- 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)
JsonGenerator
BigDecimal.valueOf(double).toString()
is used as the text value for writing.write
in interface JsonGenerator
name
- 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)
JsonGenerator
new BigDecimal(value).toString()
is used as the text value for writing.write
in interface JsonGenerator
name
- 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)
JsonGenerator
toString()
is used as the text value for writing.write
in interface JsonGenerator
name
- 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)
JsonGenerator
true
value, otherwise
it writes the JSON false
value.write
in interface JsonGenerator
name
- 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)
JsonGenerator
writeNull
in interface JsonGenerator
name
- a name in the JSON name/null pair to be written in
current JSON objectpublic JsonGenerator write(JsonValue value)
JsonGenerator
write
in interface JsonGenerator
value
- a value to be written in current JSON arraypublic JsonGenerator write(String name, JsonValue value)
JsonGenerator
write
in interface JsonGenerator
name
- 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)
JsonGenerator
write
in interface JsonGenerator
value
- a value to be written in current JSON arraypublic JsonGenerator write(int value)
JsonGenerator
new BigDecimal(value).toString()
is used as the text value for writing.write
in interface JsonGenerator
value
- a value to be written in current JSON arraypublic JsonGenerator write(long value)
JsonGenerator
new BigDecimal(value).toString()
is used as the text value for writing.write
in interface JsonGenerator
value
- a value to be written in current JSON arraypublic JsonGenerator write(double value)
JsonGenerator
BigDecimal.valueOf(value).toString()
is used as the text value for writing.write
in interface JsonGenerator
value
- a value to be written in current JSON arraypublic JsonGenerator write(BigInteger value)
JsonGenerator
new BigDecimal(value).toString()
is used as the text value for writing.write
in interface JsonGenerator
value
- a value to be written in current JSON arrayJsonNumber
public JsonGenerator write(BigDecimal value)
JsonGenerator
toString()
is used as the the text value for writing.write
in interface JsonGenerator
value
- a value to be written in current JSON arrayJsonNumber
public JsonGenerator write(boolean value)
JsonGenerator
true
value,
otherwise it writes the JSON false
value.write
in interface JsonGenerator
value
- a boolean
valuepublic JsonGenerator writeNull()
JsonGenerator
writeNull
in interface JsonGenerator
public void close()
JsonGenerator
close
in interface Closeable
close
in interface AutoCloseable
close
in interface JsonGenerator
Copyright © 2019 Oracle. All rights reserved.