JsonStream

open class JsonStream : JsonWriter

Constructors

JsonStream
Link copied to clipboard
open fun JsonStream(@NonNull() out: Writer)
Constructs a JSONStream

Types

Streamable
Link copied to clipboard
interface Streamable

Functions

beginArray
Link copied to clipboard
open fun beginArray(): JsonWriter
Begins encoding a new array.
beginObject
Link copied to clipboard
open fun beginObject(): JsonWriter
Begins encoding a new object.
close
Link copied to clipboard
open fun close()
Flushes and closes this writer and the underlying Writer.
abstract fun close()
endArray
Link copied to clipboard
open fun endArray(): JsonWriter
Ends encoding the current array.
endObject
Link copied to clipboard
open fun endObject(): JsonWriter
Ends encoding the current object.
flush
Link copied to clipboard
open fun flush()
Ensures all buffered data is written to the underlying Writer and flushes that writer.
abstract fun flush()
getSerializeNulls
Link copied to clipboard
fun getSerializeNulls(): Boolean
Returns true if object members are serialized when their value is null.
isHtmlSafe
Link copied to clipboard
fun isHtmlSafe(): Boolean
Returns true if this writer writes JSON that's safe for inclusion in HTML and XML documents.
isLenient
Link copied to clipboard
open fun isLenient(): Boolean
Returns true if this writer has relaxed syntax rules.
jsonValue
Link copied to clipboard
open fun jsonValue(value: String): JsonWriter
Writes {@code value} directly to the writer without quoting or escaping.
name
Link copied to clipboard
open fun name(@Nullable() name: String): JsonStream
Encodes the property name.
nullValue
Link copied to clipboard
open fun nullValue(): JsonWriter
Encodes {@code null}.
setHtmlSafe
Link copied to clipboard
fun setHtmlSafe(htmlSafe: Boolean)
Configure this writer to emit JSON that's safe for direct inclusion in HTML and XML documents.
setIndent
Link copied to clipboard
fun setIndent(indent: String)
Sets the indentation string to be repeated for each level of indentation in the encoded document.
setLenient
Link copied to clipboard
fun setLenient(lenient: Boolean)
Configure this writer to relax its syntax rules.
setSerializeNulls
Link copied to clipboard
fun setSerializeNulls(serializeNulls: Boolean)
Sets whether object members are serialized when their value is null.
value
Link copied to clipboard
open fun value(@NonNull() file: File)
Writes a File (its content) into the stream
open fun value(@Nullable() object: Any)
Serialises an arbitrary object as JSON, handling primitive types as well as Collections, Maps, and arrays.
open fun value(value: Boolean): JsonWriter
Encodes {@code value}.
open fun value(value: Double): JsonWriter
Encodes {@code value}.
open fun value(value: Boolean): JsonWriter
Encodes {@code value}.
open fun value(value: Number): JsonWriter
Encodes {@code value}.
open fun value(value: String): JsonWriter
Encodes {@code value}.
open fun value(value: Long): JsonWriter
Encodes {@code value}.
open fun value(@Nullable() object: Any, shouldRedactKeys: Boolean)
Serialises an arbitrary object as JSON, handling primitive types as well as Collections, Maps, and arrays.