01: package net.sf.saxon.query;
02:
03: import net.sf.saxon.trans.XPathException;
04:
05: import javax.xml.transform.stream.StreamSource;
06: import java.io.Serializable;
07:
08: /**
09: * This interface defines a ModuleURIResolver. This takes a module URI and a set of
10: * module location hints as input, and returns a StreamSource representing the text of the query,
11: * and containing its base URI.
12: * <p>
13: * The system supplies a StandardModuleURIResolver but this can be overridden by a user-supplied
14: * ModuleURIResolver.
15: * @author Michael H. Kay
16: */
17:
18: public interface ModuleURIResolver extends Serializable {
19:
20: /**
21: * Resolve a module URI and associated location hints.
22: * @param moduleURI The module namespace URI of the module to be imported; or null when
23: * loading a non-library module.
24: * @param baseURI The base URI of the module containing the "import module" declaration;
25: * null if no base URI is known
26: * @param locations The set of URIs specified in the "at" clause of "import module",
27: * which serve as location hints for the module
28: * @return an array of StreamSource objects each identifying the contents of a module to be
29: * imported. Each StreamSource must contain a
30: * non-null absolute System ID which will be used as the base URI of the imported module,
31: * and either an InputSource or a Reader representing the text of the module. The method
32: * may also return null, in which case the system attempts to resolve the URI using the
33: * standard module URI resolver.
34: * @throws XPathException if the module cannot be located, and if delegation to the default
35: * module resolver is not required.
36: */
37:
38: public StreamSource[] resolve(String moduleURI, String baseURI,
39: String[] locations) throws XPathException;
40:
41: }
42:
43: //
44: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
45: // you may not use this file except in compliance with the License. You may obtain a copy of the
46: // License at http://www.mozilla.org/MPL/
47: //
48: // Software distributed under the License is distributed on an "AS IS" basis,
49: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
50: // See the License for the specific language governing rights and limitations under the License.
51: //
52: // The Original Code is: all this file.
53: //
54: // The Initial Developer of the Original Code is Michael H. Kay
55: //
56: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
57: //
58: // Contributor(s): none.
59: //
|