dependency
protected inline fun <TDependency> dependency(path: Path, dependencyKey: String? = null): PropertyDelegateProvider<Validation<T>, ReadOnlyProperty<ValidationContext, TDependency>>(source)
protected inline fun <TDependency> dependency(path: String, dependencyKey: String? = null): PropertyDelegateProvider<Validation<T>, ReadOnlyProperty<ValidationContext, TDependency>>(source)
Function used to declare a dependency to a path and delegate access to its value within a ValidationContext.
If the dependency could not be found in the form during the execution of the validation, then accessing this dependency will throw DependencyNotFoundException.
It should be used as follows:
private val ValidationContext.dependencyKey: Type by dependency(path)Content copied to clipboard
Validation dependency paths may contain a single recursive wildcard at the end, indicating that the validation should be reevaluated by the form manager whenever a child value of the dependency changes. Otherwise, a dependency must contain no wildcards.