public class CatalogResourceResolver extends java.lang.Object implements ResourceResolver, ConfigurableResourceResolver, org.xml.sax.EntityResolver, org.xml.sax.ext.EntityResolver2
ResourceResolver interface for use with catalogs.| Constructor and Description |
|---|
CatalogResourceResolver()
Creates a new CatalogResourceResolver resolver with a default
XMLResolverConfiguration. |
CatalogResourceResolver(org.xmlresolver.Resolver resolver)
Creates a new CatlaogResourceResolver using the provided resolver as its underlying resolver.
|
| Modifier and Type | Method and Description |
|---|---|
org.xml.sax.InputSource |
getExternalSubset(java.lang.String name,
java.lang.String baseURI)
Resolves an external subset.
|
<T> T |
getFeature(org.xmlresolver.ResolverFeature<T> feature)
Calls
XMLResolverConfiguration.getFeature(org.xmlresolver.ResolverFeature<T>) on the underlying
resolver configuration. |
javax.xml.transform.Source |
resolve(ResourceRequest request)
Resolve a resource request.
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Resolves an entity.
|
org.xml.sax.InputSource |
resolveEntity(java.lang.String name,
java.lang.String publicId,
java.lang.String baseURI,
java.lang.String systemId)
Resolves an entity.
|
javax.xml.transform.Source |
resolveNamespace(java.lang.String uri,
java.lang.String nature,
java.lang.String purpose)
Resolves a URI that is known to be a namespace URI.
|
<T> void |
setFeature(org.xmlresolver.ResolverFeature<T> feature,
T value)
Calls
XMLResolverConfiguration.setFeature(org.xmlresolver.ResolverFeature<T>, T) on the underlying
resolver configuration. |
public CatalogResourceResolver()
XMLResolverConfiguration.
This default configuration will read a configuration file from the class path
and interrogate system properties to determine its initial configuration.
The configuration can be updated by calling setFeature(org.xmlresolver.ResolverFeature<T>, T). Alternatively,
the constructor can be passed an existing resolver.public CatalogResourceResolver(org.xmlresolver.Resolver resolver)
resolver - The resolver to wrap.public <T> T getFeature(org.xmlresolver.ResolverFeature<T> feature)
XMLResolverConfiguration.getFeature(org.xmlresolver.ResolverFeature<T>) on the underlying
resolver configuration.getFeature in interface ConfigurableResourceResolverT - The feature typefeature - The feature settingpublic <T> void setFeature(org.xmlresolver.ResolverFeature<T> feature,
T value)
XMLResolverConfiguration.setFeature(org.xmlresolver.ResolverFeature<T>, T) on the underlying
resolver configuration.setFeature in interface ConfigurableResourceResolverT - The feature typefeature - The feature settingvalue - The desired value for that featurejava.lang.NullPointerException - if the underlying resolver is null. Some features will
also throw this exception if the value provided is null and that's not a meaningful
feature value.public javax.xml.transform.Source resolve(ResourceRequest request) throws XPathException
resolve in interface ResourceResolverrequest - details of the resource requestXPathException - if an error occurs during the attempt to resolve the URI.public org.xml.sax.InputSource getExternalSubset(java.lang.String name,
java.lang.String baseURI)
throws org.xml.sax.SAXException,
java.io.IOException
EntityResolver2 interface.
The resolver will attempt to find the external subset through the catalog resolver.
If catalog resolution fails and a fallback EntityResolver2 resolver has been chained, the
fallback resolver will be attempted.getExternalSubset in interface org.xml.sax.ext.EntityResolver2name - The doctype name.baseURI - The base URI.org.xml.sax.SAXException - If an error occurs during the attempt to resolve the external subset.java.io.IOException - If it isn't possible to create the input source or if the base URI is invalid.public org.xml.sax.InputSource resolveEntity(java.lang.String name,
java.lang.String publicId,
java.lang.String baseURI,
java.lang.String systemId)
throws org.xml.sax.SAXException,
java.io.IOException
resolveEntity in interface org.xml.sax.ext.EntityResolver2name - The name of the entity, often nullpublicId - The public identifier of the entity, often nullbaseURI - The base URI of the entity, often nullsystemId - The system identifier of the entityorg.xml.sax.SAXException - If an error occurs during the attempt to resolve the external subset.java.io.IOException - If it isn't possible to create the input source or if the base URI is invalid.public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.SAXException,
java.io.IOException
resolveEntity in interface org.xml.sax.EntityResolverpublicId - The public identifier of the entity, often nullsystemId - The system identifier of the entityorg.xml.sax.SAXException - If an error occurs during the attempt to resolve the external subset.java.io.IOException - If it isn't possible to create the input source or if the base URI is invalid.public javax.xml.transform.Source resolveNamespace(java.lang.String uri,
java.lang.String nature,
java.lang.String purpose)
throws javax.xml.transform.TransformerException
uri - The namespace URInature - The nature of the resource requested, for example, the URI of the media typepurpose - The purpose of the request, for example "validation"javax.xml.transform.TransformerException - if an error occurs during the attempt to resolve the URI.Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.