Search in sources :

Example 1 with PatternTransformer

use of org.talend.dq.pattern.PatternTransformer in project tdq-studio-se by Talend.

the class ChartTableFactory method createPattern.

/**
 * DOC bZhou Comment method "createPattern".
 *
 * @param analysis
 * @param itemEntity
 * @param pattTransformer
 */
public static void createPattern(Analysis analysis, String query) {
    DbmsLanguage language = DbmsLanguageFactory.createDbmsLanguage(analysis);
    PatternTransformer pattTransformer = new PatternTransformer(language);
    String regex = pattTransformer.getRegexp(query);
    IFolder folder = ResourceManager.getPatternRegexFolder();
    // $NON-NLS-1$ //$NON-NLS-2$
    new CreatePatternAction(folder, ExpressionType.REGEXP, "'" + regex + "'", language.getDbmsName()).run();
}
Also used : DbmsLanguage(org.talend.dq.dbms.DbmsLanguage) PatternTransformer(org.talend.dq.pattern.PatternTransformer) CreatePatternAction(org.talend.dataprofiler.core.pattern.actions.CreatePatternAction) IFolder(org.eclipse.core.resources.IFolder)

Aggregations

IFolder (org.eclipse.core.resources.IFolder)1 CreatePatternAction (org.talend.dataprofiler.core.pattern.actions.CreatePatternAction)1 DbmsLanguage (org.talend.dq.dbms.DbmsLanguage)1 PatternTransformer (org.talend.dq.pattern.PatternTransformer)1