use of org.talend.designer.mapper.language.generation.JavaGenerationManager in project tdi-studio-se by Talend.
the class OutputTable method initFromExternalData.
public void initFromExternalData(ExternalMapperTable externalMapperTable) {
super.initFromExternalData(externalMapperTable);
if (externalMapperTable != null) {
this.reject = externalMapperTable.isReject();
this.rejectInnerJoin = externalMapperTable.isRejectInnerJoin();
this.isJoinTableOf = externalMapperTable.getIsJoinTableOf();
this.isErrorRejectTable = externalMapperTable.isErrorRejectTable();
List<ExternalMapperTableEntry> externalConstraintTableEntries = externalMapperTable.getConstraintTableEntries();
if (externalConstraintTableEntries != null) {
if (!mapperManager.isAdvancedMap()) {
for (ExternalMapperTableEntry entry : externalConstraintTableEntries) {
FilterTableEntry filterTableEntry = new FilterTableEntry(this, entry.getName(), entry.getExpression());
// mapperManager.getProblemsManager().checkProblemsForTableEntry(filterTableEntry, false);
addFilterEntry(filterTableEntry);
}
} else {
ILanguage currentLanguage = LanguageProvider.getCurrentLanguage();
JavaGenerationManager javaGenerationManager = new JavaGenerationManager(currentLanguage);
DataMapExpressionParser expressionParser = new DataMapExpressionParser(currentLanguage);
String expressionFilter = javaGenerationManager.buildConditions(externalConstraintTableEntries, expressionParser);
if (!expressionFilter.trim().equals("")) {
//$NON-NLS-1$
this.getExpressionFilter().setExpression(expressionFilter);
this.setActivateExpressionFilter(true);
}
}
}
}
}
Aggregations