Package-level declarations

Types

Link copied to clipboard

Starting point of the JsonPath DSL This represents the root of the path you want to define in your JsonElement

Properties

Link copied to clipboard

Extract a List of JsonElement from a JsonElement

Link copied to clipboard
val Traversal<JsonElement, JsonElement>.boolean: Traversal<JsonElement, Boolean>

Extract a Boolean value from a JsonElement

Link copied to clipboard
val Optional<JsonElement, JsonElement>.double: Optional<JsonElement, Double>
val Traversal<JsonElement, JsonElement>.double: Traversal<JsonElement, Double>

Extract a Double value from a JsonElement

Link copied to clipboard
val Traversal<JsonElement, JsonElement>.every: Traversal<JsonElement, JsonElement>

Select every entry in JsonArray and JsonObject

Link copied to clipboard
Link copied to clipboard
val Optional<JsonElement, JsonElement>.float: Optional<JsonElement, Float>
val Traversal<JsonElement, JsonElement>.float: Traversal<JsonElement, Float>

Extract a Float value from a JsonElement

Link copied to clipboard
val Optional<JsonElement, JsonElement>.int: Optional<JsonElement, Int>
val Traversal<JsonElement, JsonElement>.int: Traversal<JsonElement, Int>

Extract a Int value from a JsonElement

Link copied to clipboard
val Optional<JsonElement, JsonElement>.long: Optional<JsonElement, Long>
val Traversal<JsonElement, JsonElement>.long: Traversal<JsonElement, Long>

Extract a Long value from a JsonElement

Link copied to clipboard
val Optional<JsonElement, JsonElement>.null: Optional<JsonElement, JsonNull>
val Traversal<JsonElement, JsonElement>.null: Traversal<JsonElement, JsonNull>

Extract null from a JsonElement

Link copied to clipboard
Link copied to clipboard
val Optional<JsonElement, JsonElement>.string: Optional<JsonElement, String>
val Traversal<JsonElement, JsonElement>.string: Traversal<JsonElement, String>

Extract a String value from a JsonElement

Functions

Link copied to clipboard
fun Optional<JsonElement, JsonElement>.at(name: String): Optional<JsonElement, Option<JsonElement>>
fun Traversal<JsonElement, JsonElement>.at(name: String): Traversal<JsonElement, Option<JsonElement>>

Select a property with a name as an Option. This allows you to erase the value by setting it to None, or allows you to overwrite it by setting a new Some.

Link copied to clipboard
inline fun <A> Optional<JsonElement, JsonElement>.extract(parser: Json = Json.Default): Optional<JsonElement, A>
inline fun <A> Traversal<JsonElement, JsonElement>.extract(parser: Json = Json): Traversal<JsonElement, A>

Extract a value of type A with an implicit KotlinX Serializer

fun <A> Optional<JsonElement, JsonElement>.extract(serializer: KSerializer<A>, json: Json = Json.Default): Optional<JsonElement, A>
fun <A> Traversal<JsonElement, JsonElement>.extract(serializer: KSerializer<A>, parser: Json = Json): Traversal<JsonElement, A>

Extract a value of type A given a KSerializer for A

Link copied to clipboard
fun Optional<JsonElement, JsonElement>.filterIndex(predicate: (index: Int) -> Boolean): Traversal<JsonElement, JsonElement>
fun Traversal<JsonElement, JsonElement>.filterIndex(predicate: (index: Int) -> Boolean): Traversal<JsonElement, JsonElement>

Select an indices out of a JsonArray with the given predicate

Link copied to clipboard
fun Optional<JsonElement, JsonElement>.filterKeys(predicate: (keys: String) -> Boolean): Traversal<JsonElement, JsonElement>
fun Traversal<JsonElement, JsonElement>.filterKeys(predicate: (keys: String) -> Boolean): Traversal<JsonElement, JsonElement>

Select keys out of an JsonObject with the given predicate

Link copied to clipboard
operator fun Optional<JsonElement, JsonElement>.get(index: Int): Optional<JsonElement, JsonElement>
operator fun Traversal<JsonElement, JsonElement>.get(index: Int): Traversal<JsonElement, JsonElement>

