KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > ast > lib > AbstractStorageTypeDeclImpl


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Philippe Merle.
23 Contributor(s): Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.ast.lib;
28
29 /** To access AST DeclarationKind. */
30 import org.objectweb.openccm.ast.api.DeclarationKind;
31
32 /**
33  * AbstractStorageTypeDeclImpl is a wrapper class for
34  * PSDL abstract storagetype declarations.
35  *
36  *
37  * Inherits from:
38  *
39  * - StorageTypeBaseImpl as abstract storagetypes are also IDL forward scopes.
40  *
41  *
42  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
43  * <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</a>
44  *
45  * @version 0.1
46  */

47
48 public class AbstractStorageTypeDeclImpl
49      extends StorageTypeBaseImpl
50   implements org.objectweb.openccm.ast.api.AbstractStorageTypeDecl
51 {
52     // ==================================================================
53
//
54
// Internal state.
55
//
56
// ==================================================================
57

58     /** The idl mapping. */
59     protected org.objectweb.openccm.ast.api.NativeDecl mapping_;
60
61     // ==================================================================
62
//
63
// Constructor.
64
//
65
// ==================================================================
66

67     /**
68      * The constructor with the parent scope.
69      *
70      * @param parent The parent scope of the declaration.
71      */

72     protected
73     AbstractStorageTypeDeclImpl(Repository rep,
74                                 ScopeImpl parent)
75     {
76         // Call the StorageTypeBaseImpl constructor.
77
super(rep, parent);
78
79         // Init internal state
80
mapping_ = null;
81     }
82
83     // ==================================================================
84
//
85
// Internal methods.
86
//
87
// ==================================================================
88

89     // ==================================================================
90
//
91
// Methods for DeclarationImpl
92
//
93
// ==================================================================
94

95     /**
96      * Obtain its DeclarationKind.
97      *
98      * This method is implemented into DeclarationImpl subclasses.
99      *
100      * @return The DeclarationKind of the object.
101      */

102     public long
103     getDeclKind()
104     {
105         return DeclarationKind.dk_abstract_storage_type;
106     }
107
108     // ==================================================================
109
//
110
// Methods for ScopeImpl
111
//
112
// ==================================================================
113

114     // ==================================================================
115
//
116
// Methods for ForwardScopeImpl
117
//
118
// ==================================================================
119

120     // ==================================================================
121
//
122
// Methods for ForwardScopeIDLImpl
123
//
124
// ==================================================================
125

126     // ==================================================================
127
//
128
// Methods for StorageTypeBaseImpl
129
//
130
// ==================================================================
131

132     // ==================================================================
133
//
134
// Public methods.
135
//
136
// ==================================================================
137

138     // ==================================================================
139
//
140
// Methods for OMG IDL org.objectweb.openccm.ast.api.WithDependencies
141
//
142
// ==================================================================
143

144     // ==================================================================
145
//
146
// Methods for OMG IDL org.objectweb.openccm.ast.api.Declaration
147
//
148
// ==================================================================
149

150     // ==================================================================
151
//
152
// Methods for OMG IDL org.objectweb.openccm.ast.api.Scope
153
//
154
// ==================================================================
155

156     // ==================================================================
157
//
158
// Methods for OMG IDL org.objectweb.openccm.ast.api.ForwardScope
159
//
160
// ==================================================================
161

162     // ==================================================================
163
//
164
// Methods for OMG IDL org.objectweb.openccm.ast.api.StorageTypeBase
165
//
166
// ==================================================================
167

168     // ==================================================================
169
//
170
// Methods for OMG IDL org.objectweb.openccm.ast.api.AbstractStorageTypeDecl
171
//
172
// ==================================================================
173

174     /**
175      * Obtain the idl2 mapping of this abstract storage type.
176      *
177      * @return The mapped native declaration.
178      **/

179     public org.objectweb.openccm.ast.api.NativeDecl
180     getMapping()
181     {
182         if (mapping_ == null)
183         {
184             ScopeImpl module = (ScopeImpl)getParent();
185
186             mapping_ = module.startNative(getName());
187             // Create a NativeDef into the IFR.
188
((NativeDeclImpl)mapping_).setIDLType( module.getContainer().
189                        create_native(mapping_.getId(), mapping_.getName(), mapping_.getVersion()) );
190         }
191         return mapping_;
192     }
193 }
194
Popular Tags