Module com.grack.nanojson
Package com.grack.nanojson
Interface JsonSink<SELF extends JsonSink<SELF>>
- Type Parameters:
SELF- A subclass ofJsonSink.
- All Known Implementing Classes:
JsonAppendableWriter,JsonBuilder,JsonStringWriter
public interface JsonSink<SELF extends JsonSink<SELF>>
-
Method Summary
Modifier and TypeMethodDescriptionarray()Starts an array.Starts an array within an object, prefixed with a key.array(String key, Collection<?> c) Emits the start of an array with a key.array(Collection<?> c) Emits the start of an array.end()Ends the current array or object.Writes the key of a key/value pair.nul()Emits a 'null' token.Emits a 'null' token with a key.object()Starts an object.Starts an object within an object, prefixed with a key.Emits the start of an object with a key.Emits the start of an object.value(boolean b) Emits a boolean value.value(double d) Emits a double value.value(float f) Emits a float value.value(int i) Emits an integer value.value(long l) Emits a long value.Emits aNumbervalue.Emits an object if it is a JSON-compatible type, otherwise throws an exception.Emits a string value (or null).Emits a boolean value with a key.Emits a double value with a key.Emits a float value with a key.Emits an integer value with a key.Emits a long value with a key.Emits aNumbervalue with a key.Emits an object with a key if it is a JSON-compatible type, otherwise throws an exception.Emits a string value (or null) with a key.
-
Method Details
-
array
Emits the start of an array. -
array
Emits the start of an array with a key. -
object
Emits the start of an object. -
object
Emits the start of an object with a key. -
nul
SELF nul()Emits a 'null' token. -
nul
Emits a 'null' token with a key. -
value
Emits an object if it is a JSON-compatible type, otherwise throws an exception. -
value
Emits an object with a key if it is a JSON-compatible type, otherwise throws an exception. -
value
Emits a string value (or null). -
value
Emits an integer value. -
value
Emits a long value. -
value
Emits a boolean value. -
value
Emits a double value. -
value
Emits a float value. -
value
Emits aNumbervalue. -
value
Emits a string value (or null) with a key. -
value
Emits an integer value with a key. -
value
Emits a long value with a key. -
value
Emits a boolean value with a key. -
value
Emits a double value with a key. -
value
Emits a float value with a key. -
value
Emits aNumbervalue with a key. -
array
SELF array()Starts an array. -
object
SELF object()Starts an object. -
array
Starts an array within an object, prefixed with a key. -
object
Starts an object within an object, prefixed with a key. -
end
SELF end()Ends the current array or object. -
key
Writes the key of a key/value pair.
-