KickJava   Java API By Example, From Geeks To Geeks.

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


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, Mathieu Vadet.
23 Contributor(s): Christophe Demarey.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.ast.lib;
28
29 /** Used to access AST TypeKind. */
30 import org.objectweb.openccm.ast.api.TypeKind;
31
32 /** Used to access AST DeclarationKind. */
33 import org.objectweb.openccm.ast.api.DeclarationKind;
34
35 /** To use CORBA::ExtLocalInterfaceDef. */
36 import org.omg.CORBA.ExtLocalInterfaceDefHelper;
37
38 /**
39  * LocalInterfaceDeclImpl is a wrapper class for
40  * IDL local interface declarations.
41  *
42  * Inherits from:
43  * - InterfaceDeclImpl as they are also IDL interfaces.
44  *
45  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
46  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
47  *
48  * @version 0.3
49  */

50
51 public class LocalInterfaceDeclImpl
52        extends InterfaceDeclImpl
53        implements org.objectweb.openccm.ast.api.LocalInterfaceDecl
54 {
55     // ==================================================================
56
//
57
// Internal state.
58
//
59
// ==================================================================
60

61     /** Reference to the CORBA 3.0 LocalInterfaceDef. */
62     private org.omg.CORBA.ExtLocalInterfaceDef ext_local_interface_def_;
63
64     // ==================================================================
65
//
66
// Constructor.
67
//
68
// ==================================================================
69

70     /**
71      * The constructor with the parent scope.
72      *
73      * @param rep The repository of the declaration.
74      * @param parent The parent scope of the local interface declaration.
75      */

76     protected
77     LocalInterfaceDeclImpl(Repository rep, ScopeImpl parent)
78     {
79         // Call the InterfaceDefImpl constructor.
80
super(rep, parent);
81
82         // Init internal state.
83
ext_local_interface_def_ = null;
84     }
85
86     // ==================================================================
87
//
88
// Internal methods.
89
//
90
// ==================================================================
91

92     // ==================================================================
93
//
94
// Internal methods for DeclarationImpl.
95
//
96
// ==================================================================
97

98     /**
99      * Loads infos of the CORBA 3.0 InterfaceDef.
100      *
101      * @param contained The InterfaceDef to load.
102      */

103     protected void
104     load(org.omg.CORBA.Contained JavaDoc contained)
105     {
106         ext_local_interface_def_ = ExtLocalInterfaceDefHelper.narrow(contained);
107         super.load(contained);
108     }
109
110     /**
111      * Loads infos of the CORBA 3.0 InterfaceDef.
112      *
113      * @param contained The InterfaceDef to load.
114      */

115     protected void
116     loadAsMapping(org.omg.CORBA.Contained JavaDoc contained)
117     {
118         ext_local_interface_def_ = ExtLocalInterfaceDefHelper.narrow(contained);
119         super.loadAsMapping(contained);
120     }
121
122     /**
123      * Obtain its CORBA 3.0 Contained reference.
124      *
125      * @return The Contained object associated with the local
126      * interface declaration.
127      */

128     protected org.omg.CORBA.Contained JavaDoc
129     getContained()
130     {
131        return ext_local_interface_def_;
132     }
133
134     // ==================================================================
135
//
136
// Internal methods for ScopeImpl.
137
//
138
// ==================================================================
139

140     /**
141      * Obtain its CORBA 3.0 Container reference.
142      *
143      * @return The Container object associated with the local
144      * interface declaration.
145      */

146     protected org.omg.CORBA.Container JavaDoc
147     getContainer()
148     {
149        return ext_local_interface_def_;
150     }
151
152     // ==================================================================
153
//
154
// Internal methods for ForwardScopeImpl.
155
//
156
// ==================================================================
157

158     /**
159      ** Create the container object.
160      **/

161     protected void
162     createContainer()
163     {
164         ext_local_interface_def_ = the_parent_.getContainer().
165              create_ext_local_interface(getId(), getName(), getVersion(),
166                               inherited_interfaces_.getInterfaceDefSeq());
167     }
168
169     // ==================================================================
170
//
171
// Public methods.
172
//
173
// ==================================================================
174

175     /**
176      * Obtain its InterfaceDef reference.
177      *
178      * @return The InterfaceDef associated with
179      * the local interface declaration.
180      */

181     public org.omg.CORBA.ExtInterfaceDef
182     getExtInterfaceDef()
183     {
184         return ext_local_interface_def_;
185     }
186
187     /**
188      * Obtain its InterfaceDef reference.
189      *
190      * @return The InterfaceDef associated with
191      * the local interface declaration.
192      */

193     public org.omg.CORBA.InterfaceDef JavaDoc
194     getInterfaceDef()
195     {
196         return ext_local_interface_def_;
197     }
198
199     /**
200      * Obtain its LocalInterfaceDef reference.
201      *
202      * @return The LocalInterfaceDef associated with the local
203      * interface declaration.
204      */

205     public org.omg.CORBA.ExtLocalInterfaceDef
206     getExtLocalInterfaceDef()
207     {
208         return ext_local_interface_def_;
209     }
210
211     /**
212      * Obtain its LocalInterfaceDef reference.
213      *
214      * @return The LocalInterfaceDef associated with the local
215      * interface declaration.
216      */

217     public org.omg.CORBA.LocalInterfaceDef
218     getLocalInterfaceDef()
219     {
220         return ext_local_interface_def_;
221     }
222
223     // ==================================================================
224
//
225
// Methods for OMG IDL org.objectweb.openccm.ast.api.WithDependencies
226
//
227
// ==================================================================
228

229     // ==================================================================
230
//
231
// Methods for OMG IDL org.objectweb.openccm.ast.api.Declaration
232
//
233
// ==================================================================
234

235     /**
236      * Obtain its DeclarationKind.
237      *
238      * @return The DeclarationKind of the object.
239      */

240     public long
241     getDeclKind()
242     {
243         return DeclarationKind.dk_local_interface;
244     }
245
246     // ==================================================================
247
//
248
// Methods for OMG IDL org.objectweb.openccm.ast.api.Scope
249
//
250
// ==================================================================
251

252     // ==================================================================
253
//
254
// Methods for OMG IDL org.objectweb.openccm.ast.api.ForwardScope
255
//
256
// ==================================================================
257

258     // ==================================================================
259
//
260
// Methods for OMG IDL org.objectweb.openccm.ast.api.TypeRef
261
//
262
// ==================================================================
263

264     /**
265      * Obtain its associated TypeKind.
266      *
267      * @return The associated TypeKind.
268      */

269     public TypeKind
270     getTypeKind()
271     {
272         return TypeKind.tk_local_interface;
273     }
274
275     // ==================================================================
276
//
277
// Methods for OMG IDL org.objectweb.openccm.ast.api.InterfaceDecl
278
//
279
// ==================================================================
280

281     // ==================================================================
282
//
283
// Methods for OMG IDL org.objectweb.openccm.ast.api.LocalInterfaceDecl
284
//
285
// ==================================================================
286

287     // ==================================================================
288
//
289
// Methods for interface IDLTypeWrapper
290
//
291
// ==================================================================
292

293     /**
294      * Obtain its IDLType reference.
295      *
296      * @return The IDLType associated with the local interface declaration.
297      */

298     public org.omg.CORBA.IDLType JavaDoc
299     getIDLType()
300     {
301         return ext_local_interface_def_;
302     }
303 }
304
Popular Tags