Select an index out of a JsonArray

operator fun Optional<JsonElement, JsonElement>.get(property: String): Optional<JsonElement, JsonElement>
operator fun Traversal<JsonElement, JsonElement>.get(property: String): Traversal<JsonElement, JsonElement>

Select a property out of a JsonObject

operator fun Optional<JsonElement, JsonElement>.get(range: ClosedRange<Int>): Traversal<JsonElement, JsonElement>
operator fun Traversal<JsonElement, JsonElement>.get(range: ClosedRange<Int>): Traversal<JsonElement, JsonElement>

Select all indices from the range out of a JsonArray

Link copied to clipboard
fun POptional.Companion.jsonArray(): Optional<JsonElement, List<JsonElement>>
fun PTraversal.Companion.jsonArray(): Traversal<JsonArray, JsonElement>
fun Index.Companion.jsonArray(): Index<JsonArray, Int, JsonElement>
Link copied to clipboard
fun POptional.Companion.jsonBoolean(): Optional<JsonElement, Boolean>
Link copied to clipboard
fun POptional.Companion.jsonDouble(): Optional<JsonElement, Double>
Link copied to clipboard
fun PTraversal.Companion.jsonElement(): Traversal<JsonElement, JsonElement>
Link copied to clipboard
fun POptional.Companion.jsonFloat(): Optional<JsonElement, Float>
Link copied to clipboard
fun POptional.Companion.jsonInt(): Optional<JsonElement, Int>
Link copied to clipboard
fun POptional.Companion.jsonLong(): Optional<JsonElement, Long>
Link copied to clipboard
fun POptional.Companion.jsonNull(): Optional<JsonElement, JsonNull>
Link copied to clipboard
fun POptional.Companion.jsonObject(): Optional<JsonElement, Map<String, JsonElement>>
fun PTraversal.Companion.jsonObject(): Traversal<JsonObject, JsonElement>
fun At.Companion.jsonObject(): At<JsonObject, String, Option<JsonElement>>
fun Index.Companion.jsonObject(): Index<JsonObject, String, JsonElement>
Link copied to clipboard
fun POptional.Companion.jsonString(): Optional<JsonElement, String>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun matchStartEndIndex(selector: String): Pair<Int, Int>?
Link copied to clipboard
fun matchStartIndex(selector: String): Int?
Link copied to clipboard
fun Optional<JsonElement, JsonElement>.path(path: String, fieldDelimiter: String = ".", indexDelimiter: String = "["): Optional<JsonElement, JsonElement>
fun Traversal<JsonElement, JsonElement>.path(path: String, fieldDelimiter: String = ".", indexDelimiter: String = "["): Traversal<JsonElement, JsonElement>

Select path with dot (.) or bracket (i) notation

Link copied to clipboard
fun Optional<JsonElement, JsonElement>.pathEvery(path: String, fieldDelimiter: String = ".", indexDelimiter: String = "["): Traversal<JsonElement, JsonElement>
fun Traversal<JsonElement, JsonElement>.pathEvery(path: String, fieldDelimiter: String = ".", indexDelimiter: String = "["): Traversal<JsonElement, JsonElement>

Select path with multiple results, see selectEvery for the allowed selectors

Link copied to clipboard
fun Optional<JsonElement, JsonElement>.select(selector: String): Optional<JsonElement, JsonElement>
fun Traversal<JsonElement, JsonElement>.select(selector: String): Traversal<JsonElement, JsonElement>

Select value at selector. The following syntax is supported for selector:

Link copied to clipboard
fun Optional<JsonElement, JsonElement>.selectEvery(selector: String): Traversal<JsonElement, JsonElement>
fun Traversal<JsonElement, JsonElement>.selectEvery(selector: String): Traversal<JsonElement, JsonElement>

Select values at selector. The following syntax is supported for selector:

Link copied to clipboard
fun String.splitTwice(removedDelimiter: String = ".", keptDelimiter: String = "["): List<String>

Splits a string given those delimiters. removedDelimiter is removed after splitting, whereas keptDelimiter is kept around.