/** * Adds a new Entry to the catalog */ private void addEntry(String type, Vector args) { try { CatalogEntry entry = new CatalogEntry(type, args); catalog.addEntry(entry); } catch (CatalogException e) { throw new RuntimeException(e); } }
/** * Find the URNs for a given system identifier in the current catalog. * * @param systemId The system ID to locate. * * @return A vector of URNs that map to the systemId. */ private Vector resolveLocalSystemReverse(String systemId) { Vector map = new Vector(); String osname = System.getProperty("os.name"); boolean windows = (osname.indexOf("Windows") >= 0); Enumeration en = catalogEntries.elements(); while (en.hasMoreElements()) { CatalogEntry e = (CatalogEntry) en.nextElement(); if (e.getEntryType() == SYSTEM && (e.getEntryArg(1).equals(systemId) || (windows && e.getEntryArg(1).equalsIgnoreCase(systemId)))) { map.addElement(e.getEntryArg(0)); } } if (map.size() == 0) { return null; } else { return map; } }
/** * Find out how many arguments an entry is required to have. * * @param name The name of the catalog entry type. * @return The number of arguments that entry type is required to have. * @throws InvalidCatalogEntryTypeException if no entry has the * specified name. */ public static int getEntryArgCount(String name) throws CatalogException { return getEntryArgCount(getEntryType(name)); }
/** * Cleanup and process a Catalog entry. * * <p>This method processes each Catalog entry, changing mapped * relative system identifiers into absolute ones (based on the current * base URI), and maintaining other information about the current * catalog.</p> * * @param entry The CatalogEntry to process. */ public void addEntry(CatalogEntry entry) { int type = entry.getEntryType(); if (type == URISUFFIX) { String suffix = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, fsi); catalogManager.debug.message(4, "URISUFFIX", suffix, fsi); } else if (type == SYSTEMSUFFIX) { String suffix = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, fsi); catalogManager.debug.message(4, "SYSTEMSUFFIX", suffix, fsi); } super.addEntry(entry); }
int type = CatalogEntry.getEntryType(entryToken); int numArgs = CatalogEntry.getEntryArgCount(type); Vector args = new Vector(); catalog.addEntry(new CatalogEntry(entryToken, args)); } catch (CatalogException cex) { if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
String publicid = PublicId.normalize(entry.getEntryArg(0)); String systemid = makeAbsolute(normalizeURI(entry.getEntryArg(1))); String systemid = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, fsi); String uri = normalizeURI(entry.getEntryArg(0)); String altURI = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, altURI); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(0))); entry.setEntryArg(0, fsi); catalogManager.debug.message(4, "OVERRIDE", entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(0))); entry.setEntryArg(0, fsi); String ppi = PublicId.normalize(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(0, ppi); entry.setEntryArg(1, fsi); String psi = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1)));
while (local.hasMoreElements()) { CatalogEntry dpe = (CatalogEntry) local.nextElement(); String dp = dpe.getEntryArg(0); if (dp.equals(partial)) {
if (e.getEntryType() == DELEGATE_PUBLIC || e.getEntryType() == DELEGATE_SYSTEM || e.getEntryType() == DELEGATE_URI) { Catalog dcat = newCatalog(); dcat.parseCatalog(e.getEntryArg(1));
int type = CatalogEntry.getEntryType(entryToken); int numArgs = CatalogEntry.getEntryArgCount(type); Vector args = new Vector(); catalog.addEntry(new CatalogEntry(entryToken, args)); } catch (CatalogException cex) { if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
/** * Cleanup and process a Catalog entry. * * <p>This method processes each Catalog entry, changing mapped * relative system identifiers into absolute ones (based on the current * base URI), and maintaining other information about the current * catalog.</p> * * @param entry The CatalogEntry to process. */ public void addEntry(CatalogEntry entry) { int type = entry.getEntryType(); if (type == URISUFFIX) { String suffix = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, fsi); catalogManager.debug.message(4, "URISUFFIX", suffix, fsi); } else if (type == SYSTEMSUFFIX) { String suffix = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, fsi); catalogManager.debug.message(4, "SYSTEMSUFFIX", suffix, fsi); } super.addEntry(entry); }
String partial = entry.getEntryArg(0); String dp = dpe.getEntryArg(0); if (dp.equals(partial)) {
while (en.hasMoreElements()) { CatalogEntry e = (CatalogEntry) en.nextElement(); if (e.getEntryType() == SYSTEM && (e.getEntryArg(0).equals(systemId) || (windows && e.getEntryArg(0).equalsIgnoreCase(systemId)))) { map.addElement(e.getEntryArg(1));
int type = CatalogEntry.getEntryType(entryToken); int numArgs = CatalogEntry.getEntryArgCount(type); Vector args = new Vector(); catalog.addEntry(new CatalogEntry(entryToken, args)); } catch (CatalogException cex) { if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
/** * Cleanup and process a Catalog entry. * * <p>This method processes each Catalog entry, changing mapped * relative system identifiers into absolute ones (based on the current * base URI), and maintaining other information about the current * catalog.</p> * * @param entry The CatalogEntry to process. */ public void addEntry(CatalogEntry entry) { int type = entry.getEntryType(); if (type == URISUFFIX) { String suffix = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, fsi); catalogManager.debug.message(4, "URISUFFIX", suffix, fsi); } else if (type == SYSTEMSUFFIX) { String suffix = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, fsi); catalogManager.debug.message(4, "SYSTEMSUFFIX", suffix, fsi); } super.addEntry(entry); }
CatalogEntry ce = new CatalogEntry(entryType, entryArgs); catalog.addEntry(ce); } catch (CatalogException cex) {
/** * Find out how many arguments an entry is required to have. * * @param name The name of the catalog entry type. * @return The number of arguments that entry type is required to have. * @throws InvalidCatalogEntryTypeException if no entry has the * specified name. */ public static int getEntryArgCount(String name) throws CatalogException { return getEntryArgCount(getEntryType(name)); }
String partial = entry.getEntryArg(0); String dp = dpe.getEntryArg(0); if (dp.equals(partial)) {
/** * Find the URNs for a given system identifier in the current catalog. * * @param systemId The system ID to locate. * * @return A vector of URNs that map to the systemId. */ private Vector resolveLocalSystemReverse(String systemId) { Vector map = new Vector(); String osname = System.getProperty("os.name"); boolean windows = (osname.indexOf("Windows") >= 0); Enumeration en = catalogEntries.elements(); while (en.hasMoreElements()) { CatalogEntry e = (CatalogEntry) en.nextElement(); if (e.getEntryType() == SYSTEM && (e.getEntryArg(1).equals(systemId) || (windows && e.getEntryArg(1).equalsIgnoreCase(systemId)))) { map.addElement(e.getEntryArg(0)); } } if (map.size() == 0) { return null; } else { return map; } }
int type = CatalogEntry.getEntryType(entryToken); int numArgs = CatalogEntry.getEntryArgCount(type); Vector args = new Vector(); catalog.addEntry(new CatalogEntry(entryToken, args)); } catch (CatalogException cex) { if (cex.getExceptionType() == CatalogException.INVALID_ENTRY_TYPE) {
int type = entry.getEntryType(); String value = entry.getEntryArg(0); URL newbase = null; String fsi = makeAbsolute(entry.getEntryArg(0)); String publicid = PublicId.normalize(entry.getEntryArg(0)); String systemid = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(0, publicid); entry.setEntryArg(1, systemid); String systemid = normalizeURI(entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, fsi); String uri = normalizeURI(entry.getEntryArg(0)); String altURI = makeAbsolute(normalizeURI(entry.getEntryArg(1))); entry.setEntryArg(1, altURI); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(0))); entry.setEntryArg(0, fsi); catalogManager.debug.message(4, "OVERRIDE", entry.getEntryArg(0)); String fsi = makeAbsolute(normalizeURI(entry.getEntryArg(0)));