Entity Validation
The Xpress Insight API provides an entity validator, insight.validation.EntityValidator.
You can pass in a value with an entity to test against to the
insight.validation.EntityValidator.checkValue() method. This will do the following tasks as required:
- If the data dimension is NORMAL_DATA then base (primitive) type checking is performed.
- If a custom validator is specified for the entity in the given dimension, it is performed after the base type checking.
You can supply a custom validator for an entity in a given dimension by using the insight.validation.EntityValidator.setValidator() method.
The EntityValidator and any callback functions supplied to the setValidator() method should all return an insight.validation.Result instance. This return object is used to store the Boolean result of a validation process as well as an optional error message (if an error occurred).