Collection

data class Collection(val parent: EvaluationScope, val path: JsonPointer, val index: Int) : EvaluationScope

One item of a list template, nested inside parent.

base is the item's own pointer — the template's bound path extended by index — so a relative binding of name inside a template over /employees reads /employees/0/name for the first instance.

Constructors

Link copied to clipboard
constructor(parent: EvaluationScope, path: JsonPointer, index: Int)

Properties

Link copied to clipboard
open override val base: JsonPointer

The pointer that a relative binding in this scope is measured from.

Link copied to clipboard
open override val index: Int

The 0-based index of the item being iterated, or null outside a list template.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

The index @index reads here, or null when this scope is not inside a list template.

Link copied to clipboard

The scope for item index of a template bound to path, nested inside this scope.

Link copied to clipboard

pointer rebased on this scope: absolute pointers unchanged, relative ones measured from EvaluationScope.base.

Link copied to clipboard
fun EvaluationScope.resolve(dataModel: JsonElement, pointer: JsonPointer): JsonElement?

The value pointer addresses in dataModel once rebased on this scope, or null when absent.