Class
caplin.trading.validation

ValidationResult

Contains the result of validation by caplin.trading.validation.Validators including any errors. This structure of the errors is transparent to this class. The error structure is defined by the validator that utilises a ValidationResult instance.
No matter what the caplin.trading.validation.Validator does with the errors in a ValidationResult, it will return true from #getValidationSuccessful if the validation succeeded and false otherwise.
A single ValidationResult may have validation information added to many caplin.trading.validation.Validators.

Constructor Summary

Attributes Name and Description
caplin.trading.validation.ValidationResult()

The constructor for ValidationResults.

Method Summary

Attributes Name and Description
void addError(Object oErrorObj)

Adds an error to this ValidationResult.

void fail()

Sets the validation status to unsuccessful.

Array getErrors()

Returns the list of errors.

boolean getValidationSuccessful()

Returns true if the validation was successful, or false otherwise.

Constructor Detail

caplin.trading.validation.ValidationResult()

The constructor for ValidationResults. When a ValidationResult is constructed, its status is successful; that is, an immediate call to getValidationSuccessful() will return true.

Method Detail

void addError(Object oErrorObj)

Adds an error to this ValidationResult. If an error is added, a subsequent call to getValidationSuccessful will return false.

Parameters
Object oErrorObj is an object containing any error that occurred during validation.
See
caplin.trading.validation.Validator

void fail()

Sets the validation status to unsuccessful. A subsequent call to getValidationSuccessful will return false.

See
#getValidationSuccessful

Array getErrors()

Returns the list of errors.

Returns
Returns the errors for all validations so far. The default is an empty array.

boolean getValidationSuccessful()

Returns true if the validation was successful, or false otherwise.

Returns
True if the validation was successful.