Interface XMLResolver

    • Method Detail

      • addRewriteURIEntry

        void addRewriteURIEntry​(String uriStartString,
                                String rewritePrefix)
        Adds specified <rewriteURI> entry to the XML catalogs being used by this resolver.
        Parameters:
        uriStartString - prefix of an URI
        rewritePrefix - new prefix for URIs starting with uriStartString. Must be the start of an absolute URL in order to be able to use this entry to resolve URIs.
      • getResolvedEntity

        String getResolvedEntity​(String publicId,
                                 String systemId)
        Resolves specified the public identifier/system identifier of an entity. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise returns null.
        Parameters:
        publicId - the public identifier of the entity. May be null.
        systemId - the system identifier of the entity. Not null.
        Returns:
        found mapping (a URI reference) or null
      • resolveURI

        String resolveURI​(String uri)
        Resolves specified URI. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise returns null.
        Parameters:
        uri - URI for which a mapping is to be found. This URI may have a fragment.
        Returns:
        found mapping (a URI reference) or null
      • resolveURI

        default URL resolveURI​(String uri,
                               URL baseURL)
                        throws MalformedURLException
        Resolves specified URI. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise specified URI is parsed as an URL (if relative, it is resolved against specified base) and this URL is returned.
        Parameters:
        uri - URI for which a mapping is to be found. This URI may have a fragment.
        baseURL - base URL used if uri needs to be parsed as an URL. May be null.
        Returns:
        resolved URL
        Throws:
        MalformedURLException - if specified URI needs to be parsed as an URL but is malformed