JSONValue

class JSONValue : JSONData

A JSONValue is an arbitrary JSON value. JSONValues are produced by a JSONReader.

Author

Todd L Smith

Constructors

Link copied to clipboard
fun JSONValue(value: Boolean)

Construct a new JSONValue.

Link copied to clipboard
fun JSONValue(value: String)

Construct a new JSONValue.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override 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 override val boolean: Boolean

Extract 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 override 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 override 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 override val string: String

Extract a String.