Class
caplin.core

ValidationResult

ValidationResults are used to store the output from a caplin.core.Validator.

Constructor Summary

Attributes Name and Description
caplin.core.ValidationResult(caplin.core.ValidationResultListener oValidationResultListener)

Creates a new ValidationResult.

Method Summary

Attributes Name and Description
String getFailureMessage()

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

boolean hasResult()

Whether or not validation has completed for this ValidationResult.

boolean isValid()

Whether or not validation succeeded.

void setResult(boolean isValid, String sFailureMessage)

Specifies the result of validation.

Constructor Detail

caplin.core.ValidationResult(caplin.core.ValidationResultListener oValidationResultListener)

Creates a new ValidationResult.

Parameters
caplin.core.ValidationResultListener oValidationResultListener (optional) Listener informed when the validation result is available.

Method Detail

String getFailureMessage()

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

Returns
{String} the failure message or null if there isn't one.

boolean hasResult()

Whether or not validation has completed for this ValidationResult.

Returns
{boolean} true if setResult has been called, false otherwise.

boolean isValid()

Whether or not validation succeeded.

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

void setResult(boolean isValid, String sFailureMessage)

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

Parameters
boolean isValid whether or not the current validation succeeded or failed.
String sFailureMessage a message describing why validation failed if it did. Can be omitted if validation succeeded.