KickJava   Java API By Example, From Geeks To Geeks.

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


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 // Package dependencies
30
import org.objectweb.openccm.ast.api.TypeKind;
31 import org.objectweb.openccm.ast.api.DeclarationKind;
32 import org.omg.CORBA.InterfaceDef JavaDoc;
33 import org.omg.CORBA.ExtInterfaceDef;
34 import org.omg.CORBA.AbstractInterfaceDef;
35 import org.omg.CORBA.ExtAbstractInterfaceDef;
36 import org.omg.CORBA.ExtAbstractInterfaceDefHelper;
37
38 /**
39  * AbstractInterfaceDeclImpl is a wrapper class for
40  * IDL abstract 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 AbstractInterfaceDeclImpl
52        extends InterfaceDeclImpl
53        implements org.objectweb.openccm.ast.api.AbstractInterfaceDecl
54 {
55     // ==================================================================
56
//
57
// Internal state.
58
//
59
// ==================================================================
60

61     /** Reference to the CORBA 3.0 AbstractInterfaceDef. */
62     private ExtAbstractInterfaceDef ext_abstract_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 declaration.
75      */

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

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

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

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

117     protected void
118     loadAsMapping(org.omg.CORBA.Contained JavaDoc contained)
119     {
120         ext_abstract_interface_def_ =
121              ExtAbstractInterfaceDefHelper.narrow(contained);
122         super.load(contained);
123     }
124
125     /**
126      * Obtain its CORBA 3.0 Contained reference.
127      *
128      * @return The Contained object associated with the abstract
129      * interface declaration.
130      */

131     protected org.omg.CORBA.Contained JavaDoc
132     getContained()
133     {
134        return ext_abstract_interface_def_;
135     }
136
137     // ==================================================================
138
//
139
// Internal methods for ScopeImpl.
140
//
141
// ==================================================================
142

143     /**
144      * Obtain its CORBA 3.0 Container reference.
145      *
146      * @return The Container object associated with the abstract
147      * interface declaration.
148      */

149     protected org.omg.CORBA.Container JavaDoc
150     getContainer()
151     {
152        return ext_abstract_interface_def_;
153     }
154
155     // ==================================================================
156
//
157
// Internal methods for ForwardScopeImpl.
158
//
159
// ==================================================================
160

161     // ==================================================================
162
//
163
// Internal methods for ForwardScopeIDLImpl.
164
//
165
// ==================================================================
166

167     /**
168      * Create the container object.
169      */

170     protected void
171     createContainer()
172     {
173         AbstractInterfaceDef[] itfs =
174             new AbstractInterfaceDef[inherited_interfaces_.getSize()];
175
176         for(int i=0; i<itfs.length; i++)
177             itfs[i] = ((AbstractInterfaceDeclImpl)
178                       (inherited_interfaces_.get(i))).
179                       getExtAbstractInterfaceDef();
180
181         ext_abstract_interface_def_ = the_parent_.getContainer().
182              create_ext_abstract_interface(getId(), getName(),
183                                            getVersion(), itfs);
184     }
185
186     // ==================================================================
187
//
188
// Public methods.
189
//
190
// ==================================================================
191

192     /**
193      * Obtain its InterfaceDef reference.
194      *
195      * @return The InterfaceDef object associated with the abstract
196      * interface declaration.
197      */

198     public ExtInterfaceDef
199     getExtInterfaceDef()
200     {
201         return ext_abstract_interface_def_;
202     }
203
204     /**
205      * Obtain its InterfaceDef reference.
206      *
207      * @return The InterfaceDef object associated with the abstract
208      * interface declaration.
209      */

210     public InterfaceDef JavaDoc
211     getInterfaceDef()
212     {
213         return ext_abstract_interface_def_;
214     }
215
216     /**
217      * Obtain its AbstractInterfaceDef reference.
218      *
219      * @return The AbstractInterfaceDef object associated with
220      * the abstract interface declaration.
221      */

222     public ExtAbstractInterfaceDef
223     getExtAbstractInterfaceDef()
224     {
225         return ext_abstract_interface_def_;
226     }
227
228     /**
229      * Obtain its AbstractInterfaceDef reference.
230      *
231      * @return The AbstractInterfaceDef object associated with
232      * the abstract interface declaration.
233      */

234     public AbstractInterfaceDef
235     getAbstractInterfaceDef()
236     {
237         return ext_abstract_interface_def_;
238     }
239
240     // ==================================================================
241
//
242
// Methods for OMG IDL org.objectweb.openccm.ast.api.WithDependencies
243
//
244
// ==================================================================
245

246     // ==================================================================
247
//
248
// Methods for OMG IDL org.objectweb.openccm.ast.api.Declaration
249
//
250
// ==================================================================
251

252     /**
253      * Obtain its DeclarationKind.
254      *
255      * @return The DeclarationKind of the object.
256      */

257     public long
258     getDeclKind()
259     {
260         return DeclarationKind.dk_abstract_interface;
261     }
262
263     // ==================================================================
264
//
265
// Methods for OMG IDL org.objectweb.openccm.ast.api.Scope
266
//
267
// ==================================================================
268

269     // ==================================================================
270
//
271
// Methods for OMG IDL org.objectweb.openccm.ast.api.ForwardScope
272
//
273
// ==================================================================
274

275     // ==================================================================
276
//
277
// Methods for OMG IDL org.objectweb.openccm.ast.api.TypeRef
278
//
279
// ==================================================================
280

281     /**
282      * Obtain its associated TypeKind.
283      *
284      * @return The associated TypeKind.
285      */

286     public TypeKind
287     getTypeKind()
288     {
289         return TypeKind.tk_abstract_interface;
290     }
291
292     // ==================================================================
293
//
294
// Methods for OMG IDL org.objectweb.openccm.ast.api.InterfaceDecl
295
//
296
// ==================================================================
297

298     // ==================================================================
299
//
300
// Methods for OMG IDL org.objectweb.openccm.ast.api.AbstractInterfaceDecl
301
//
302
// ==================================================================
303

304     // ==================================================================
305
//
306
// Methods for interface IDLTypeWrapper
307
//
308
// ==================================================================
309

310     /**
311      * Obtain its IDLType reference.
312      *
313      * @return The IDLType associated with the abstract interface declaration.
314      */

315     public org.omg.CORBA.IDLType JavaDoc
316     getIDLType()
317     {
318         return ext_abstract_interface_def_;
319     }
320 }
321
Popular Tags