@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, serializepublic JsonFactory getFactory()
JsonGeneratorgetFactory in class JsonGeneratorpublic void flush()
throws IOException
JsonGeneratorflush in interface Flushableflush in class JsonGeneratorIOExceptionpublic void close()
throws IOException
JsonGeneratorclose in interface Closeableclose in interface AutoCloseableclose in class JsonGeneratorIOExceptionpublic void writeStartArray()
throws IOException
JsonGeneratorwriteStartArray in class JsonGeneratorIOExceptionpublic void writeEndArray()
throws IOException
JsonGeneratorwriteEndArray in class JsonGeneratorIOExceptionpublic void writeStartObject()
throws IOException
JsonGeneratorwriteStartObject in class JsonGeneratorIOExceptionpublic void writeEndObject()
throws IOException
JsonGeneratorwriteEndObject in class JsonGeneratorIOExceptionpublic void writeFieldName(String name) throws IOException
JsonGeneratorwriteFieldName in class JsonGeneratorIOExceptionpublic void writeNull()
throws IOException
JsonGeneratorwriteNull in class JsonGeneratorIOExceptionpublic void writeString(String value) throws IOException
JsonGeneratorwriteString in class JsonGeneratorIOExceptionpublic void writeBoolean(boolean state)
throws IOException
JsonGeneratorwriteBoolean in class JsonGeneratorIOExceptionpublic void writeNumber(int v)
throws IOException
JsonGeneratorwriteNumber in class JsonGeneratorIOExceptionpublic void writeNumber(long v)
throws IOException
JsonGeneratorwriteNumber in class JsonGeneratorIOExceptionpublic void writeNumber(BigInteger v) throws IOException
JsonGeneratorwriteNumber in class JsonGeneratorIOExceptionpublic void writeNumber(float v)
throws IOException
JsonGeneratorwriteNumber in class JsonGeneratorIOExceptionpublic void writeNumber(double v)
throws IOException
JsonGeneratorwriteNumber in class JsonGeneratorIOExceptionpublic void writeNumber(BigDecimal v) throws IOException
JsonGeneratorwriteNumber in class JsonGeneratorIOExceptionpublic void writeNumber(String encodedValue) throws IOException
JsonGeneratorwriteNumber in class JsonGeneratorIOExceptionCopyright © 2011–2025 Google. All rights reserved.