use of com.amalto.workbench.dialogs.datamodel.IXPathSelectionFilter.FilterResult in project tmdm-studio-se by Talend.
the class XSDUtil method iterateParticle.
private static void iterateParticle(XSDParticle particle, IXPathSelectionFilter filter, Set<String> paths, String prefix) {
XSDTerm term = particle.getTerm();
if (term instanceof XSDModelGroup) {
EList<XSDParticle> contents = ((XSDModelGroup) term).getContents();
for (XSDParticle p : contents) {
XSDTerm t = p.getTerm();
if (t instanceof XSDElementDeclaration) {
XSDElementDeclaration element = ((XSDElementDeclaration) t);
FilterResult r = filter.check(p);
if (r == FilterResult.ENABLE) {
String path = prefix + element.getName();
paths.add(path);
} else {
XSDTypeDefinition type = element.getType();
if (type instanceof XSDComplexTypeDefinition) {
String nextPrefix = prefix + element.getName() + DIVIDE;
XSDParticle cp = type.getComplexType();
iterateParticle(cp, filter, paths, nextPrefix);
}
}
}
}
}
}
Aggregations