use of org.talend.dataquality.properties.impl.TDQAnalysisItemImpl in project tdq-studio-se by Talend.
the class DependenciesHandler method getAnaDependency.
/**
* get Analysis Dependency (for indicator only).
*
* @return get the list of indicator which in use by the analysis
*/
public List<Property> getAnaDependency(Property property) {
Item item = property.getItem();
List<Property> listProperty = new ArrayList<Property>();
if (item instanceof TDQAnalysisItemImpl) {
TDQAnalysisItemImpl tdqAnaItem = (TDQAnalysisItemImpl) item;
Analysis anaElement = tdqAnaItem.getAnalysis();
List<Indicator> indicators = IndicatorHelper.getIndicators(anaElement.getResults());
for (Indicator indicator : indicators) {
boolean isContain = false;
IndicatorDefinition newIndicatorDefinition = indicator.getIndicatorDefinition();
// MOD qiongli 2012-5-11 TDQ-5256
if (newIndicatorDefinition == null) {
continue;
}
for (Property containViewObject : listProperty) {
Item item2 = containViewObject.getItem();
if (item2 instanceof TDQIndicatorDefinitionItemImpl) {
IndicatorDefinition oldIndicatorDefinition = ((TDQIndicatorDefinitionItemImpl) item2).getIndicatorDefinition();
if (ModelElementHelper.compareUUID(oldIndicatorDefinition, newIndicatorDefinition)) {
isContain = true;
break;
}
}
}
if (!isContain) {
Property iniProperty = PropertyHelper.getProperty(indicator.getIndicatorDefinition());
if (iniProperty != null) {
listProperty.add(iniProperty);
}
}
}
}
return listProperty;
}
Aggregations