KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > service > namespace > NamespacePrefixResolver


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.service.namespace;
18
19 import java.util.Collection JavaDoc;
20
21 /**
22  * The <code>NamespacePrefixResolver</code> provides a mapping between
23  * namespace prefixes and namespace URIs.
24  *
25  * @author David Caruana
26  */

27 public interface NamespacePrefixResolver
28 {
29     /**
30      * Gets the namespace URI registered for the given prefix
31      *
32      * @param prefix prefix to lookup
33      * @return the namespace
34      * @throws NamespaceException if prefix has not been registered
35      */

36     public String JavaDoc getNamespaceURI(String JavaDoc prefix)
37         throws NamespaceException;
38     
39     /**
40      * Gets the registered prefixes for the given namespace URI
41      *
42      * @param namespaceURI namespace URI to lookup
43      * @return the prefixes (or empty collection, if no prefixes registered against URI)
44      * @throws NamespaceException if URI has not been registered
45      */

46     public Collection JavaDoc<String JavaDoc> getPrefixes(String JavaDoc namespaceURI)
47         throws NamespaceException;
48     
49     /**
50      * Gets all registered Prefixes
51      *
52      * @return collection of all registered namespace prefixes
53      */

54     Collection JavaDoc<String JavaDoc> getPrefixes();
55
56     /**
57      * Gets all registered Uris
58      *
59      * @return collection of all registered namespace uris
60      */

61     Collection JavaDoc<String JavaDoc> getURIs();
62
63 }
64
Popular Tags