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 Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.net.URI lookupDoctype​(java.lang.String entityName, java.lang.String systemId, java.lang.String publicId)
      Lookup a document type.
      java.net.URI lookupDocument()
      Lookup a default document.
      java.net.URI lookupEntity​(java.lang.String entityName, java.lang.String systemId, java.lang.String publicId)
      Lookup an entity.
      java.net.URI lookupNotation​(java.lang.String notationName, java.lang.String systemId, java.lang.String publicId)
      Lookup a notation.
      java.net.URI lookupPublic​(java.lang.String systemId, java.lang.String publicId)
      Lookup an external identifier by public and system identifier.
      java.net.URI lookupSystem​(java.lang.String systemId)
      Lookup an external identifier by system identifier.
      java.net.URI lookupURI​(java.lang.String uri)
      Lookup a URI.
    • Method Detail

      • lookupURI

        java.net.URI lookupURI​(java.lang.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

        java.net.URI lookupPublic​(java.lang.String systemId,
                                  java.lang.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

        java.net.URI lookupSystem​(java.lang.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

        java.net.URI lookupDoctype​(java.lang.String entityName,
                                   java.lang.String systemId,
                                   java.lang.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

        java.net.URI lookupEntity​(java.lang.String entityName,
                                  java.lang.String systemId,
                                  java.lang.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

        java.net.URI lookupNotation​(java.lang.String notationName,
                                    java.lang.String systemId,
                                    java.lang.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

        java.net.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.