@Override public CsmNamespace getParent() { CsmNamespace p = wrapped.getParent(); // it was global if (p == null) { return null; } return new SimpleNamespace(project, p); }
/** it's a list, not just collection because order matters */ private List<CsmNamespace> getContextNamespaces(CsmContext context) { CsmNamespace ns = CsmContextUtilities.getNamespace(context); List<CsmNamespace> out = new ArrayList<CsmNamespace>(); while (ns != null && !ns.isGlobal()) { out.add(ns); ns = ns.getParent(); } return out; }
private UpdatebleHost findHost(CsmProject project, CsmNamespace ns){ if (!project.isValid()){ return null; } Map<PersistentKey, UpdatebleHost> hosts = map.get(project); if (hosts == null){ return null; } CsmNamespace parent = ns.getParent(); if (parent != null){ return hosts.get(PersistentKey.createKey(parent)); } return null; }
break; ns = ns.getParent();
private CsmClassifier findClassifier(CsmNamespace ns, CharSequence qualifiedNamePart, AtomicBoolean outVisibility) { outVisibility.set(false); CsmClassifier result = null; CsmClassifier backupResult = null; while ( ns != null && result == null) { String fqn = ns.getQualifiedName() + "::" + qualifiedNamePart; // NOI18N CsmClassifier aCls = findClassifierUsedInFile(fqn, outVisibility); if (aCls != null) { if (!ForwardClass.isForwardClass(aCls) || needForwardClassesOnly()) { if (outVisibility.get()) { return aCls; } } if (backupResult == null) { backupResult = aCls; } } ns = ns.getParent(); } if (result == null) { result = backupResult; } return result; }
private CsmNamespace findNamespace(CsmNamespace ns, CharSequence qualifiedNamePart) { CsmNamespace result = null; if (ns == null) { result = findNamespace(qualifiedNamePart); } else { CsmNamespace containingNs = ns; while (containingNs != null && result == null) { String fqn = (containingNs.isGlobal() ? "" : (containingNs.getQualifiedName() + "::")) + qualifiedNamePart; // NOI18N result = findNamespace(fqn); if (result == null) { result = findNamespaceInInlined(containingNs, qualifiedNamePart); } containingNs = containingNs.getParent(); } } return result; }
res = ((ProjectBase) (getContainingFile().getProject())).findNamespace(sb, true); } while (res == null && ((currentNamespace = currentNamespace.getParent()) != null));