use of org.talend.dq.pattern.PatternBuilder in project tdq-studio-se by Talend.
the class CreatePatternWizard method initCWMResourceBuilder.
public ModelElement initCWMResourceBuilder() {
patternBuilder = new PatternBuilder();
boolean patternInitialized = patternBuilder.initializePattern(parameter.getName());
if (patternInitialized) {
Pattern pattern = patternBuilder.getPattern();
String lang = PatternLanguageType.findLanguageByName(parameter.getLanguage());
String express = parameter.getExpression();
RegularExpression regularExpr = BooleanExpressionHelper.createRegularExpression(lang, express);
regularExpr.setExpressionType(type.getLiteral());
pattern.getComponents().add(regularExpr);
return pattern;
}
return null;
}
use of org.talend.dq.pattern.PatternBuilder in project tdq-studio-se by Talend.
the class CreatePatternsMigratorTask method newPattern.
private Pattern newPattern(String name, String lang, String express) {
PatternBuilder patternBuilder = new PatternBuilder();
boolean patternInitialized = patternBuilder.initializePattern(name);
if (patternInitialized) {
Pattern pattern = patternBuilder.getPattern();
RegularExpression regularExpr = BooleanExpressionHelper.createRegularExpression(lang, express);
// $NON-NLS-1$
regularExpr.setExpressionType("REGEXP");
pattern.getComponents().add(regularExpr);
return pattern;
}
return null;
}
use of org.talend.dq.pattern.PatternBuilder in project tdq-studio-se by Talend.
the class AddPatternISBN13Task method newPattern.
private Pattern newPattern(String name, String lang, String express) {
PatternBuilder patternBuilder = new PatternBuilder();
boolean patternInitialized = patternBuilder.initializePattern(name);
if (patternInitialized) {
Pattern pattern = patternBuilder.getPattern();
RegularExpression regularExpr = BooleanExpressionHelper.createRegularExpression(lang, express);
// $NON-NLS-1$
regularExpr.setExpressionType("REGEXP");
pattern.getComponents().add(regularExpr);
return pattern;
}
return null;
}
Aggregations