# Class CatalogManager

java.lang.Object
javax.xml.catalog.CatalogManager

public final class CatalogManager extends Object
The Catalog Manager manages the creation of XML Catalogs and Catalog Resolvers.

Since:
  9

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Catalog`
  `catalog(CatalogFeatures features, URI... uris)`
  Creates a `Catalog` object using the specified feature settings and uri(s) to one or more catalog files.
  `static CatalogResolver`
  `catalogResolver(Catalog catalog)`
  Creates an instance of a `CatalogResolver` using the specified catalog.
  `static CatalogResolver`
  `catalogResolver(CatalogFeatures features, URI... uris)`
  Creates an instance of a `CatalogResolver` using the specified feature settings and uri(s) to one or more catalog files.
  `static CatalogResolver`
  `catalogResolver(Catalog catalog, CatalogResolver.NotFoundAction action)`
  Creates a `CatalogResolver` that resolves external references with the given `catalog` and `action` type that determines the behavior when unable to resolve a reference.

  ### Methods declared in class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  Creates and returns a copy of this object.
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `protected void`
  `finalize()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Finalization is deprecated and subject to removal in a future release.
  `final Class<?>`
  `getClass()`
  Returns the runtime class of this `Object`.
  `int`
  `hashCode()`
  Returns a hash code value for this object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
  `final void`
  `wait(long timeoutMillis)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
  `final void`
  `wait(long timeoutMillis, int nanos)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

- ## Method Details

  - ### catalog

    public static Catalog catalog(CatalogFeatures features, URI... uris)
    Creates a `Catalog` object using the specified feature settings and uri(s) to one or more catalog files.

    If `uris` is empty, system property `javax.xml.catalog.files`, as defined in `CatalogFeatures`, will be read to locate the initial list of catalog files.

    If multiple catalog files are specified through the `uris` argument or `javax.xml.catalog.files` property, the first entry is considered the main catalog, while others are treated as alternative catalogs after those referenced by the `nextCatalog` elements in the main catalog.

    As specified in XML Catalogs, OASIS Standard V1.1, if a catalog entry is invalid, it is ignored. In case all entries are invalid, the resulting Catalog object will contain no Catalog elements. Any matching operation using the Catalog will return null.

    Parameters:
      `features` - the catalog features
      `uris` - uri(s) to one or more catalogs.
    Returns:
      an instance of a `Catalog`
    Throws:
      `IllegalArgumentException` - if either the URIs are not absolute or do not have a URL protocol handler for the URI scheme
      `CatalogException` - If an error occurs while parsing the catalog

  - ### catalogResolver

    public static CatalogResolver catalogResolver(Catalog catalog)
    Creates an instance of a `CatalogResolver` using the specified catalog.
    API Note:
      The `CatalogResolver` created by this method delegates to the underlying `catalog`'s RESOLVE property. The `CatalogResolver` created by `catalogResover(Catalog, CatalogResolver.NotFoundAction)` is based on the specified action type when it is unable to resolve a reference.
    Parameters:
      `catalog` - the catalog instance
    Returns:
      an instance of a `CatalogResolver`

  - ### catalogResolver

    public static CatalogResolver catalogResolver(Catalog catalog, CatalogResolver.NotFoundAction action)
    Creates a `CatalogResolver` that resolves external references with the given `catalog` and `action` type that determines the behavior when unable to resolve a reference.

    The `action` types are mapped to the values of the `RESOLVE` property.

    Parameters:
      `catalog` - the catalog instance
      `action` - the action to be taken when unable to resolve a reference
    Returns:
      a `CatalogResolver` with the `catalog` and `action` type
    Since:
      22

  - ### catalogResolver

    public static CatalogResolver catalogResolver(CatalogFeatures features, URI... uris)
    Creates an instance of a `CatalogResolver` using the specified feature settings and uri(s) to one or more catalog files.

    If `uris` is empty, system property `javax.xml.catalog.files`, as defined in `CatalogFeatures`, will be read to locate the initial list of catalog files.

    If multiple catalog files are specified through the `uris` argument or `javax.xml.catalog.files` property, the first entry is considered the main catalog, while others are treated as alternative catalogs after those referenced by the `nextCatalog` elements in the main catalog.

    As specified in XML Catalogs, OASIS Standard V1.1, if a catalog entry is invalid, it is ignored. In case all entries are invalid, the resulting CatalogResolver object will contain no valid catalog. Any resolution operation using the resolver therefore will return as no mapping is found. See `CatalogResolver` for the behavior when no mapping is found.

    Parameters:
      `features` - the catalog features
      `uris` - the uri(s) to one or more catalogs
    Returns:
      an instance of a `CatalogResolver`
    Throws:
      `IllegalArgumentException` - if either the URIs are not absolute or do not have a URL protocol handler for the URI scheme
      `CatalogException` - If an error occurs while parsing the catalog