protected Object[] getChildrenHelper(ICatalog catalog) { // TODO add entries from the nested catalogs ICatalogEntry[] entries = catalog.getCatalogEntries(); if (entries.length > 0) { Comparator comparator = new Comparator() { public int compare(Object o1, Object o2) { int result = 0; if ((o1 instanceof ICatalogEntry) && (o2 instanceof ICatalogEntry)) { ICatalogEntry entry1 = (ICatalogEntry) o1; ICatalogEntry entry2 = (ICatalogEntry) o2; result = Collator.getInstance().compare(entry1.getKey(), entry2.getKey()); } return result; } }; Arrays.sort(entries, comparator); } Vector result = new Vector(); result.addAll(Arrays.asList(entries)); INextCatalog[] nextCatalogs = catalog.getNextCatalogs(); List nextCatalogsList = Arrays.asList(nextCatalogs); result.addAll(nextCatalogsList); return result.toArray(new ICatalogElement[result.size()]); }
/** * Helper method to find the physical location of the schema * in the XML Catalog * @param namespaceURI * @return physical location of the schema */ public String locateFileUsingCatalog(String namespaceURI) { retrieveCatalog(); ICatalogEntry[] entries = systemCatalog.getCatalogEntries(); for (int i = 0; i < entries.length; i++) { if (entries[i].getKey().equals(namespaceURI)) return entries[i].getURI(); } return null; }
if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) { ICatalog systemCatalog = referencedCatalog; addXMLCatalogEntries(result, systemCatalog.getCatalogEntries()); addXMLCatalogEntries(result, userCatalog.getCatalogEntries());
/** * Returns the String location for the schema with the given namespaceURI by * looking at the XML catalog. We look only in the plugin specified entries of * the catalog. * * @param namespaceURI * @return String representing the location of the schema. */ private String locateFileUsingCatalog(String namespaceURI) { retrieveCatalog(); ICatalogEntry[] entries = systemCatalog.getCatalogEntries(); for (int i = 0; i < entries.length; i++) { if (entries[i].getKey().equals(namespaceURI)) return entries[i].getURI(); } return null; }
protected void addCatalogMapToList(ICatalog catalog, List list) { ICatalogEntry[] entries = catalog.getCatalogEntries(); for (int i = 0; i < entries.length; i++) { ICatalogEntry entry = entries[i]; if ((entry.getEntryType() == ICatalogEntry.ENTRY_TYPE_PUBLIC) && entry.getURI().endsWith(".xsd")) { //$NON-NLS-1$ if (!isAlreadyDeclared(entry.getKey())) { NamespaceInfo namespaceInfo = new NamespaceInfo(entry.getKey(), "xx", null); //$NON-NLS-1$ list.add(namespaceInfo); } } } }
private void processCatalogEntries(ICatalog catalog, Element parent) ICatalogEntry[] catalogEntries = catalog.getCatalogEntries();
if (defaultCatalog != null) { ICatalogEntry[] entries = defaultCatalog.getCatalogEntries(); for (int entry = 0; entry < entries.length; entry++) { ITaglibRecord record = createCatalogRecord(entries[entry]); for (int nextCatalog = 0; nextCatalog < nextCatalogs.length; nextCatalog++) { ICatalog catalog = nextCatalogs[nextCatalog].getReferencedCatalog(); ICatalogEntry[] entries2 = catalog.getCatalogEntries(); for (int entry = 0; entry < entries2.length; entry++) { String uri = entries2[entry].getURI();