KickJava   Java API By Example, From Geeks To Geeks.

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


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 TypeRef. */
30 import org.objectweb.openccm.ast.api.TypeRef;
31
32 /**
33  * DeclarationWithTypeRefImpl is a wrapper class for
34  * Declaration with an associated type.
35  *
36  *
37  * Inherits from:
38  *
39  * - DeclarationImpl as they are IDL declarations,
40  *
41  * - DeclarationWithTypeRef: OMG IDL for Declaration with an associated type.
42  *
43  *
44  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
45  *
46  * @version 0.1
47  */

48
49 abstract public
50 class DeclarationWithTypeRefImpl
51 extends DeclarationImpl
52 implements org.objectweb.openccm.ast.api.DeclarationWithTypeRef
53 {
54     // ==================================================================
55
//
56
// Internal state.
57
//
58
// ==================================================================
59

60     /** The associated TypeRef. */
61     protected TypeRef type_;
62
63     // ==================================================================
64
//
65
// Constructor.
66
//
67
// ==================================================================
68

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

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

92     /**
93      * Obtain the associated CORBA::IDLType reference.
94      *
95      * @return The associated CORBA::IDLType reference.
96      */

97     protected org.omg.CORBA.IDLType JavaDoc
98     getIDLType()
99     {
100         if(type_ == null)
101             return null;
102
103         return ((IDLTypeWrapper)type_).getIDLType();
104     }
105
106     // ==================================================================
107
//
108
// Public methods.
109
//
110
// ==================================================================
111

112     // ==================================================================
113
//
114
// Methods for OMG IDL org.objectweb.openccm.ast.api.DeclarationWithTypeRef
115
//
116
// ==================================================================
117

118     /**
119      * Set the associated TypeRef reference.
120      *
121      * @param type The associated TypeRef reference.
122      */

123     public void
124     setType(TypeRef type)
125     {
126        type_ = type;
127     }
128
129     /**
130      * Obtain the associated TypeRef reference.
131      *
132      * @return The associated TypeRef reference.
133      */

134     public TypeRef
135     getType()
136     {
137         return type_;
138     }
139 }
140
Popular Tags