EvaluationContext

Everything an evaluation reads besides the call itself.

scope is what makes the same expression mean different things in different rows of a list: it fixes where a relative binding measures from and what @index returns.

locale defaults to a placeholder, and four of the catalog's functions run on it. FallbackLocaleFormatter opens its own documentation by saying it is not a locale implementation: formatCurrency renders USD 1,234.50 rather than a symbol, pluralize applies the English n == 1 rule whatever the language, and formatDate uses English month names. That is the right default -- a library that read the device by default would make one payload render differently in CI than on a desk -- but it is chosen silently, so it is said here. withLocale is how a caller stops running on it, and A2uiRendererConfig.withLocale is how a Compose host does.

The constructor is not this class's compatibility surface. Only dataModel is required there; everything else arrives through a withLocale-shaped derivation. That is not decoration: a public constructor with seven parameters is the ABI, so an eighth field could not be added to it -- with a default or without one, and as a data class or not -- without every consumer compiled against the old descriptor failing with NoSuchMethodError rather than being asked to recompile. Through derivations, a new field adds a new method and breaks nothing. The cost is that construction reads as a chain rather than as named arguments, and that is the trade taken.

Constructors

Link copied to clipboard
constructor(dataModel: JsonElement)

An evaluation against dataModel with every other choice left at its default: the root scope, the locale-independent formatter, InvocationContext.RENDER, no UrlOpener, the default limits, and this library's strict Json.

Properties

Link copied to clipboard
val dataModel: JsonElement
Link copied to clipboard
Link copied to clipboard
val json: Json
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun EvaluationContext.evaluate(value: BoundValue): JsonElement

value resolved against this context.

fun EvaluationContext.evaluate(call: FunctionCall): JsonElement

call evaluated against this context. @see evaluate

Link copied to clipboard

The ValidationResult a check's condition evaluates to.

Link copied to clipboard

The same context evaluating in scope instead -- one row of a list template, typically.

Link copied to clipboard

The same context evaluating as invocation.

Link copied to clipboard
fun withJson(json: Json): EvaluationContext

The same context decoding through json.

Link copied to clipboard

The same context bounded by limits.

Link copied to clipboard

The same context formatting through locale.

Link copied to clipboard

The same context opening URLs through urlOpener. Null puts it back to refusing.