Caplin Trader 5.1.0

Class: module:br-validation/ValidationResult

module:br-validation/ValidationResult(oValidationResultListeneropt)

ValidationResults are used to store the output from a module:br-validation/Validator.

Constructor

new module:br-validation/ValidationResult(oValidationResultListeneropt)

Creates a new instance of ValidationResult.

Parameters:
Name Type Attributes Description
oValidationResultListener module:br-validation/ValidationResultListener <optional>

Listener informed when the validation result is available.

Methods

getFailureMessage() → {null|string|undefined}

Gets any message that validation may have returned if validation was not successful.

Returns:

the failure message or null if there isn't one.

Type
null | string | undefined

hasResult() → {boolean}

Whether or not validation has completed for this ValidationResult.

Returns:

true if setResult has been called, false otherwise.

Type
boolean

isValid() → {boolean|null}

Whether or not validation succeeded.

Returns:

true if the validation succeeded, false if it failed and null if it has not yet happened.

Type
boolean | null

setResult(bIsValid, sFailureMessageopt)

Specifies the result of validation. This should only be called once during the lifetime of the ValidationResult.

Parameters:
Name Type Attributes Description
bIsValid boolean

whether or not the current validation succeeded or failed.

sFailureMessage string <optional>

a message describing why validation failed if it did. Can be omitted if validation succeeded.