Search in sources :

Example 1 with RegexpValidator

use of org.ow2.proactive.scheduler.common.job.factories.spi.model.validator.RegexpValidator in project scheduling by ow2-proactive.

the class RegexpParserValidator method createValidator.

@Override
protected Validator<String> createValidator(String model, Converter<String> converter) throws ModelSyntaxException {
    String regexpRegexp = "^" + REGEXP_TYPE_REGEXP + LEFT_DELIMITER_REGEXP + "(.+)" + RIGHT_DELIMITER_REGEXP + "$";
    String regexpString = parseAndGetOneGroup(model, regexpRegexp);
    try {
        return new RegexpValidator(regexpString);
    } catch (PatternSyntaxException e) {
        throw new ModelSyntaxException(e.getMessage(), e);
    }
}
Also used : ModelSyntaxException(org.ow2.proactive.scheduler.common.job.factories.spi.model.exceptions.ModelSyntaxException) RegexpValidator(org.ow2.proactive.scheduler.common.job.factories.spi.model.validator.RegexpValidator) PatternSyntaxException(java.util.regex.PatternSyntaxException)

Aggregations

PatternSyntaxException (java.util.regex.PatternSyntaxException)1 ModelSyntaxException (org.ow2.proactive.scheduler.common.job.factories.spi.model.exceptions.ModelSyntaxException)1 RegexpValidator (org.ow2.proactive.scheduler.common.job.factories.spi.model.validator.RegexpValidator)1