Search in sources :

Example 1 with IndicatorsDefinitions

use of org.talend.dataquality.indicators.definition.IndicatorsDefinitions in project tdq-studio-se by Talend.

the class DefinitionHandler method loadDefinitionsFromFile.

/**
 * DOC mzhao feature 13676 split system indicators.
 *
 * @return
 */
public IndicatorsDefinitions loadDefinitionsFromFile() {
    Resource definitionsFile = getDefCategoryResourceFromFile();
    EList<EObject> contents = definitionsFile.getContents();
    if (contents == null || contents.isEmpty()) {
        // $NON-NLS-1$
        log.error(Messages.getString("DefinitionHandler.NoContentFound", definitionsFile.getURI()));
        return null;
    }
    DefinitionSwitch<IndicatorsDefinitions> catSwitch = new DefinitionSwitch<IndicatorsDefinitions>() {

        @Override
        public IndicatorsDefinitions caseIndicatorsDefinitions(IndicatorsDefinitions object) {
            return object;
        }
    };
    return catSwitch.doSwitch(contents.get(0));
}
Also used : DefinitionSwitch(org.talend.dataquality.indicators.definition.util.DefinitionSwitch) EObject(org.eclipse.emf.ecore.EObject) CwmResource(org.talend.model.emf.CwmResource) Resource(org.eclipse.emf.ecore.resource.Resource) IndicatorsDefinitions(org.talend.dataquality.indicators.definition.IndicatorsDefinitions)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 IndicatorsDefinitions (org.talend.dataquality.indicators.definition.IndicatorsDefinitions)1 DefinitionSwitch (org.talend.dataquality.indicators.definition.util.DefinitionSwitch)1 CwmResource (org.talend.model.emf.CwmResource)1