@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(java.lang.String name)
Writes a JSON quoted field name.
|
void |
writeNull()
Writes a literal JSON null value.
|
void |
writeNumber(java.math.BigDecimal v)
Writes a JSON big decimal value.
|
void |
writeNumber(java.math.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(java.lang.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(java.lang.String value)
Writes a JSON quoted string value.
|
enablePrettyPrint, serialize
public JsonFactory getFactory()
JsonGenerator
getFactory
in class JsonGenerator
public void flush() throws java.io.IOException
JsonGenerator
flush
in class JsonGenerator
java.io.IOException
public void close() throws java.io.IOException
JsonGenerator
close
in class JsonGenerator
java.io.IOException
public void writeStartArray() throws java.io.IOException
JsonGenerator
writeStartArray
in class JsonGenerator
java.io.IOException
public void writeEndArray() throws java.io.IOException
JsonGenerator
writeEndArray
in class JsonGenerator
java.io.IOException
public void writeStartObject() throws java.io.IOException
JsonGenerator
writeStartObject
in class JsonGenerator
java.io.IOException
public void writeEndObject() throws java.io.IOException
JsonGenerator
writeEndObject
in class JsonGenerator
java.io.IOException
public void writeFieldName(java.lang.String name) throws java.io.IOException
JsonGenerator
writeFieldName
in class JsonGenerator
java.io.IOException
public void writeNull() throws java.io.IOException
JsonGenerator
writeNull
in class JsonGenerator
java.io.IOException
public void writeString(java.lang.String value) throws java.io.IOException
JsonGenerator
writeString
in class JsonGenerator
java.io.IOException
public void writeBoolean(boolean state) throws java.io.IOException
JsonGenerator
writeBoolean
in class JsonGenerator
java.io.IOException
public void writeNumber(int v) throws java.io.IOException
JsonGenerator
writeNumber
in class JsonGenerator
java.io.IOException
public void writeNumber(long v) throws java.io.IOException
JsonGenerator
writeNumber
in class JsonGenerator
java.io.IOException
public void writeNumber(java.math.BigInteger v) throws java.io.IOException
JsonGenerator
writeNumber
in class JsonGenerator
java.io.IOException
public void writeNumber(float v) throws java.io.IOException
JsonGenerator
writeNumber
in class JsonGenerator
java.io.IOException
public void writeNumber(double v) throws java.io.IOException
JsonGenerator
writeNumber
in class JsonGenerator
java.io.IOException
public void writeNumber(java.math.BigDecimal v) throws java.io.IOException
JsonGenerator
writeNumber
in class JsonGenerator
java.io.IOException
public void writeNumber(java.lang.String encodedValue) throws java.io.IOException
JsonGenerator
writeNumber
in class JsonGenerator
java.io.IOException
Copyright © 2011-2018 Google. All Rights Reserved.