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

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

Extensions

Link copied to clipboard
val JsonElement.jsonArray: JsonArray

Convenience method to get current element as JsonArray

Link copied to clipboard
val JsonElement.jsonNull: JsonNull

Convenience method to get current element as JsonNull

Link copied to clipboard
val JsonElement.jsonObject: JsonObject

Convenience method to get current element as JsonObject

Link copied to clipboard
val JsonElement.jsonPrimitive: JsonPrimitive

Convenience method to get current element as JsonPrimitive