use of org.ow2.proactive.scheduler.common.job.factories.spi.model.validator.RangeValidator in project scheduling by ow2-proactive.
the class RangeParserValidator method createValidator.
@Override
protected Validator<T> createValidator(String model, Converter<T> converter) throws ModelSyntaxException {
if (model.matches(getTypeRegexp())) {
return new RangeValidator();
}
String mainRangeRegexp = "^" + getTypeRegexp() + RANGE_MAIN_REGEXP + "$";
String rangeString = parseAndGetOneGroup(model, mainRangeRegexp);
try {
return new RangeValidator<>(extractRange(rangeString, converter));
} catch (IllegalArgumentException e) {
throw new ModelSyntaxException(e.getMessage(), e);
}
}
Aggregations