public abstract class AbstractResourceCollection extends java.lang.Object implements ResourceCollection
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractResourceCollection.InputDetails |
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
collectionURI |
protected Configuration |
config |
protected URIQueryParameters |
params |
| Constructor and Description |
|---|
AbstractResourceCollection(Configuration config) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCollectionURI()
Get the URI of the collection
|
protected AbstractResourceCollection.InputDetails |
getInputDetails(java.lang.String resourceURI) |
protected java.lang.String |
guessContentType(java.lang.String resourceURI,
java.io.InputStream stream)
Guess the content type of a resource from its name and/or its content
|
boolean |
isStable(XPathContext context)
Ask whether the collection is stable.
|
Resource |
makeResource(Configuration config,
AbstractResourceCollection.InputDetails details,
java.lang.String resourceURI)
Internal method to make a resource for a single entry in the ZIP or JAR file.
|
Resource |
makeResource(Configuration config,
java.lang.String resourceURI)
Default method to make a resource, given a resource URI
|
protected ParseOptions |
optionsFromQueryParameters(URIQueryParameters params,
XPathContext context) |
void |
registerContentType(java.lang.String contentType,
ResourceFactory factory)
Associate a media type with a resource factory.
|
boolean |
stripWhitespace(SpaceStrippingRule rules)
Supply information about the whitespace stripping rules that apply to this collection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetResources, getResourceURIsprotected Configuration config
protected java.lang.String collectionURI
protected URIQueryParameters params
public AbstractResourceCollection(Configuration config)
public java.lang.String getCollectionURI()
ResourceCollectiongetCollectionURI in interface ResourceCollectionpublic boolean isStable(XPathContext context)
ResourceCollection.getResources(XPathContext) or ResourceCollection.getResourceURIs(XPathContext)isStable in interface ResourceCollectioncontext - the XPath evaluation context.FeatureKeys.STABLE_COLLECTION_URI is set.public void registerContentType(java.lang.String contentType,
ResourceFactory factory)
contentType - a media type or MIME type, for example application/xsd+xmlfactory - a ResourceFactory used to parse (or otherwise process) resources of that typeprotected ParseOptions optionsFromQueryParameters(URIQueryParameters params, XPathContext context)
protected AbstractResourceCollection.InputDetails getInputDetails(java.lang.String resourceURI) throws XPathException
XPathExceptionprotected java.lang.String guessContentType(java.lang.String resourceURI,
java.io.InputStream stream)
resourceURI - the resource URIstream - the content of the resource. The stream must be positioned at the start.
The method looks ahead in this stream
but resets the current position on exit.public Resource makeResource(Configuration config, AbstractResourceCollection.InputDetails details, java.lang.String resourceURI) throws XPathException
config - The Saxon configurationdetails - Details of the input, including the input stream delivering the content of the resource.
The method is expected to
consume this input stream; the caller will close it on return.resourceURI - the URI of the entry within the ZIP or JAR file; this will by default be
in the form collectionURI!pathXPathExceptionpublic Resource makeResource(Configuration config, java.lang.String resourceURI) throws XPathException
resourceURI - the resource URIXPathExceptionpublic boolean stripWhitespace(SpaceStrippingRule rules)
stripWhitespace in interface ResourceCollectionrules - the space-stripping rules that apply to this collection, derived from
the xsl:strip-space and xsl:preserve-space declarations in the stylesheet
package containing the call to the collection() function.Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.