get

operator fun JsonElement.get(pointer: KPointer): JsonElement?(source)

Returns the JsonElement at the path identified by pointer, or null if a key along the path is absent.

Dispatches by concrete subtype: navigates into JsonObject and JsonArray via the adapter machinery; returns the receiver for the root pointer on a JsonPrimitive; throws for any non-root pointer on a JsonPrimitive or when the path requires navigating through a primitive.

Return

The JsonElement at the specified path, or null if a key along the path is absent.

Parameters

pointer

The KPointer identifying the value to retrieve.

Throws

if an intermediate segment lands on a primitive, or pointer is non-root and the receiver is a JsonPrimitive.