JSONValue

interface JSONValue

This interface provides convenient methods to browse a JSON value (typically returned by the underlying Javascript engine). In particular, these methods support conversion to native Java types (such as String, Number, Boolean) as well as to POJO (Plain Old Java Objects) types.

Functions

getProperty
Link copied to clipboard
abstract fun getProperty(property: String): Any
If this JSON value is a JSON object, gets the raw Javascript object representing the value of a given property of this JSON object.
getPropertyAs
Link copied to clipboard
abstract fun <T> getPropertyAs(property: String, type: Class<T>): T
If this JSON value is a JSON object, gets the value of a given property as an object of a given type.
getPropertyAsListOf
Link copied to clipboard
abstract fun <T> getPropertyAsListOf(property: String, type: Class<T>): List<T>
If this JSON value is a JSON object, gets the value of a given property as a list of elements of a given type.
getPropertyAsMapOf
Link copied to clipboard
abstract fun <T> getPropertyAsMapOf(property: String, type: Class<T>): Map<String, T>
If this JSON value is a JSON object, gets the value of a given property as an associative map from String to a given type.
getValue
Link copied to clipboard
abstract fun getValue(): Any
Gets the raw Javascript object representing this JSON value.
getValueAs
Link copied to clipboard
abstract fun <T> getValueAs(type: Class<T>): T
Gets this JSON value as an object of a given type.
getValueAsListOf
Link copied to clipboard
abstract fun <T> getValueAsListOf(type: Class<T>): List<T>
Gets this JSON value as a list of elements of a given type.
getValueAsMapOf
Link copied to clipboard
abstract fun <T> getValueAsMapOf(type: Class<T>): Map<String, T>
Gets this JSON value as an associative map from String to a given type.
stringify
Link copied to clipboard
abstract fun stringify(): String
Gets a string representation of this JSON value.

Properties

NULL
Link copied to clipboard
val NULL: JSONValue