Search in sources :

Example 1 with ExternalDataType

use of org.talend.core.model.process.IExternalData.ExternalDataType in project tdi-studio-se by Talend.

the class MapDataDelegateHelper method getExpressionColumns.

/**
     * 
     * ggu Comment method "getExpressionColumns".
     * 
     * @param expression -> if null, will return the all table for type
     * @param types ->
     * @return
     */
public Map<IExternalMapTable, List<IExternalMapEntry>> getExpressionColumns(String expression, ExternalDataType... types) {
    Map<IExternalMapTable, List<IExternalMapEntry>> tableMap = new HashMap<IExternalMapTable, List<IExternalMapEntry>>();
    if (types != null && types.length > 0) {
        for (ExternalDataType type : types) {
            switch(type) {
                case INPUT:
                    return getExpressionColumns(getInputTables(), expression);
                case OUTPUT:
                    return getExpressionColumns(getOutputTables(), expression);
                case VAR:
                    return getExpressionColumns(getVarsTables(), expression);
                default:
            }
        }
    } else {
        addAll(tableMap, getExpressionColumns(getInputTables(), expression));
        addAll(tableMap, getExpressionColumns(getOutputTables(), expression));
        addAll(tableMap, getExpressionColumns(getVarsTables(), expression));
    }
    return tableMap;
}
Also used : ExternalDataType(org.talend.core.model.process.IExternalData.ExternalDataType) HashMap(java.util.HashMap) IExternalMapTable(org.talend.core.model.process.node.IExternalMapTable) ArrayList(java.util.ArrayList) List(java.util.List) IExternalMapEntry(org.talend.core.model.process.node.IExternalMapEntry)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 ExternalDataType (org.talend.core.model.process.IExternalData.ExternalDataType)1 IExternalMapEntry (org.talend.core.model.process.node.IExternalMapEntry)1 IExternalMapTable (org.talend.core.model.process.node.IExternalMapTable)1