KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > query > ModuleURIResolver


1 package net.sf.saxon.query;
2 import net.sf.saxon.trans.XPathException;
3
4 import javax.xml.transform.stream.StreamSource JavaDoc;
5 import java.io.Serializable JavaDoc;
6
7
8 /**
9  * 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 JavaDoc {
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 JavaDoc[] resolve(String JavaDoc moduleURI, String JavaDoc baseURI, String JavaDoc[] locations) throws XPathException;
39
40 }
41
42 //
43
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
44
// you may not use this file except in compliance with the License. You may obtain a copy of the
45
// License at http://www.mozilla.org/MPL/
46
//
47
// Software distributed under the License is distributed on an "AS IS" basis,
48
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
49
// See the License for the specific language governing rights and limitations under the License.
50
//
51
// The Original Code is: all this file.
52
//
53
// The Initial Developer of the Original Code is Michael H. Kay
54
//
55
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
56
//
57
// Contributor(s): none.
58
//
59
Popular Tags