@Override public void getAllImportNodes(Collection<IImportNode> importNodes) { // Collect the import nodes that are descendants of this node // but which are not within other scoped nodes. collectImportNodes(importNodes); // Recurse up the chain of scoped nodes to collect import nodes // from higher scopes. IScopedNode parent = (IScopedNode)getAncestorOfType(IScopedNode.class); // if parent is package node, don't fetch imports from the file node // as file scope imports are not applicable in this scope if (parent != null ) { if( !(getParent() instanceof PackageNode) ) parent.getAllImportNodes(importNodes); // If we're a package, then just grab the implicit imports from the FileNode else if (parent instanceof FileNode ) ((FileNode)parent).collectImplicitImportNodes(importNodes); } }
@Override public void getAllImportNodes(Collection<IImportNode> importNodes) { // Collect the import nodes that are descendants of this node // but which are not within other scoped nodes. collectImportNodes(importNodes); // Recurse up the chain of scoped nodes to collect import nodes // from higher scopes. IScopedNode parent = (IScopedNode)getAncestorOfType(IScopedNode.class); // if parent is package node, don't fetch imports from the file node // as file scope imports are not applicable in this scope if (parent != null ) { if( !(getParent() instanceof PackageNode) ) parent.getAllImportNodes(importNodes); // If we're a package, then just grab the implicit imports from the FileNode else if (parent instanceof FileNode ) ((FileNode)parent).collectImplicitImportNodes(importNodes); } }