Class CatalogManager
- Since:
- 9
-
Method Summary
Modifier and TypeMethodDescriptionstatic Catalog
catalog
(CatalogFeatures features, URI... uris) Creates aCatalog
object using the specified feature settings and uri(s) to one or more catalog files.static CatalogResolver
catalogResolver
(Catalog catalog) Creates an instance of aCatalogResolver
using the specified catalog.static CatalogResolver
catalogResolver
(CatalogFeatures features, URI... uris) Creates an instance of aCatalogResolver
using the specified feature settings and uri(s) to one or more catalog files.static CatalogResolver
catalogResolver
(Catalog catalog, CatalogResolver.NotFoundAction action) Creates aCatalogResolver
that resolves external references with the givencatalog
andaction
type that determines the behavior when unable to resolve a reference.
-
Method Details
-
catalog
Creates aCatalog
object using the specified feature settings and uri(s) to one or more catalog files.If
uris
is empty, system propertyjavax.xml.catalog.files
, as defined inCatalogFeatures
, will be read to locate the initial list of catalog files.If multiple catalog files are specified through the
uris
argument orjavax.xml.catalog.files
property, the first entry is considered the main catalog, while others are treated as alternative catalogs after those referenced by thenextCatalog
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 featuresuris
- 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 schemeCatalogException
- If an error occurs while parsing the catalog
-
catalogResolver
Creates an instance of aCatalogResolver
using the specified catalog.- API Note:
- The
CatalogResolver
created by this method delegates to the underlyingcatalog
's RESOLVE property. TheCatalogResolver
created bycatalogResover(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 aCatalogResolver
that resolves external references with the givencatalog
andaction
type that determines the behavior when unable to resolve a reference.The
action
types are mapped to the values of theRESOLVE
property.- Parameters:
catalog
- the catalog instanceaction
- the action to be taken when unable to resolve a reference- Returns:
- a
CatalogResolver
with thecatalog
andaction
type - Since:
- 22
-
catalogResolver
Creates an instance of aCatalogResolver
using the specified feature settings and uri(s) to one or more catalog files.If
uris
is empty, system propertyjavax.xml.catalog.files
, as defined inCatalogFeatures
, will be read to locate the initial list of catalog files.If multiple catalog files are specified through the
uris
argument orjavax.xml.catalog.files
property, the first entry is considered the main catalog, while others are treated as alternative catalogs after those referenced by thenextCatalog
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 featuresuris
- 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 schemeCatalogException
- If an error occurs while parsing the catalog
-