use of org.whole.lang.grammars.model.Pattern in project whole by wholeplatform.
the class GrammarsDefaultDataTypeParser method matches.
protected String matches(EntityDescriptor<?> ed, String value) {
Pattern pattern = grammarBasedDataTypeParser.getDataTerminal(ed).getPattern();
java.util.regex.Pattern compiledPattern = Matcher.matchImpl(GrammarsEntityDescriptorEnum.CompiledPattern, pattern) ? ((CompiledPattern) pattern).getValue() : java.util.regex.Pattern.compile(((RegExp) pattern).getValue());
if (!compiledPattern.matcher(value).matches())
throw new WholeIllegalArgumentException(WholeMessages.no_data_type);
return value;
}
Aggregations