org.xml.sax.EntityResolver ,
StAX javax.xml.stream.XMLResolver ,
DOM LS org.w3c.dom.ls.LSResourceResolver used by Schema Validation, and
Transform javax.xml.transform.URIResolver , and resolves
external references using catalogs.
The
Catalog Standard distinguished external identifiers from uri entries
as being used to solely identify DTDs, while uri entries for
other resources such as stylesheets and schema. The Java APIs, such as
javax. and org.
however, make no such distinction.
In consistent with the existing Java API, this CatalogResolver recognizes a
system identifier as a URI and will search both system and uri
entries in a catalog in order to find a matching entry.
The search is started in the current catalog. If a match is found, no further attempt will be made. Only if there is no match in the current catalog, will alternate catalogs including delegate and next catalogs be considered.
systemId. The system entries include system,
rewriteSystem and systemSuffix entries.
If no match is found, public entries may be searched in accordance with
the prefer attribute.
The prefer attribute: if the prefer is public,
and there is no match found through the system entries, public entries
will be considered. If it is not specified, the prefer is public
by default (Note that by the OASIS standard, system entries will always
be considered before public entries. Prefer public means that public entries
will be matched when both system and public identifiers are specified.
In general therefore, prefer public is recommended.)
If no match is found with the systemId and public identifier,
the resolver will continue searching uri entries
with the specified systemId or href. The uri entries
include uri, rewriteURI, and uriSuffix entries.
org.xml.sax.SAXException and java.io.IOException by
org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
javax.xml.stream.XMLStreamException by
javax.xml.stream.XMLResolver#resolveEntity(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
javax.xml.transform.TransformerException by
javax.xml.transform.URIResolver#resolve(java.lang.String, java.lang.String)
The CatalogResolver however, will throw javax.
only when javax.xml.catalog.resolve is specified as strict.
For applications that expect to handle the checked Exceptions, it may be
necessary to use a custom resolver to wrap the CatalogResolver or implement it
with a javax. object.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | CatalogResolver.
Defines the actions that a CatalogResolver may take when it is unable to resolve an external reference. |
| Modifier and Type | Method and Description |
|---|---|
| public Source | Returns: ajavax. object if a mapping is found.
If no mapping is found, returns an empty javax.
object if the javax.xml.catalog.resolve property is set to
ignore;
returns a javax. object with the original URI
(href, or href resolved with base if base is not null) if the
javax.xml.catalog.resolve property is set to continue.the href attribute that specifies the URI of a style sheet,
which may be relative or absolute href, String The base URI against which the href attribute will be made
absolute if the absolute URI is required base)Redeclares javax. Implements URIResolver. |
| public InputSource | Returns: aorg. object if a mapping is found.
If no mapping is found, returns a org. object
containing an empty java. if the
javax.xml.catalog.resolve property is set to ignore;
returns null if the
javax.xml.catalog.resolve property is set to continue.the public identifier of the external entity being
referenced, or null if none was supplied publicId, String the system identifier of the external entity being
referenced. A system identifier is required on all external entities. XML
requires a system identifier on all external entities, so this value is
always specified. systemId)Redeclares org. Implements |
| public InputStream | Returns: anjava. object if a mapping is found; null
if no mapping is found and the javax.xml.catalog.resolve property
is set to continue or ignore. Note that for XMLResolver,
it is not possible to ignore a reference, ignore is therefore
treated the same as continue.the public identifier of the external entity being
referenced, or null if none was supplied publicId, String the system identifier of the external entity being
referenced. A system identifier is required on all external entities. XML
requires a system identifier on all external entities, so this value is
always specified. systemId, String the absolute base URI, not used by the CatalogResolver baseUri, String the namespace of the entity to resolve, not used by the
CatalogResolver. namespace)Redeclares javax. Implements |
| public LSInput | Returns: aorg. object if a mapping is found; null
if no mapping is found and the javax.xml.catalog.resolve property
is set to continue or ignore. Note that for
org., it is not possible to ignore a
reference, ignore is therefore treated the same as continue.the type of the resource being resolved,
not used by the CatalogResolver type, String the namespace of the resource being resolved,
not used by the CatalogResolver namespaceUri, String the public identifier of the external entity being
referenced, or publicId, String null if no public identifier was
supplied or if the resource is not an entity.the system identifier, a URI reference of the
external resource being referenced systemId, String the absolute base URI, not used by the CatalogResolver baseUri)Redeclares org. Implements |
| resolve | back to summary |
|---|---|
| public Source resolve(String href, String base) Redeclares javax. Implements URIResolver. The method searches through the catalog entries
in the main and alternative catalogs to attempt to find a match
with the specified
If the value is a URN, the
| |
| resolveEntity | back to summary |
|---|---|
| public InputSource resolveEntity(String publicId, String systemId) Redeclares org. Implements
| |
| resolveEntity | back to summary |
|---|---|
| public InputStream resolveEntity(String publicId, String systemId, String baseUri, String namespace) Redeclares javax. Implements
The
| |
| resolveResource | back to summary |
|---|---|
| public LSInput resolveResource(String type, String namespaceUri, String publicId, String systemId, String baseUri) Redeclares org. Implements
The
| |
RESOLVE property.
| Modifier and Type | Field and Description |
|---|---|
| public static final CatalogResolver. | |
| public static final CatalogResolver. | |
| public static final CatalogResolver. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CatalogResolver. | |
| public static CatalogResolver. | |
| public static CatalogResolver. |
| CONTINUE | back to summary |
|---|---|
| public static final CatalogResolver. Indicates that the processing should continue as defined by the
| |
| IGNORE | back to summary |
|---|---|
| public static final CatalogResolver. Indicates that the reference is skipped as defined by the
| |
| STRICT | back to summary |
|---|---|
| public static final CatalogResolver. Indicates that the resolver should throw a CatalogException as defined
by the | |
| NotFoundAction | back to summary |
|---|---|
| private NotFoundAction() | |
| getType | back to summary |
|---|---|
| public static CatalogResolver. Returns the action type mapped to the specified
| |
| valueOf | back to summary |
|---|---|
| public static CatalogResolver. | |
| values | back to summary |
|---|---|
| public static CatalogResolver. | |