Class
caplin.trading.validation

IntegerValidator

The IntegerValidator is a caplin.trading.validation.AbstractFieldValidator that validates an integer value according the to specified domain constraints. This class is immutable.

Constructor Summary

Attributes Name and Description
caplin.trading.validation.IntegerValidator(Array l_pFields, boolean bAllowStrings, int nMin, int nMax)

The constructor for the IntegerValidator.

Method Summary

Attributes Name and Description
String validateField(String sFieldValue)

Performs validation on the specified field according to determine if the field value is an integer.

Methods inherited from class caplin.trading.validation.AbstractFieldValidator:
validate

Constructor Detail

caplin.trading.validation.IntegerValidator(Array l_pFields, boolean bAllowStrings, int nMin, int nMax)

The constructor for the IntegerValidator.

Parameters
Array l_pFields An array of string field names that must be present in the data to validate. Must not be null.
boolean bAllowStrings If true, integers may be specified in strings. Defaults to true.
int nMin Optional minimum that the value may be. If it's not set, then the value has no lower bound. If it is set it must be a number.
int nMax Optional maximum that the value may be. If it's not set, then the value has no higher bound. If it is set it must be a number.
Throws
caplin.core.Error
If the list of fields is not an array of strings, or any of the parameters are of the wrong type.

Method Detail

String validateField(String sFieldValue)

Performs validation on the specified field according to determine if the field value is an integer. If this validator was constructed with a minimum or maximum value (nMin, nMax), the field value will be checked to determine if it exists within those bounds.

Parameters
String sFieldValue The field value to validate.
Returns
An error message indicating the validation failure, or null if no errors occurred.