All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.saxon.lib.CollectionFinder Maven / Gradle / Ivy

There is a newer version: 12.5
Show newest version
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2018-2022 Saxonica Limited
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

package net.sf.saxon.lib;

import net.sf.saxon.expr.XPathContext;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.transpile.CSharpDelegate;

/**
 * An instance of CollectionFinder can be registered with the Saxon configuration; it is called in response
 * to calls on the fn:collection() and fn:uri-collection() functions.
 *
 * When these functions are called, the {@link #findCollection(XPathContext, String)} method is
 * called to get a {@link ResourceCollection} object representing the collection of resources identified by
 * the supplied collection URI.
 *
 * @since 9.7: Supersedes CollectionURIResolver.
 * The interface was changed to return Resource objects, to allow streamed
 * processing of the documents in a collection; and to pass a properties object that
 * can be used to indicate whether the collection is stable (that is, repeated requests
 * return the same result)
 */

@FunctionalInterface
@CSharpDelegate(true)
public interface CollectionFinder {

    /**
     * Locate the collection of resources corresponding to a collection URI.
     * @param context The XPath dynamic evaluation context
     * @param collectionURI The collection URI: an absolute URI, formed by resolving the argument
     *                      supplied to the fn:collection or fn:uri-collection against the static
     *                      base URI
     * @return a ResourceCollection object representing the resources in the collection identified
     * by this collection URI. Result should not be null.
     * @throws XPathException if the collection was not found
     */
    //@CSharpReplaceMethod(code="object findCollection(net.sf.saxon.expr.XPathContext context, string collectionURI);")
    ResourceCollection findCollection(XPathContext context, String collectionURI) throws XPathException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy