KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > om > NamespaceResolver


1 package net.sf.saxon.om;
2
3 import java.util.Iterator JavaDoc;
4
5 /**
6  * Abstract class that supports lookup of a lexical QName to get the expanded QName.
7  * This extends the JAXP NamespaceContext interface with some Saxon-specific methods,
8  * which must be supplied in a concrete implementation.
9  */

10
11 public interface NamespaceResolver {
12
13     /**
14      * Get the namespace URI corresponding to a given prefix. Return null
15      * if the prefix is not in scope.
16      * @param prefix the namespace prefix. May be the zero-length string, indicating
17      * that there is no prefix. This indicates either the default namespace or the
18      * null namespace, depending on the value of useDefault.
19      * @param useDefault true if the default namespace is to be used when the
20      * prefix is "". If false, the method returns "" when the prefix is "".
21      * @return the uri for the namespace, or null if the prefix is not in scope.
22      * The "null namespace" is represented by the pseudo-URI "".
23     */

24
25     public abstract String JavaDoc getURIForPrefix(String JavaDoc prefix, boolean useDefault);
26
27     /**
28      * Get an iterator over all the prefixes declared in this namespace context. This will include
29      * the default namespace (prefix="") and the XML namespace where appropriate
30      */

31
32     public abstract Iterator JavaDoc iteratePrefixes();
33
34 }
35
36
37 //
38
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
39
// you may not use this file except in compliance with the License. You may obtain a copy of the
40
// License at http://www.mozilla.org/MPL/
41
//
42
// Software distributed under the License is distributed on an "AS IS" basis,
43
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
44
// See the License for the specific language governing rights and limitations under the License.
45
//
46
// The Original Code is: all this file.
47
//
48
// The Initial Developer of the Original Code is Michael H. Kay
49
//
50
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
51
//
52
// Contributor(s): none
53
//
Popular Tags