Search in sources :

Example 6 with ValidationStatus

use of io.atlasmap.v2.ValidationStatus in project atlasmap by atlasmap.

the class PositiveIntegerValidator method validate.

@Override
public void validate(Object target, List<Validation> validations, String id, ValidationStatus status) {
    Integer value = (Integer) target;
    if (value == null || value < 0) {
        Validation validation = new Validation();
        validation.setScope(scope);
        validation.setId(id);
        validation.setMessage(String.format(violationMessage, target != null ? target.toString() : null));
        validation.setStatus(status);
        validations.add(validation);
    }
}
Also used : Validation(io.atlasmap.v2.Validation)

Aggregations

Validation (io.atlasmap.v2.Validation)6 LookupTable (io.atlasmap.v2.LookupTable)1 LookupTables (io.atlasmap.v2.LookupTables)1 Collection (java.util.Collection)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1