-
public interface CatalogThe Catalog class represents an entity Catalog as defined by XML Catalogs, OASIS Standard V1.1, 7 October 2005.A catalog is an XML file that contains a root
catalogentry with a list of catalog entries. The entries can also be grouped with agroupentry. The catalog and group entries may specifypreferandxml:baseattributes that set preference of public or system type of entries and base URI to resolve relative URIs.A catalog can be used in two situations:
- Locate the external resources with a public or system identifier;
- Locate an alternate URI reference with a URI.
For case 1, the standard defines 6 External Identifier Entries:
public, system, rewriteSystem, systemSuffix, delegatePublic, and delegateSystem.While for case 2, it defines 4 URI Entries:
uri, rewriteURI, uriSuffix and delegateURI.In addition to the above entry types, a catalog may define nextCatalog entries to add additional catalog entry files.
- Since:
- 9
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stream<Catalog>catalogs()Returns a sequential Stream of alternative Catalogs specified using thenextCatalogentries in the current catalog, and as the input of catalog files excluding the current catalog (that is, the first in the input list) when the Catalog object is created by theCatalogManager.StringmatchPublic(String publicId)Attempts to find a matching entry in the catalog by publicId.StringmatchSystem(String systemId)Attempts to find a matching entry in the catalog by systemId.StringmatchURI(String uri)Attempts to find a matching entry in the catalog by the uri element.
-
-
-
Method Detail
-
matchSystem
String matchSystem(String systemId)
Attempts to find a matching entry in the catalog by systemId.The method searches through the system-type entries, including
system, rewriteSystem, systemSuffix, delegateSystem, andgroupentries in the current catalog in order to find a match.Resolution follows the steps listed below:
- If a matching
systementry exists, it is returned immediately. - If more than one
rewriteSystementry matches, the matching entry with the longest normalizedsystemIdStartStringvalue is returned. - If more than one
systemSuffixentry matches, the matching entry with the longest normalizedsystemIdSuffixvalue is returned. - If more than one
delegateSystementry matches, the matching entry with the longest matchingsystemIdStartStringvalue is returned.
- Parameters:
systemId- the system identifier of the entity to be matched- Returns:
- a URI string if a mapping is found, or null otherwise
- If a matching
-
matchPublic
String matchPublic(String publicId)
Attempts to find a matching entry in the catalog by publicId. The method searches through the public-type entries, includingpublic, delegatePublic, andgroupentries in the current catalog in order to find a match.Refer to the description about Feature PREFER in the table Catalog Features in class
CatalogFeatures. Public entries are only considered if thepreferispublicandsystementries are not found.Resolution follows the steps listed below:
- If a matching
publicentry is found, it is returned immediately. - If more than one
delegatePublicentry matches, the matching entry with the longest matchingpublicIdStartStringvalue is returned.
- Parameters:
publicId- the public identifier of the entity to be matched- Returns:
- a URI string if a mapping is found, or null otherwise
- See Also:
CatalogFeatures.Feature
- If a matching
-
matchURI
String matchURI(String uri)
Attempts to find a matching entry in the catalog by the uri element.The method searches through the uri-type entries, including
uri, rewriteURI, uriSuffix, delegateURIandgroupentries in the current catalog in order to find a match.Resolution follows the steps listed below:
- If a matching
urientry is found, it is returned immediately. - If more than one
rewriteURIentry matches, the matching entry with the longest normalizeduriStartStringvalue is returned. - If more than one
uriSuffixentry matches, the matching entry with the longest normalizeduriSuffixvalue is returned. - If more than one
delegatePublicentry matches, the matching entry with the longest matchinguriStartStringvalue is returned.
- Parameters:
uri- the URI reference of the entity to be matched- Returns:
- a URI string if a mapping is found, or null otherwise
- If a matching
-
catalogs
Stream<Catalog> catalogs()
Returns a sequential Stream of alternative Catalogs specified using thenextCatalogentries in the current catalog, and as the input of catalog files excluding the current catalog (that is, the first in the input list) when the Catalog object is created by theCatalogManager.The order of Catalogs in the returned stream is the same as the order in which the corresponding
nextCatalogentries appear in the current catalog. The alternative catalogs from the input file list are appended to the end of the stream in the order they are entered.- Returns:
- a sequential Stream of Catalogs
-
-