Validator (class)
public Validator
Import from: CURL.GUI.STANDARD. Defined in package CURL.GUI.CONTROL-VALIDATION.
Direct Known Subclasses: NumericValidator, EnablingValidator, DialogValidator, StringValidator, DomainValidator, RegExpValidator

An object used to check that a control value is valid.


Constructors
from-ValidationPattern:Creates a Validator from a ValidationPattern.
factory public implicit {Validator.from-ValidationPattern}:Validator

Methods
handle-validation-complete:Show an error message, if appropriate.
public {Validator.handle-validation-complete
controller:ValidationController,
target:ActiveTraversor,
partial?:bool
}:void
missing?:Return true if a required value is missing.
public {Validator.missing?}:bool
validate:Determine if a target control is valid.
public {Validator.validate
controller:ValidationController,
target:ActiveTraversor,
partial?:bool
}:#Visual
validate-value:Determine if the value of a control is valid.
public {Validator.validate-value
controller:ValidationController,
target:ValueControl,
partial?:bool
}:#Visual
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize



Constructor Details
from-ValidationPattern (factory)
public implicit {Validator.from-ValidationPattern}:Validator

Creates a Validator from a ValidationPattern.







Method Details
handle-validation-complete (method)
public {Validator.handle-validation-complete
controller:ValidationController,
target:ActiveTraversor,
partial?:bool
}:void

Show an error message, if appropriate.



missing? (method)
public {Validator.missing?}:bool

Return true if a required value is missing.

Description

If a value is not required, this method always returns true.

A string is considered empty unless it has at least one nonblank character. Any other non-null value yields false.
controller: The ValidationController that is driving this validation cycle.
target: The control being validated.


validate (method)
public {Validator.validate
controller:ValidationController,
target:ActiveTraversor,
partial?:bool
}:#Visual

Determine if a target control is valid.

Description

This base class works for ValueControls by calling Validator.validate-value. A Validator intended to be used on something that is not a ValueControl should override this method.
controller: The ValidationController that is driving this validation cycle.
target: The control to be validated.
partial?: Indicates that the entry that triggered the validation cycle may not be complete.

Returns

Return null if the target is valid, otherwise an error message.


validate-value (method)
public {Validator.validate-value
controller:ValidationController,
target:ValueControl,
partial?:bool
}:#Visual

Determine if the value of a control is valid.

Description

Check the value of a control. This base class method simply returns null. A subclass will usually do specialized value checking by overriding this method.
controller: The ValidationController that is driving this validation cycle.
target: The control to be validated.
partial?: Indicates that the entry that triggered the validation cycle may not be complete.

Returns

Return null if the value is valid, otherwise an error message.