JSONData

sealed class JSONData : JSONFriendly

JSONData is the superclass of JSONValue, JSONNumber, JSONArray, and JSONObject. A readsJSONReader.read a single JSONData.

Author

Todd L Smith

Functions

Link copied to clipboard
abstract fun writeTo(writer: JSONWriter)

Emit a JSON representation of the receiver onto the specified writer.

Properties

Link copied to clipboard
open val bigDecimal: BigDecimal

If this is a JSONNumber, extract its value as a BigDecimal, otherwise throw a ClassCastException.

Link copied to clipboard
open val bigInteger: BigInteger

If this is a JSONNumber, extract its value as a BigInteger, otherwise throw a ClassCastException. If the value has a non-zero fractional part, throw an ArithmeticException.

Link copied to clipboard
open val boolean: Boolean

Extract a Boolean, or throw a ClassCastException if the value is not a boolean.

Link copied to clipboard
open val double: Double

If this is a JSONNumber, extract its value as a Double, otherwise throw a ClassCastException.

Link copied to clipboard
open val float: Float

If this is a JSONNumber, extract its value as a Float, otherwise throw a ClassCastException.

Link copied to clipboard
open val int: Int

If this is a JSONNumber, extract its value as an Int, otherwise throw a ClassCastException. If the value has a non-zero fractional part or is out of range, throw an ArithmeticException.

Link copied to clipboard
open val isArray: Boolean

Is the receiver a JSON?

Link copied to clipboard
open val isBoolean: Boolean

Is the receiver a JSON boolean?

Link copied to clipboard
open val isNull: Boolean

Is the receiver a JSON null?

Link copied to clipboard
open val isNumber: Boolean

Is the receiver a JSON?

Link copied to clipboard
open val isObject: Boolean

Is the receiver a JSON?

Link copied to clipboard
open val isString: Boolean

Is the receiver a JSON string?

Link copied to clipboard
open val long: Long

If this is a JSONNumber, extract its value as a Long, otherwise throw a ClassCastException. If the value has a non-zero fractional part or is out of range, throw an ArithmeticException.

Link copied to clipboard
open val string: String

Extract a String, or throw a ClassCastException if the value is not a string.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard