/** * @since 4.0 */ protected INamespace findNamespaceForId(INamespace containerNamespace, String libraryId) { if (libraryId == null) return containerNamespace; if (libraryId.equals(INamespace.APPLICATION_NAMESPACE)) return getApplicationNamespace(); if (libraryId.equals(INamespace.FRAMEWORK_NAMESPACE)) return getFrameworkNamespace(); return containerNamespace.getChildNamespace(libraryId); } }
/** * @since 4.0 */ protected INamespace findNamespaceForId(INamespace containerNamespace, String libraryId) { if (libraryId == null) return containerNamespace; if (libraryId.equals(INamespace.APPLICATION_NAMESPACE)) return getApplicationNamespace(); if (libraryId.equals(INamespace.FRAMEWORK_NAMESPACE)) return getFrameworkNamespace(); return containerNamespace.getChildNamespace(libraryId); } }
public INamespace getChildNamespace(String id) { String firstId = id; String nextIds = null; // Split the id into first and next if it is a dot separated sequence int index = id.indexOf('.'); if (index >= 0) { firstId = id.substring(0, index); nextIds = id.substring(index + 1); } // Get the first namespace INamespace result = (INamespace) _children.get(firstId); if (result == null) { result = createNamespace(firstId); _children.put(firstId, result); } // If the id is a dot separated sequence, recurse to find // the needed namespace if (result != null && nextIds != null) result = result.getChildNamespace(nextIds); return result; }
public INamespace getChildNamespace(String id) { String firstId = id; String nextIds = null; // Split the id into first and next if it is a dot separated sequence int index = id.indexOf('.'); if (index >= 0) { firstId = id.substring(0, index); nextIds = id.substring(index + 1); } // Get the first namespace INamespace result = (INamespace) _children.get(firstId); if (result == null) { result = createNamespace(firstId); _children.put(firstId, result); } // If the id is a dot separated sequence, recurse to find // the needed namespace if (result != null && nextIds != null) result = result.getChildNamespace(nextIds); return result; }
private void addPageNames(Set names, INamespace namespace) { String idPrefix = namespace.getExtendedId(); List pageNames = namespace.getPageNames(); int count = pageNames.size(); for (int i = 0; i < count; i++) { String name = (String) pageNames.get(i); if (idPrefix == null) names.add(name); else names.add(idPrefix + ":" + name); } List ids = namespace.getChildIds(); count = ids.size(); for (int i = 0; i < count; i++) { String id = (String) ids.get(i); addPageNames(names, namespace.getChildNamespace(id)); } }