JSONPointer

open class JSONPointer

A JSON Pointer is a simple query language defined for JSON documents by RFC 6901. In a nutshell, JSONPointer allows the user to navigate into a JSON document using strings, and retrieve targeted objects, like a simple form of XPATH. Path segments are separated by the '/' char, which signifies the root of the document when it appears as the first char of the string. Array elements are navigated using ordinals, counting from 0. JSONPointer strings may be extended to any arbitrary number of segments. If the navigation is successful, the matched item is returned. A matched item may be a JSONObject, a JSONArray, or a JSON value. If the JSONPointer string building fails, an appropriate exception is thrown. If the navigation fails to find a match, a JSONPointerException is thrown.

Author

JSON.org

Constructors

Link copied to clipboard
open fun JSONPointer(pointer: String)
Pre-parses and initializes a new JSONPointer instance.
Link copied to clipboard
open fun JSONPointer(refTokens: List<String>)

Types

Link copied to clipboard
open class Builder
This class allows the user to build a JSONPointer in steps, using exactly one segment in each step.

Functions

Link copied to clipboard
Static factory method for Builder.
Link copied to clipboard
open fun queryFrom(document: Any): Any
Evaluates this JSON Pointer on the given document.
Link copied to clipboard
open fun toString(): String
Returns a string representing the JSONPointer path value using string representation
Link copied to clipboard
open fun toURIFragment(): String
Returns a string representing the JSONPointer path value using URI fragment identifier representation