use of org.talend.dataquality.domain.pattern.util.PatternSwitch in project tdq-studio-se by Talend.
the class UpdateSomePatternToMatchMysql method retirePattern.
/**
* DOC rli Comment method "retireAnalysis".
*
* @param fileResource
* @return
*/
private Pattern retirePattern(Resource fileResource) {
EList<EObject> contents = fileResource.getContents();
if (contents.isEmpty()) {
// $NON-NLS-1$
log.error(DefaultMessagesImpl.getString("UpdateSomePatternToMatchMysql_logErr", fileResource));
}
if (log.isDebugEnabled()) {
// $NON-NLS-1$
log.debug("No elements in contents " + contents.size());
}
PatternSwitch<Pattern> mySwitch = new PatternSwitch<Pattern>() {
@Override
public Pattern casePattern(Pattern object) {
return object;
}
};
Pattern pattern = null;
if (contents != null && contents.size() != 0) {
pattern = mySwitch.doSwitch(contents.get(0));
}
return pattern;
}
Aggregations