JsonElement

sealed class JsonElement

Class representing single JSON element. Can be JsonPrimitive, JsonArray or JsonObject.

JsonElement.toString properly prints JSON tree as valid JSON, taking into account quoted values and primitives. Whole hierarchy is serializable, but only when used with Json as JsonElement is purely JSON-specific structure which has a meaningful schemaless semantics only for JSON.

The whole hierarchy is serializable only by Json format.

Inheritors

JsonPrimitive
Link copied to clipboard
JsonObject
Link copied to clipboard
JsonArray
Link copied to clipboard

Extensions

jsonArray
Link copied to clipboard
val JsonElement.jsonArray: JsonArray

Convenience method to get current element as JsonArray

jsonNull
Link copied to clipboard
val JsonElement.jsonNull: JsonNull

Convenience method to get current element as JsonNull

jsonObject
Link copied to clipboard
val JsonElement.jsonObject: JsonObject

Convenience method to get current element as JsonObject

jsonPrimitive
Link copied to clipboard
val JsonElement.jsonPrimitive: JsonPrimitive

Convenience method to get current element as JsonPrimitive