Class
caplin.core.validator

MapConfigRequiredKeysValidator

Implements caplin.core.Validator.

Constructor Summary

Attributes Name and Description
caplin.core.validator.MapConfigRequiredKeysValidator(object config)

The ConfigMapValidator is a caplin.trading.validation.Validator that ensures the map being validated contains all required keys specified in the given configuration.

Method Summary

Attributes Name and Description
Array getRequiredFields()

Return an array of all required fields

void validate(Object map, Object attributes, caplin.core.ValidationResult validationResult)

Determine whether the provided map contains all required keys and set result on the provided caplin.core.ValidationResult.

Constructor Detail

caplin.core.validator.MapConfigRequiredKeysValidator(object config)

The ConfigMapValidator is a caplin.trading.validation.Validator that ensures the map being validated contains all required keys specified in the given configuration.

Parameters
object config configuration object specifying the allowed/required keys and values in a map. The validity of the config object is checked by the utility method caplin.core.validator.MapConfigUtility.checkConfig.

Method Detail

Array getRequiredFields()

Return an array of all required fields

Returns
{Array} The required fields.

void validate(Object map, Object attributes, caplin.core.ValidationResult validationResult)

Determine whether the provided map contains all required keys and set result on the provided caplin.core.ValidationResult.

Parameters
Object map The map to validate.
Object attributes attributes to control the validation process. Not used in this implementation.
caplin.core.ValidationResult validationResult the ValidationResult in which to store the result of this validation.