@Beta public class MockJsonGenerator extends JsonGenerator
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the serializer and the underlying output stream or writer, and releases any memory
associated with it.
|
void |
flush()
Flushes any buffered content to the underlying output stream or writer.
|
JsonFactory |
getFactory()
Returns the JSON factory from which this generator was created.
|
void |
writeBoolean(boolean state)
Writes a literal JSON boolean value ('true' or 'false').
|
void |
writeEndArray()
Writes a JSON end array character ']'.
|
void |
writeEndObject()
Writes a JSON end object character '}'.
|
void |
writeFieldName(String name)
Writes a JSON quoted field name.
|
void |
writeNull()
Writes a literal JSON null value.
|
void |
writeNumber(BigDecimal v)
Writes a JSON big decimal value.
|
void |
writeNumber(BigInteger v)
Writes a JSON big integer value.
|
void |
writeNumber(double v)
Writes a JSON double value.
|
void |
writeNumber(float v)
Writes a JSON float value.
|
void |
writeNumber(int v)
Writes a JSON int value.
|
void |
writeNumber(long v)
Writes a JSON long value.
|
void |
writeNumber(String encodedValue)
Writes a JSON numeric value that has already been encoded properly.
|
void |
writeStartArray()
Writes a JSON start array character '['.
|
void |
writeStartObject()
Writes a JSON start object character '{'.
|
void |
writeString(String value)
Writes a JSON quoted string value.
|
enablePrettyPrint, serialize
public JsonFactory getFactory()
JsonGenerator
getFactory
in class JsonGenerator
public void flush() throws IOException
JsonGenerator
flush
in interface Flushable
flush
in class JsonGenerator
IOException
public void close() throws IOException
JsonGenerator
close
in interface Closeable
close
in interface AutoCloseable
close
in class JsonGenerator
IOException
public void writeStartArray() throws IOException
JsonGenerator
writeStartArray
in class JsonGenerator
IOException
public void writeEndArray() throws IOException
JsonGenerator
writeEndArray
in class JsonGenerator
IOException
public void writeStartObject() throws IOException
JsonGenerator
writeStartObject
in class JsonGenerator
IOException
public void writeEndObject() throws IOException
JsonGenerator
writeEndObject
in class JsonGenerator
IOException
public void writeFieldName(String name) throws IOException
JsonGenerator
writeFieldName
in class JsonGenerator
IOException
public void writeNull() throws IOException
JsonGenerator
writeNull
in class JsonGenerator
IOException
public void writeString(String value) throws IOException
JsonGenerator
writeString
in class JsonGenerator
IOException
public void writeBoolean(boolean state) throws IOException
JsonGenerator
writeBoolean
in class JsonGenerator
IOException
public void writeNumber(int v) throws IOException
JsonGenerator
writeNumber
in class JsonGenerator
IOException
public void writeNumber(long v) throws IOException
JsonGenerator
writeNumber
in class JsonGenerator
IOException
public void writeNumber(BigInteger v) throws IOException
JsonGenerator
writeNumber
in class JsonGenerator
IOException
public void writeNumber(float v) throws IOException
JsonGenerator
writeNumber
in class JsonGenerator
IOException
public void writeNumber(double v) throws IOException
JsonGenerator
writeNumber
in class JsonGenerator
IOException
public void writeNumber(BigDecimal v) throws IOException
JsonGenerator
writeNumber
in class JsonGenerator
IOException
public void writeNumber(String encodedValue) throws IOException
JsonGenerator
writeNumber
in class JsonGenerator
IOException
Copyright © 2011–2019 Google. All rights reserved.