Caplin Trader 4.8.0

Class: module:br/validation/ValidationResult

module:br/validation/ValidationResult

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

Constructor

new module:br/validation/ValidationResult(oValidationResultListener)

Creates a new instance of ValidationResult.
Parameters:
Name Type Description
oValidationResultListener module:br/validation/ValidationResultListener (optional) Listener informed when the validation result is available.

Methods

getFailureMessage() → {String}

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
String

hasResult() → {boolean}

Whether or not validation has completed for this ValidationResult.
Returns:
true if setResult has been called, false otherwise.
Type
boolean

isValid() → {boolean}

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

setResult(bIsValid, sFailureMessage)

Specifies the result of validation. This should only be called once during the lifetime of the ValidationResult.
Parameters:
Name Type Description
bIsValid boolean whether or not the current validation succeeded or failed.
sFailureMessage String a message describing why validation failed if it did. Can be omitted if validation succeeded.