public abstract class JsonGenerator extends Object
Implementation has no fields and therefore thread-safe, but sub-classes are not necessarily thread-safe.
| Constructor and Description |
|---|
JsonGenerator()
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
Closes the serializer and the underlying output stream or writer, and releases any memory associated with it.
|
void |
enablePrettyPrint()
Requests that the output be pretty printed (by default it is not).
|
abstract void |
flush()
Flushes any buffered content to the underlying output stream or writer.
|
abstract JsonFactory |
getFactory()
Returns the JSON factory from which this generator was created.
|
void |
serialize(Object
Serializes the given JSON value object, or if
value is
null it does no serialization.
|
abstract void |
writeBoolean(boolean state)
Writes a literal JSON boolean value ('true' or 'false').
|
abstract void |
writeEndArray()
Writes a JSON end array character ']'.
|
abstract void |
writeEndObject()
Writes a JSON end object character '}'.
|
abstract void |
writeFieldName(String
Writes a JSON quoted field name.
|
abstract void |
writeNull()
Writes a literal JSON null value.
|
abstract void |
writeNumber(BigDecimal
Writes a JSON big decimal value.
|
abstract void |
writeNumber(BigInteger
Writes a JSON big integer value.
|
abstract void |
writeNumber(double v)
Writes a JSON double value.
|
abstract void |
writeNumber(float v)
Writes a JSON float value.
|
abstract void |
writeNumber(int v)
Writes a JSON int value.
|
abstract void |
writeNumber(long v)
Writes a JSON long value.
|
abstract void |
writeNumber(String
Writes a JSON numeric value that has already been encoded properly.
|
abstract void |
writeStartArray()
Writes a JSON start array character '['.
|
abstract void |
writeStartObject()
Writes a JSON start object character '{'.
|
abstract void |
writeString(String
Writes a JSON quoted string value.
|
public abstract JsonFactorygetFactory()
public abstract void flush()
throws IOException
IOException
public abstract void close()
throws IOException
IOException
public abstract void writeStartArray()
throws IOException
IOException
public abstract void writeEndArray()
throws IOException
IOException
public abstract void writeStartObject()
throws IOException
IOException
public abstract void writeEndObject()
throws IOException
IOException
public abstract void writeFieldName(Stringname) throws IOException
IOException
public abstract void writeNull()
throws IOException
IOException
public abstract void writeString(Stringvalue) throws IOException
IOException
public abstract void writeBoolean(boolean state)
throws IOException
IOException
public abstract void writeNumber(int v)
throws IOException
IOException
public abstract void writeNumber(long v)
throws IOException
IOException
public abstract void writeNumber(BigIntegerv) throws IOException
IOException
public abstract void writeNumber(float v)
throws IOException
IOException
public abstract void writeNumber(double v)
throws IOException
IOException
public abstract void writeNumber(BigDecimalv) throws IOException
IOException
public abstract void writeNumber(StringencodedValue) throws IOException
IOException
public final void serialize(Objectvalue) throws IOException
value is
null it does no serialization.
IOException
public void enablePrettyPrint()
throws IOException
Default implementation does nothing, but implementations may override to provide actual pretty printing.
IOException - possible I/O exception (unused in default implementation)