Package com.xmlmind.domutil

## Class XMLResolverImpl

- java.lang.Object
- - com.xmlmind.domutil.XMLResolverImpl

- All Implemented Interfaces:
    `XMLResolver`, `URIResolver`, `EntityResolver`

      public final class XMLResolverImpl
      extends Object
      implements XMLResolver

  An implementation of `XMLResolver` based on XMLResolver: An enhanced XML resolver with XML Catalog support.

  This class is thread-safe.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `XMLResolverImpl()` | Equivalent to `XMLResolverImpl(null)`.
    `XMLResolverImpl​(URL[] urls)` | Constructs an `XMLResolverImpl`.

  - ### Method Summary

    All Methods Instance Methods Concrete 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.
    `String` | `resolveURI​(String uri)` | Resolves specified URI.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.xmlmind.util.XMLResolver

      `resolve, resolveEntity, resolveURI`

- - ### Constructor Detail

    - #### XMLResolverImpl

          public XMLResolverImpl()

      Equivalent to `XMLResolverImpl(null)`.

      Useful when the list of XML catalog files is specified by the value of system property `xml.catalog.files`.

    - #### XMLResolverImpl

          public XMLResolverImpl​(URL[] urls)

      Constructs an `XMLResolverImpl`.
      Parameters:
        `urls` - the URLs of the XML catalog files to be used by this XML resolver. If `null`, this list is specified by the value of system property `xml.catalog.files`, if any.

  - ### Method Detail

    - #### addRewriteURIEntry

          public void addRewriteURIEntry​(String uriStartString,
                                         String rewritePrefix)

      Description copied from interface: `XMLResolver`
      Adds specified <rewriteURI> entry to the XML catalogs being used by this resolver.
      Specified by:
        `addRewriteURIEntry` in interface `XMLResolver`
      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

          public String getResolvedEntity​(String publicId,
                                          String systemId)

      Description copied from interface: `XMLResolver`
      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`.
      Specified by:
        `getResolvedEntity` in interface `XMLResolver`
      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

          public String resolveURI​(String uri)

      Description copied from interface: `XMLResolver`
      Resolves specified URI. If a mapping is found in the XML catalogs, this mapping is returned. Otherwise returns `null`.
      Specified by:
        `resolveURI` in interface `XMLResolver`
      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`