Interface XMLCatalogResolver

All Known Implementing Classes:
CatalogManager, ResourceCache

public interface XMLCatalogResolver
The Catalog resolver interface.

The XMLCatalogResolver interface exposes the catalog-based lookup functionality of the OASIS Open XML Catalogs 1.1 specification. It supports all of the normative catalog entries and several of the TR9401 entries described in Appendix D.

The API doesn't expose methods to access catalog, group, or nextCatalog entries because they are internal to the resolution process. A conformant catalog processor must support them.

The dtddecl, sgmldecl, and linktype entries are not supported because they have no useful purpose in XML.

  • Method Details

    • lookupURI

      URI lookupURI(String uri)
      Lookup a URI.

      This method searches uri, rewriteURI, uriSuffix, and delegateURI catalog entries.

      Parameters:
      uri - The request URI
      Returns:
      The mapped URI, or null if no mapping was found.
    • lookupPublic

      URI lookupPublic(String systemId, String publicId)
      Lookup an external identifier by public and system identifier.

      This method searches public, delegatePublic, system, delegateSystem, rewriteSystem, and systemSuffix catalog entries.

      If both public and system mappings exist, the match depends on the setting of the "prefer public" option.

      Note that public identifiers can be encoded as URNs per RFC 3151. A call to:

      lookupPublic("urn:publicid:-:OASIS:DTD+DocBook+XML+V4.1.2:EN", null)

      Is precisely the same as a call to

      lookupPublic(null, "-//OASIS//DTD DocBook XML V4.1.2//EN")

      If both the public and system identifiers are null, null is returned.

      Parameters:
      systemId - The system identifier, possibly null.
      publicId - The public identifier, possibly null.
      Returns:
      The mapped URI, or null if no mapping was found.
    • lookupSystem

      URI lookupSystem(String systemId)
      Lookup an external identifier by system identifier.

      This method searches system, delegateSystem, rewriteSystem, and systemSuffix catalog entries.

      Parameters:
      systemId - The system identifier.
      Returns:
      The mapped URI, or null if no mapping was found.
    • lookupDoctype

      URI lookupDoctype(String entityName, String systemId, String publicId)
      Lookup a document type.

      This method searches for a document type. A document type, for example:

      <!DOCTYPE book SYSTEM "urn:publicid:-:OASIS:DTD+DocBook+XML+V4.1.2:EN">

      Consists of an entity name ("book") and optional system and public identifiers. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.

      If no external identifier is provided, the entityName will be matched against doctype catalog entries.

      Parameters:
      entityName - The entity name.
      systemId - The system identifier, possibly null.
      publicId - The public identifier, possibly null.
      Returns:
      The mapped URI, or null if no mapping was found.
    • lookupEntity

      URI lookupEntity(String entityName, String systemId, String publicId)
      Lookup an entity.

      This method searches for an entity. An entity:

      <!ENTITY chapter1 SYSTEM "chap1.xml">

      consists of an entity name ("chapter1") and an external identifier. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.

      If no external identifier is provided, the entityName will be matched against entity catalog entries.

      Parameters:
      entityName - The entity name.
      systemId - The system identifier, possibly null.
      publicId - The public identifier, possibly null.
      Returns:
      The mapped URI, or null if no mapping was found.
    • lookupNotation

      URI lookupNotation(String notationName, String systemId, String publicId)
      Lookup a notation.

      This method searches for a notation. A notation:

      <!NOTATION thing SYSTEM "thing.bin">

      consists of a notation name ("thing") and optional system and public identifiers. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.

      If no external identifier is provided, the notationName will be matched against notation catalog entries.

      Parameters:
      notationName - The notation name.
      systemId - The system identifier, possibly null.
      publicId - The public identifier, possibly null.
      Returns:
      The mapped URI, or null if no mapping was found.
    • lookupDocument

      URI lookupDocument()
      Lookup a default document.
      Returns:
      The URI of the default document, or null if no mapping was found.

      This method returns (the first) matching document entry.