use of org.talend.designer.mapper.language.perl.PerlLanguage in project tdi-studio-se by Talend.
the class DataMapExpressionParser method addRefArrayPointer.
public String addRefArrayPointer(String expression, TableEntryLocation[] locations) {
String returnedExpression = expression;
PerlLanguage perlLanguage = (PerlLanguage) language;
for (TableEntryLocation location : locations) {
recompilePatternIfNecessary(StringHelper.replacePrms(perlLanguage.getSubstPatternToAddRefArrayPointer(), new Object[] { location.tableName }));
if (returnedExpression != null) {
matcher.setMultiline(true);
Perl5Substitution substitution = new Perl5Substitution(//$NON-NLS-1$
language.getPrefixTableRegexp() + "$1->" + perlLanguage.getPrefixFieldRegexp() + "$2" + perlLanguage.getSuffixFieldRegexp(), //$NON-NLS-1$
Perl5Substitution.INTERPOLATE_ALL);
returnedExpression = substitute(matcher, pattern, substitution, returnedExpression, Util.SUBSTITUTE_ALL);
}
}
return returnedExpression;
}
use of org.talend.designer.mapper.language.perl.PerlLanguage in project tdi-studio-se by Talend.
the class LanguageProvider method getCurrentLanguage.
public static ILanguage getCurrentLanguage() {
ECodeLanguage codeLanguage = null;
if (!MapperMain.isStandAloneMode()) {
RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
codeLanguage = repositoryContext.getProject().getLanguage();
} else {
codeLanguage = ECodeLanguage.PERL;
}
switch(codeLanguage) {
case JAVA:
if (!(language instanceof JavaLanguage) || LanguageProvider.language == null) {
LanguageProvider.language = getJavaLanguage();
}
break;
default:
if (!(language instanceof PerlLanguage) || LanguageProvider.language == null) {
LanguageProvider.language = getPerlLanguage();
}
}
return LanguageProvider.language;
}
Aggregations