KickJava   Java API By Example, From Geeks To Geeks.

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


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 /** To access AST AnyValue. */
30 import org.objectweb.openccm.ast.api.AnyValue;
31
32 /** To access AST DeclarationKind. */
33 import org.objectweb.openccm.ast.api.DeclarationKind;
34
35 /**
36  * DeclarationWithAnyValueImpl is a wrapper class for
37  * Declaration with an associated any value.
38  *
39  *
40  * Inherits from:
41  *
42  * - DeclarationImpl as they are IDL declarations,
43  *
44  * - DeclarationWithAnyValue: OMG IDL for Declaration with
45  * an associated any value.
46  *
47  *
48  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
49  * <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
50  *
51  * @version 0.3
52  */

53
54 public class DeclarationWithAnyValueImpl
55        extends DeclarationImpl
56        implements org.objectweb.openccm.ast.api.DeclarationWithAnyValue
57 {
58     // ==================================================================
59
//
60
// Internal state.
61
//
62
// ==================================================================
63

64     /** The value of the constant. */
65     private AnyValue value_;
66
67     // ==================================================================
68
//
69
// Constructor.
70
//
71
// ==================================================================
72

73     /**
74      * The constructor with the parent scope.
75      *
76      * @param rep The repository of the declaration.
77      * @param parent The parent scope of the declaration.
78      */

79     protected
80     DeclarationWithAnyValueImpl(Repository rep,
81                                 ScopeImpl parent)
82     {
83         // Call the DeclarationImpl constructor.
84
super(rep, parent);
85
86         // init internal state.
87
value_ = null;
88     }
89
90     // ==================================================================
91
//
92
// Internal methods.
93
//
94
// ==================================================================
95

96     // ==================================================================
97
//
98
// Methods for the inherited DeclarationImpl class.
99
//
100
// ==================================================================
101

102     /**
103      * Obtain its CORBA 3.0 Contained reference.
104      *
105      * @return The Contained object associated with the any declaration.
106      */

107     protected org.omg.CORBA.Contained JavaDoc
108     getContained()
109     {
110        return null;
111     }
112
113     // ==================================================================
114
//
115
// Public methods.
116
//
117
// ==================================================================
118

119     // ==================================================================
120
//
121
// Methods for OMG IDL org.objectweb.openccm.ast.api.Declaration
122
//
123
// ==================================================================
124

125     /**
126      * Obtain its DeclarationKind.
127      *
128      * This method is implemented into DeclarationImpl subclasses.
129      *
130      * @return The DeclarationKind of the object.
131      */

132     public long
133     getDeclKind()
134     {
135         return DeclarationKind.dk_null;
136     }
137
138     // ==================================================================
139
//
140
// Methods for OMG IDL org.objectweb.openccm.ast.api.DeclarationWithAnyValue
141
//
142
// ==================================================================
143

144     /**
145      * Set the associated AnyValue.
146      *
147      * @param value The AnyValue to set.
148      */

149     public void
150     setAnyValue(AnyValue value)
151     {
152         value_ = value;
153     }
154
155     /**
156      * Obtain the associated AnyValue.
157      *
158      * @return The associated AnyValue.
159      */

160     public AnyValue
161     getAnyValue()
162     {
163         return value_;
164     }
165 }
166
Popular Tags