Interface XMLCatalogResolver
-
- All Known Implementing Classes:
CatalogManager,ResourceCache
public interface XMLCatalogResolverThe Catalog resolver interface.The
XMLCatalogResolverinterface exposes the catalog-based lookup functionality of the OASIS Open XML Catalogs 1.1 specification. It supports all of the normative catalog entries and several of the TR9401 entries described in Appendix D.The API doesn't expose methods to access
catalog,group, ornextCatalogentries because they are internal to the resolution process. A conformant catalog processor must support them.The
dtddecl,sgmldecl, andlinktypeentries are not supported because they have no useful purpose in XML.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.net.URIlookupDoctype(java.lang.String entityName, java.lang.String systemId, java.lang.String publicId)Lookup a document type.java.net.URIlookupDocument()Lookup a default document.java.net.URIlookupEntity(java.lang.String entityName, java.lang.String systemId, java.lang.String publicId)Lookup an entity.java.net.URIlookupNotation(java.lang.String notationName, java.lang.String systemId, java.lang.String publicId)Lookup a notation.java.net.URIlookupPublic(java.lang.String systemId, java.lang.String publicId)Lookup an external identifier by public and system identifier.java.net.URIlookupSystem(java.lang.String systemId)Lookup an external identifier by system identifier.java.net.URIlookupURI(java.lang.String uri)Lookup a URI.
-
-
-
Method Detail
-
lookupURI
java.net.URI lookupURI(java.lang.String uri)
Lookup a URI.This method searches
uri,rewriteURI,uriSuffix, anddelegateURIcatalog entries.- Parameters:
uri- The request URI- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupPublic
java.net.URI lookupPublic(java.lang.String systemId, java.lang.String publicId)Lookup an external identifier by public and system identifier.This method searches
public,delegatePublic,system,delegateSystem,rewriteSystem, andsystemSuffixcatalog entries.If both public and system mappings exist, the match depends on the setting of the "prefer public" option.
Note that public identifiers can be encoded as URNs per RFC 3151. A call to:
lookupPublic("urn:publicid:-:OASIS:DTD+DocBook+XML+V4.1.2:EN", null)Is precisely the same as a call to
lookupPublic(null, "-//OASIS//DTD DocBook XML V4.1.2//EN")
If both the public and system identifiers are
null,nullis returned.- Parameters:
systemId- The system identifier, possibly null.publicId- The public identifier, possibly null.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupSystem
java.net.URI lookupSystem(java.lang.String systemId)
Lookup an external identifier by system identifier.This method searches
system,delegateSystem,rewriteSystem, andsystemSuffixcatalog entries.- Parameters:
systemId- The system identifier.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupDoctype
java.net.URI lookupDoctype(java.lang.String entityName, java.lang.String systemId, java.lang.String publicId)Lookup a document type.This method searches for a document type. A document type, for example:
<!DOCTYPE book SYSTEM "urn:publicid:-:OASIS:DTD+DocBook+XML+V4.1.2:EN">
Consists of an entity name ("book") and optional system and public identifiers. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.
If no external identifier is provided, the
entityNamewill be matched againstdoctypecatalog entries.- Parameters:
entityName- The entity name.systemId- The system identifier, possibly null.publicId- The public identifier, possibly null.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupEntity
java.net.URI lookupEntity(java.lang.String entityName, java.lang.String systemId, java.lang.String publicId)Lookup an entity.This method searches for an entity. An entity:
<!ENTITY chapter1 SYSTEM "chap1.xml">
consists of an entity name ("chapter1") and an external identifier. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.
If no external identifier is provided, the
entityNamewill be matched againstentitycatalog entries.- Parameters:
entityName- The entity name.systemId- The system identifier, possibly null.publicId- The public identifier, possibly null.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupNotation
java.net.URI lookupNotation(java.lang.String notationName, java.lang.String systemId, java.lang.String publicId)Lookup a notation.This method searches for a notation. A notation:
<!NOTATION thing SYSTEM "thing.bin">
consists of a notation name ("thing") and optional system and public identifiers. If either (or both) of system and public identifiers are provided, matches for those identifiers are preferred over a match on the entity name.
If no external identifier is provided, the
notationNamewill be matched againstnotationcatalog entries.- Parameters:
notationName- The notation name.systemId- The system identifier, possibly null.publicId- The public identifier, possibly null.- Returns:
- The mapped URI, or null if no mapping was found.
-
lookupDocument
java.net.URI lookupDocument()
Lookup a default document.- Returns:
- The URI of the default document, or null if no mapping was found.
This method returns (the first) matching
documententry.
-
-