public class StandardCollectionFinder extends java.lang.Object implements CollectionFinder
ResourceCollection
DirectoryCollection
isJarFileURI(String)
returns
true, the URI is treated as identifying a JAR or ZIP archive, whose contents form the
resources in the collection: it is returned as an instance of JarCollection
URIResolver
Constructor and Description |
---|
StandardCollectionFinder() |
Modifier and Type | Method and Description |
---|---|
static void |
checkNotNull(java.lang.String collectionURI,
XPathContext context)
If the collectionURI is null, report that no default collection exists
|
ResourceCollection |
findCollection(XPathContext context,
java.lang.String collectionURI)
Locate the collection of resources corresponding to a collection URI.
|
protected boolean |
isJarFileURI(java.lang.String collectionURI)
Ask whether the collection URI should be interpreted as identifying a JAR (or ZIP) file.
|
void |
registerCollection(java.lang.String collectionURI,
ResourceCollection collection)
Register a specific URI and bind it to a specific ResourceCollection
|
public void registerCollection(java.lang.String collectionURI, ResourceCollection collection)
collectionURI
- the collection URI to be registered. Must not be null.collection
- the ResourceCollection to be associated with this URI. Must not be null.public ResourceCollection findCollection(XPathContext context, java.lang.String collectionURI) throws XPathException
findCollection
in interface CollectionFinder
context
- The XPath dynamic evaluation contextcollectionURI
- The collection URI: an absolute URI, formed by resolving the argument
supplied to the fn:collection or fn:uri-collection against the static
base URIXPathException
- if the collection URI cannot be resolved to a collectionpublic static void checkNotNull(java.lang.String collectionURI, XPathContext context) throws XPathException
collectionURI
- the collection URI to be testedcontext
- XPath evaluation contextXPathException
- if the collectionURI is nullprotected boolean isJarFileURI(java.lang.String collectionURI)
collectionURI
- the requested absolute collection URICopyright (c) 2004-2020 Saxonica Limited. All rights reserved.