KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > common > DomainAccessToken


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/DomainAccessToken.java,v 1.10 2004/07/28 09:38:20 ib Exp $
3  * $Revision: 1.10 $
4  * $Date: 2004/07/28 09:38:20 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.common;
25
26 import java.io.Reader JavaDoc;
27 import java.util.Hashtable JavaDoc;
28
29 /**
30  * Domain accessor token class.
31  *
32  * @version $Revision: 1.10 $
33  */

34 public final class DomainAccessToken {
35     
36     
37     // ------------------------------------------------------------ Constructor
38

39     
40     /**
41      * Constructor.
42      */

43     DomainAccessToken() {
44         namespaceTokens = new Hashtable JavaDoc();
45     }
46     
47     
48     // ----------------------------------------------------- Instance Variables
49

50     
51     /**
52      * Default namespace associated with this token.
53      */

54     Hashtable JavaDoc namespaceTokens;
55     
56     
57     /**
58      * True if enables creation of namespaces.
59      */

60     boolean canCreateNamespaces;
61     
62     
63     /**
64      * True if enables removal of namespaces.
65      */

66     boolean canDeleteNamespaces;
67     
68     
69     // --------------------------------------------------------- Public Methods
70

71     
72     /**
73      * Get a namespace.
74      *
75      * @param namespaceName Name of the namespace we want to access
76      * @return NamespaceToken null if no namespace of this name exists in the
77      * access token
78      */

79     public NamespaceAccessToken getNamespaceToken(String JavaDoc namespaceName) {
80         return (NamespaceAccessToken) namespaceTokens.get(namespaceName);
81     }
82     
83     
84     /**
85      * Create a new namespace.
86      *
87      * @param namespaceName Name of the new namespace
88      * @param Reader Reader in which we can read the namespace
89      * initialization parameters
90      */

91     public void createNewNamespace(String JavaDoc namespaceName, Reader JavaDoc parameters)
92         throws SlideException {
93         /*
94         if (canCreateNamespaces) {
95             Namespace namespace = new Namespace();
96             namespace.setName(namespaceName);
97             namespace.loadNamespaceParameters(parameters);
98             namespaceTokens.put(namespaceName, namespace);
99         }
100         */

101     }
102     
103     
104     // -------------------------------------------------------- Package Methods
105

106     
107     /**
108      * Add a namespace token to the hastable;
109      *
110      * @param namespaceToken
111      */

112     void addNamespaceToken(NamespaceAccessToken namespaceToken) {
113         namespaceTokens.put(namespaceToken.getName(), namespaceToken);
114     }
115     
116 }
117
Popular Tags