Class MockJsonGenerator (1.41.8)

public class MockJsonGenerator extends JsonGenerator

Beta
Mock for JsonGenerator.

Implementation is thread-safe.

Inheritance

java.lang.Object > JsonGenerator > MockJsonGenerator

Methods

close()

public void close()

Closes the serializer and the underlying output stream or writer, and releases any memory associated with it.

Overrides Exceptions
TypeDescription
IOException

flush()

public void flush()

Flushes any buffered content to the underlying output stream or writer.

Overrides Exceptions
TypeDescription
IOException

getFactory()

public JsonFactory getFactory()

Returns the JSON factory from which this generator was created.

Returns
TypeDescription
JsonFactory
Overrides

writeBoolean(boolean state)

public void writeBoolean(boolean state)

Writes a literal JSON boolean value ('true' or 'false').

Parameter
NameDescription
stateboolean
Overrides Exceptions
TypeDescription
IOException

writeEndArray()

public void writeEndArray()

Writes a JSON end array character ']'.

Overrides Exceptions
TypeDescription
IOException

writeEndObject()

public void writeEndObject()

Writes a JSON end object character '}'.

Overrides Exceptions
TypeDescription
IOException

writeFieldName(String name)

public void writeFieldName(String name)

Writes a JSON quoted field name.

Parameter
NameDescription
nameString
Overrides Exceptions
TypeDescription
IOException

writeNull()

public void writeNull()

Writes a literal JSON null value.

Overrides Exceptions
TypeDescription
IOException

writeNumber(double v)

public void writeNumber(double v)

Writes a JSON double value.

Parameter
NameDescription
vdouble
Overrides Exceptions
TypeDescription
IOException

writeNumber(float v)

public void writeNumber(float v)

Writes a JSON float value.

Parameter
NameDescription
vfloat
Overrides Exceptions
TypeDescription
IOException

writeNumber(int v)

public void writeNumber(int v)

Writes a JSON int value.

Parameter
NameDescription
vint
Overrides Exceptions
TypeDescription
IOException

writeNumber(String encodedValue)

public void writeNumber(String encodedValue)

Writes a JSON numeric value that has already been encoded properly.

Parameter
NameDescription
encodedValueString
Overrides Exceptions
TypeDescription
IOException

writeNumber(BigDecimal v)

public void writeNumber(BigDecimal v)

Writes a JSON big decimal value.

Parameter
NameDescription
vBigDecimal
Overrides Exceptions
TypeDescription
IOException

writeNumber(BigInteger v)

public void writeNumber(BigInteger v)

Writes a JSON big integer value.

Parameter
NameDescription
vBigInteger
Overrides Exceptions
TypeDescription
IOException

writeNumber(long v)

public void writeNumber(long v)

Writes a JSON long value.

Parameter
NameDescription
vlong
Overrides Exceptions
TypeDescription
IOException

writeStartArray()

public void writeStartArray()

Writes a JSON start array character '['.

Overrides Exceptions
TypeDescription
IOException

writeStartObject()

public void writeStartObject()

Writes a JSON start object character '{'.

Overrides Exceptions
TypeDescription
IOException

writeString(String value)

public void writeString(String value)

Writes a JSON quoted string value.

Parameter
NameDescription
valueString
Overrides Exceptions
TypeDescription
IOException