Search in sources :

Example 1 with DelimitedFileIndicatorImpl

use of org.talend.dataprofiler.core.model.impl.DelimitedFileIndicatorImpl in project tdq-studio-se by Talend.

the class ModelElementIndicatorHelper method getModelElementDisplayName.

/**
 * DOC xqliu Comment method "getModelElementDisplayName".
 *
 * @param meIndicator
 * @return
 */
public static final String getModelElementDisplayName(ModelElementIndicator meIndicator) {
    String meName = meIndicator.getElementName();
    // $NON-NLS-1$
    String typeName = "";
    if (meIndicator instanceof ColumnIndicator) {
        // MOD scorreia 2010-10-20 bug 16403 avoid NPE here
        TdSqlDataType sqlDataType = ((ColumnIndicator) meIndicator).getTdColumn().getSqlDataType();
        // $NON-NLS-1$
        typeName = sqlDataType != null ? sqlDataType.getName() : "unknown";
    } else if (meIndicator instanceof DelimitedFileIndicatorImpl) {
        MetadataColumn mColumn = ((DelimitedFileIndicatorImpl) meIndicator).getMetadataColumn();
        typeName = TalendTypeConvert.convertToJavaType(mColumn.getTalendType());
    }
    return meName != null ? meName + PluginConstant.SPACE_STRING + PluginConstant.PARENTHESIS_LEFT + typeName + PluginConstant.PARENTHESIS_RIGHT : // $NON-NLS-1$
    "null";
}
Also used : MetadataColumn(org.talend.core.model.metadata.builder.connection.MetadataColumn) ColumnIndicator(org.talend.dataprofiler.core.model.ColumnIndicator) DelimitedFileIndicatorImpl(org.talend.dataprofiler.core.model.impl.DelimitedFileIndicatorImpl) TdSqlDataType(org.talend.cwm.relational.TdSqlDataType)

Example 2 with DelimitedFileIndicatorImpl

use of org.talend.dataprofiler.core.model.impl.DelimitedFileIndicatorImpl in project tdq-studio-se by Talend.

the class AnalysisColumnSetTreeViewer method getModelElemetnDisplayName.

/**
 * DOC qiongli Comment method "getModelElemetnDisplayName".
 *
 * @param meIndicator
 * @return
 */
private String getModelElemetnDisplayName(ModelElementIndicator meIndicator) {
    if (meIndicator.getModelElementRepositoryNode() == null) {
        // $NON-NLS-1$
        return "null";
    }
    String meName = meIndicator.getElementName();
    // $NON-NLS-1$
    String typeName = "";
    if (meIndicator instanceof ColumnIndicator) {
        // MOD scorreia 2010-10-20 bug 16403 avoid NPE here
        TdSqlDataType sqlDataType = ((ColumnIndicator) meIndicator).getTdColumn().getSqlDataType();
        // $NON-NLS-1$
        typeName = sqlDataType != null ? sqlDataType.getName() : "unknown";
    } else if (meIndicator instanceof DelimitedFileIndicatorImpl) {
        MetadataColumn mColumn = ((DelimitedFileIndicatorImpl) meIndicator).getMetadataColumn();
        typeName = TalendTypeConvert.convertToJavaType(mColumn.getTalendType());
    }
    return meName != null ? meName + PluginConstant.SPACE_STRING + PluginConstant.PARENTHESIS_LEFT + typeName + PluginConstant.PARENTHESIS_RIGHT : // $NON-NLS-1$
    "null";
}
Also used : MetadataColumn(org.talend.core.model.metadata.builder.connection.MetadataColumn) ColumnIndicator(org.talend.dataprofiler.core.model.ColumnIndicator) DelimitedFileIndicatorImpl(org.talend.dataprofiler.core.model.impl.DelimitedFileIndicatorImpl) TdSqlDataType(org.talend.cwm.relational.TdSqlDataType)

Aggregations

MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)2 TdSqlDataType (org.talend.cwm.relational.TdSqlDataType)2 ColumnIndicator (org.talend.dataprofiler.core.model.ColumnIndicator)2 DelimitedFileIndicatorImpl (org.talend.dataprofiler.core.model.impl.DelimitedFileIndicatorImpl)2