use of org.talend.dataprofiler.core.model.ColumnIndicator 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";
}
use of org.talend.dataprofiler.core.model.ColumnIndicator in project tdq-studio-se by Talend.
the class ColumnIndicatorUnit method getForms.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit#getForms()
*/
@Override
public FormEnum[] getForms() {
int sqlType = null != modelElementIndicator ? modelElementIndicator.getJavaType() : 0;
ColumnIndicator columnIndicator = ModelElementIndicatorHelper.switchColumnIndicator(this);
DataminingType dataminingType = columnIndicator == null ? null : MetadataHelper.getDataminingType(columnIndicator.getTdColumn());
if (dataminingType == null) {
dataminingType = null != modelElementIndicator ? MetadataHelper.getDefaultDataminingType(modelElementIndicator.getJavaType()) : DataminingType.NOMINAL;
}
return FormEnum.getFormEnumArray(this.getIndicator().getIndicatorDefinition(), sqlType, dataminingType, type, getExecutionLanguage());
}
use of org.talend.dataprofiler.core.model.ColumnIndicator in project tdq-studio-se by Talend.
the class PatternLabelProvider method getPatternFileByIndicator.
/**
* @param clmIndicator
* @return
* @deprecated since repository nodes are used instead of IFiles
*/
@Deprecated
public static IFile[] getPatternFileByIndicator(ColumnIndicator clmIndicator) {
Indicator[] patternIndicators = clmIndicator.getPatternIndicators();
List<IFile> existedPatternFiles = new ArrayList<IFile>();
if (patternIndicators.length != 0) {
for (Indicator patternIndicator : patternIndicators) {
PatternMatchingIndicator ptnIndicaotr = (PatternMatchingIndicator) patternIndicator;
List<Pattern> patterns = ptnIndicaotr.getParameters().getDataValidDomain().getPatterns();
for (Pattern pattern : patterns) {
for (IFile file : getAllPatternFiles()) {
Pattern fpattern = PatternResourceFileHelper.getInstance().findPattern(file);
if (pattern.getName().equals(fpattern.getName())) {
existedPatternFiles.add(file);
}
}
}
}
}
return existedPatternFiles.toArray(new IFile[existedPatternFiles.size()]);
}
Aggregations