Package com.xmlmind.util

## Interface XMLResolver

- All Superinterfaces:
    `EntityResolver`, `URIResolver`
  All Known Implementing Classes:
    `XMLResolverImpl`

      public interface XMLResolver
      extends EntityResolver, URIResolver

  Specifies the catalog-based entity resolution services needed by most XMLmind software components.

  Implementations are expected to be thread-safe.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addRewriteURIEntry​(String uriStartString, String rewritePrefix)` | Adds specified <rewriteURI> entry to the XML catalogs being used by this resolver.
    `String` | `getResolvedEntity​(String publicId, String systemId)` | Resolves specified the public identifier/system identifier of an entity.
    `default Source` | `resolve​(String href, String base)` |
    `default InputSource` | `resolveEntity​(String publicId, String systemId)` |
    `String` | `resolveURI​(String uri)` | Resolves specified URI.
    `default URL` | `resolveURI​(String uri, URL baseURL)` | Resolves specified URI.

- - ### 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

    - #### resolveEntity

          default InputSource resolveEntity​(String publicId,
                                            String systemId)

      Specified by:
        `resolveEntity` in interface `EntityResolver`

    - #### resolve

          default Source resolve​(String href,
                                 String base)
                          throws TransformerException

      Specified by:
        `resolve` in interface `URIResolver`
      Throws:
        `TransformerException`