public class MockJsonGenerator extends JsonGenerator
Methods
close()
public void close()
Closes the serializer and the underlying output stream or writer, and releases any memory associated with it.
Exceptions | |
---|---|
Type | Description |
IOException |
flush()
public void flush()
Flushes any buffered content to the underlying output stream or writer.
Exceptions | |
---|---|
Type | Description |
IOException |
getFactory()
public JsonFactory getFactory()
Returns the JSON factory from which this generator was created.
Returns | |
---|---|
Type | Description |
JsonFactory |
writeBoolean(boolean state)
public void writeBoolean(boolean state)
Writes a literal JSON boolean value ('true' or 'false').
Parameter | |
---|---|
Name | Description |
state |
boolean |
Exceptions | |
---|---|
Type | Description |
IOException |
writeEndArray()
public void writeEndArray()
Writes a JSON end array character ']'.
Exceptions | |
---|---|
Type | Description |
IOException |
writeEndObject()
public void writeEndObject()
Writes a JSON end object character '}'.
Exceptions | |
---|---|
Type | Description |
IOException |
writeFieldName(String name)
public void writeFieldName(String name)
Writes a JSON quoted field name.
Parameter | |
---|---|
Name | Description |
name |
String |
Exceptions | |
---|---|
Type | Description |
IOException |
writeNull()
public void writeNull()
Writes a literal JSON null value.
Exceptions | |
---|---|
Type | Description |
IOException |
writeNumber(double v)
public void writeNumber(double v)
Writes a JSON double value.
Parameter | |
---|---|
Name | Description |
v |
double |
Exceptions | |
---|---|
Type | Description |
IOException |
writeNumber(float v)
public void writeNumber(float v)
Writes a JSON float value.
Parameter | |
---|---|
Name | Description |
v |
float |
Exceptions | |
---|---|
Type | Description |
IOException |
writeNumber(int v)
public void writeNumber(int v)
Writes a JSON int value.
Parameter | |
---|---|
Name | Description |
v |
int |
Exceptions | |
---|---|
Type | Description |
IOException |
writeNumber(String encodedValue)
public void writeNumber(String encodedValue)
Writes a JSON numeric value that has already been encoded properly.
Parameter | |
---|---|
Name | Description |
encodedValue |
String |
Exceptions | |
---|---|
Type | Description |
IOException |
writeNumber(BigDecimal v)
public void writeNumber(BigDecimal v)
Writes a JSON big decimal value.
Parameter | |
---|---|
Name | Description |
v |
BigDecimal |
Exceptions | |
---|---|
Type | Description |
IOException |
writeNumber(BigInteger v)
public void writeNumber(BigInteger v)
Writes a JSON big integer value.
Parameter | |
---|---|
Name | Description |
v |
BigInteger |
Exceptions | |
---|---|
Type | Description |
IOException |
writeNumber(long v)
public void writeNumber(long v)
Writes a JSON long value.
Parameter | |
---|---|
Name | Description |
v |
long |
Exceptions | |
---|---|
Type | Description |
IOException |
writeStartArray()
public void writeStartArray()
Writes a JSON start array character '['.
Exceptions | |
---|---|
Type | Description |
IOException |
writeStartObject()
public void writeStartObject()
Writes a JSON start object character '{'.
Exceptions | |
---|---|
Type | Description |
IOException |
writeString(String value)
public void writeString(String value)
Writes a JSON quoted string value.
Parameter | |
---|---|
Name | Description |
value |
String |
Exceptions | |
---|---|
Type | Description |
IOException |