}
if (found)
break;
}
}
IModelElement elements[] = null;
namespaceStack.push(fileNameWithoutExtension);
try {
elements = sourceModule.getChildren();
for (int i = 0; i < elements.length; i++) {
IModelElement modelElement = elements[i];
int elementType = modelElement.getElementType();
if (elementType == type) {
if (elementType == IModelElement.METHOD) {
imports.add(namespaceStack.peek() + "." + modelElement.getElementName());
} else if (appendPath) {
imports.add(path + "." + modelElement.getElementName());
} else {
imports.add(modelElement.getElementName());
}
}
if (elementType == IModelElement.METHOD) {
String nSpace = namespaceStack.empty() ? modelElement.getElementName() : namespaceStack
.peek() + "." + modelElement.getElementName();
namespaceStack.push(nSpace);
imports.addAll(collectElements((IMethod) modelElement, type, namespaceStack));
namespaceStack.pop();
}
}