use of com.ibm.wsdl.ImportImpl in project tdi-studio-se by Talend.
the class ServiceDiscoveryHelper method findWsdlImport.
private List<Definition> findWsdlImport(Definition definition, List<Definition> definitions, List<String> locationURIs, List<String> importNSs) {
if (definitions == null) {
definitions = new ArrayList<Definition>();
definitions.add(definition);
}
if (locationURIs == null) {
locationURIs = new ArrayList<String>();
}
if (importNSs == null) {
importNSs = new ArrayList<String>();
}
if (definition.getImports() != null && !definition.getImports().isEmpty()) {
Map imports = definition.getImports();
for (Object key : imports.keySet()) {
Vector importsImpl = (Vector) imports.get(key);
for (int i = 0; i < importsImpl.size(); i++) {
ImportImpl importImpl = (ImportImpl) importsImpl.get(i);
if (!locationURIs.contains(importImpl.getLocationURI()) || !importNSs.contains(importImpl.getNamespaceURI())) {
locationURIs.add(importImpl.getLocationURI());
importNSs.add(importImpl.getNamespaceURI());
String importWsdlFileName = "importWsdl" + definitions.size() + ".wsdl";
importImpl.setLocationURI(importWsdlFileName);
Definition importDef = importImpl.getDefinition();
if (importDef != null) {
definitions.add(importDef);
findWsdlImport(importDef, definitions, locationURIs, importNSs);
}
}
}
}
}
return definitions;
}
Aggregations