Package net.sf.saxon.lib
Class ChainedResourceResolver
java.lang.Object
net.sf.saxon.lib.ChainedResourceResolver
- All Implemented Interfaces:
ResourceResolver
An ResourceResolver that first tries one supplied ResourceResolver, and if that
returns null, falls back to another. Either ResourceResolver may itself
be a
ChainedResourceResolver
, so a chain of any length can be
established.- Since:
- 11.1
-
Constructor Summary
ConstructorsConstructorDescriptionChainedResourceResolver
(ResourceResolver first, ResourceResolver second) Create a composite entity resolver -
Method Summary
Modifier and TypeMethodDescriptionresolve
(ResourceRequest request) Process a resource request to deliver a resource
-
Constructor Details
-
ChainedResourceResolver
Create a composite entity resolver- Parameters:
first
- the first entity resolver to be usedsecond
- the entity resolver to be used if the first one returns null
-
-
Method Details
-
resolve
Description copied from interface:ResourceResolver
Process a resource request to deliver a resource- Specified by:
resolve
in interfaceResourceResolver
- Parameters:
request
- the resource request- Returns:
- the returned Source; or null to delegate resolution to another resolver. The type of Source
must correspond to the type of resource requested: for non-XML resources, it should generally be a
StreamSource
. - Throws:
XPathException
- if the request is invalid in some way, or if the identified resource is unsuitable, or if resolution is to fail rather than being delegated to another resolver.
-