APIdia Launch Partner
Top Description Constructors Methods
javax.xml.catalog

public final Class CatalogManager

extends Object
Class Inheritance
Imports
java.net.URI

The Catalog Manager manages the creation of XML Catalogs and Catalog Resolvers.
Since
9

Constructor Summary

AccessConstructor and Description
private
CatalogManager()

Creating CatalogManager instance is not allowed.

Method Summary

Modifier and TypeMethod and Description
public static Catalog

Returns:

an instance of a Catalog
catalog
(CatalogFeatures
the catalog features
features
,
URI...
uri(s) to one or more catalogs.
uris
)

Creates a Catalog object using the specified feature settings and uri(s) to one or more catalog files.

public static CatalogResolver

Returns:

an instance of a CatalogResolver
catalogResolver
(Catalog
the catalog instance
catalog
)

Creates an instance of a CatalogResolver using the specified catalog.

public static CatalogResolver

Returns:

a CatalogResolver with the catalog and action type
catalogResolver
(Catalog
the catalog instance
catalog
,
CatalogResolver.NotFoundAction
the action to be taken when unable to resolve a reference
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.

public static CatalogResolver

Returns:

an instance of a CatalogResolver
catalogResolver
(CatalogFeatures
the catalog features
features
,
URI...
the uri(s) to one or more catalogs
uris
)

Creates an instance of a CatalogResolver using the specified feature settings and uri(s) to one or more catalog files.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CatalogManagerback to summary
private CatalogManager()

Creating CatalogManager instance is not allowed.

Method Detail

catalogback to summary
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:CatalogFeatures

the catalog features

uris:URI[]

uri(s) to one or more catalogs.

Returns:Catalog

an instance of a Catalog

Exceptions
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
catalogResolverback to summary
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:Catalog

the catalog instance

Returns:CatalogResolver

an instance of a CatalogResolver

catalogResolverback to summary
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:Catalog

the catalog instance

action:CatalogResolver.NotFoundAction

the action to be taken when unable to resolve a reference

Returns:CatalogResolver

a CatalogResolver with the catalog and action type

Since
22
catalogResolverback to summary
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:CatalogFeatures

the catalog features

uris:URI[]

the uri(s) to one or more catalogs

Returns:CatalogResolver

an instance of a CatalogResolver

Exceptions
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