ValidationContext

open class ValidationContext(value: Any?, schema: Schema<*>, val path: AbsolutePath, val schemaPath: AbsolutePath, val dependenciesInfo: DependenciesValueInfo, val externalContexts: ExternalContexts) : ComputationContext(source)

Context provided to a validation when running it, contains the values of the validation's dependencies at the time the validation was executed.

Constructors

Link copied to clipboard
constructor(value: Any?, schema: Schema<*>, path: AbsolutePath, schemaPath: AbsolutePath, dependenciesInfo: DependenciesValueInfo, externalContexts: ExternalContexts)

Properties

Link copied to clipboard

Value information for each dependency of the computation. Mapping of keys as declared in the computation dependencies to their respective value information.

Link copied to clipboard
Link copied to clipboard

Path at which the computation is occurring.

Link copied to clipboard

Path of the schema at which the computation is occurring.

Functions

Link copied to clipboard
fun <T> dependency(dependencyKey: String): T

Returns the value of the dependency with key dependencyKey.

Link copied to clipboard
fun <T> dependencyInfo(dependencyKey: String): ValueInfo<T>

Obtains the value information of the dependency with key dependencyKey.

Link copied to clipboard
fun <T> dependencyInfoOrNull(dependencyKey: String): ValueInfo<T>?

Obtains the value information of the dependency with key dependencyKey or null if the dependency could not be found in the form.

Link copied to clipboard
fun <T> dependencyOrNull(dependencyKey: String): T?

Returns the value of the dependency with key dependencyKey or null if the dependency could not be found in the form.

Link copied to clipboard
fun dependencyPath(dependencyKey: String): AbsolutePath

Returns the path of the dependency with key dependencyKey.

Link copied to clipboard

Returns the path of the dependency with key dependencyKey or null if the dependency could not be found in the form.

Link copied to clipboard
fun <T> dependencySchema(dependencyKey: String): Schema<T>

Returns the schema of the dependency with key dependencyKey.

Link copied to clipboard
fun <T> dependencySchemaOrNull(dependencyKey: String): Schema<T>?

Returns the schema of the dependency with key dependencyKey or null if the dependency could not be found in the form.

Link copied to clipboard
fun <T> externalContext(externalContextName: String): T

Returns the external context with name externalContextName available to the computation.

Link copied to clipboard
fun <T> externalContextOrNull(externalContextName: String): T?

Returns the external context with name externalContextName available to the computation or null if the external context could not be found.

Link copied to clipboard
fun <T> schema(): Schema<T>

Schema at which the computation is occurring.

Link copied to clipboard
fun <T> value(): T

Value being validated.