DefaultValidator

Default implementation of a form control validator.

Used for controls that need no validation beyond the standard required/visibility checks implemented in the base class ControlValidator.

A "null object pattern" implementation - every control has a validator, even if it does no specific validation.

Type Parameters

T

type of the data held by the control

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
protected lateinit var errorManager: ErrorManager
Link copied to clipboard
protected lateinit var formSchema: FormSchema
Link copied to clipboard
protected lateinit var formState: FormState

Functions

Link copied to clipboard
internal fun isControlRequired(control: Control<*>, controlContext: ControlContext): Boolean

Checks whether the control is required, based on its configuration and dependencies.

Link copied to clipboard
internal fun isControlVisible(control: Control<*>, controlContext: ControlContext): Boolean
Link copied to clipboard
private fun isDependencyMet(dependency: ControlDependency<*>, controlContext: ControlContext): Boolean
Link copied to clipboard
internal fun isValueEmpty(value: Any?): Boolean

Checks whether the value is empty or not filled in.

Link copied to clipboard
internal open fun setupFormReferences(formState: FormState, formSchema: FormSchema, errorManager: ErrorManager)

Sets the form component references for the validator.

Link copied to clipboard
open fun validate(controlContext: ControlContext, state: ControlState<*>, control: Control<*>)

Main validation method of a control.

Link copied to clipboard
open override fun validateSpecific(controlContext: ControlContext, value: T)

Does no additional validation.