1 | /** |
---|
2 | * <copyright> |
---|
3 | * </copyright> |
---|
4 | * |
---|
5 | */ |
---|
6 | package org.modelica.xtext.modelicaBase.impl; |
---|
7 | |
---|
8 | import org.eclipse.emf.common.notify.Notification; |
---|
9 | import org.eclipse.emf.common.notify.NotificationChain; |
---|
10 | |
---|
11 | import org.eclipse.emf.ecore.EClass; |
---|
12 | import org.eclipse.emf.ecore.InternalEObject; |
---|
13 | |
---|
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
---|
15 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
---|
16 | |
---|
17 | import org.modelica.xtext.modelicaBase.Annotation; |
---|
18 | import org.modelica.xtext.modelicaBase.ExternalClause; |
---|
19 | import org.modelica.xtext.modelicaBase.ModelicaBasePackage; |
---|
20 | |
---|
21 | /** |
---|
22 | * <!-- begin-user-doc --> |
---|
23 | * An implementation of the model object '<em><b>External Clause</b></em>'. |
---|
24 | * <!-- end-user-doc --> |
---|
25 | * <p> |
---|
26 | * The following features are implemented: |
---|
27 | * <ul> |
---|
28 | * <li>{@link org.modelica.xtext.modelicaBase.impl.ExternalClauseImpl#getLanguageSpecification <em>Language Specification</em>}</li> |
---|
29 | * <li>{@link org.modelica.xtext.modelicaBase.impl.ExternalClauseImpl#getAnnotation <em>Annotation</em>}</li> |
---|
30 | * <li>{@link org.modelica.xtext.modelicaBase.impl.ExternalClauseImpl#getExtAnnotation <em>Ext Annotation</em>}</li> |
---|
31 | * </ul> |
---|
32 | * </p> |
---|
33 | * |
---|
34 | * @generated |
---|
35 | */ |
---|
36 | public class ExternalClauseImpl extends MinimalEObjectImpl.Container implements ExternalClause |
---|
37 | { |
---|
38 | /** |
---|
39 | * The default value of the '{@link #getLanguageSpecification() <em>Language Specification</em>}' attribute. |
---|
40 | * <!-- begin-user-doc --> |
---|
41 | * <!-- end-user-doc --> |
---|
42 | * @see #getLanguageSpecification() |
---|
43 | * @generated |
---|
44 | * @ordered |
---|
45 | */ |
---|
46 | protected static final String LANGUAGE_SPECIFICATION_EDEFAULT = null; |
---|
47 | |
---|
48 | /** |
---|
49 | * The cached value of the '{@link #getLanguageSpecification() <em>Language Specification</em>}' attribute. |
---|
50 | * <!-- begin-user-doc --> |
---|
51 | * <!-- end-user-doc --> |
---|
52 | * @see #getLanguageSpecification() |
---|
53 | * @generated |
---|
54 | * @ordered |
---|
55 | */ |
---|
56 | protected String languageSpecification = LANGUAGE_SPECIFICATION_EDEFAULT; |
---|
57 | |
---|
58 | /** |
---|
59 | * The cached value of the '{@link #getAnnotation() <em>Annotation</em>}' containment reference. |
---|
60 | * <!-- begin-user-doc --> |
---|
61 | * <!-- end-user-doc --> |
---|
62 | * @see #getAnnotation() |
---|
63 | * @generated |
---|
64 | * @ordered |
---|
65 | */ |
---|
66 | protected Annotation annotation; |
---|
67 | |
---|
68 | /** |
---|
69 | * The cached value of the '{@link #getExtAnnotation() <em>Ext Annotation</em>}' containment reference. |
---|
70 | * <!-- begin-user-doc --> |
---|
71 | * <!-- end-user-doc --> |
---|
72 | * @see #getExtAnnotation() |
---|
73 | * @generated |
---|
74 | * @ordered |
---|
75 | */ |
---|
76 | protected Annotation extAnnotation; |
---|
77 | |
---|
78 | /** |
---|
79 | * <!-- begin-user-doc --> |
---|
80 | * <!-- end-user-doc --> |
---|
81 | * @generated |
---|
82 | */ |
---|
83 | protected ExternalClauseImpl() |
---|
84 | { |
---|
85 | super(); |
---|
86 | } |
---|
87 | |
---|
88 | /** |
---|
89 | * <!-- begin-user-doc --> |
---|
90 | * <!-- end-user-doc --> |
---|
91 | * @generated |
---|
92 | */ |
---|
93 | @Override |
---|
94 | protected EClass eStaticClass() |
---|
95 | { |
---|
96 | return ModelicaBasePackage.Literals.EXTERNAL_CLAUSE; |
---|
97 | } |
---|
98 | |
---|
99 | /** |
---|
100 | * <!-- begin-user-doc --> |
---|
101 | * <!-- end-user-doc --> |
---|
102 | * @generated |
---|
103 | */ |
---|
104 | public String getLanguageSpecification() |
---|
105 | { |
---|
106 | return languageSpecification; |
---|
107 | } |
---|
108 | |
---|
109 | /** |
---|
110 | * <!-- begin-user-doc --> |
---|
111 | * <!-- end-user-doc --> |
---|
112 | * @generated |
---|
113 | */ |
---|
114 | public void setLanguageSpecification(String newLanguageSpecification) |
---|
115 | { |
---|
116 | String oldLanguageSpecification = languageSpecification; |
---|
117 | languageSpecification = newLanguageSpecification; |
---|
118 | if (eNotificationRequired()) |
---|
119 | eNotify(new ENotificationImpl(this, Notification.SET, ModelicaBasePackage.EXTERNAL_CLAUSE__LANGUAGE_SPECIFICATION, oldLanguageSpecification, languageSpecification)); |
---|
120 | } |
---|
121 | |
---|
122 | /** |
---|
123 | * <!-- begin-user-doc --> |
---|
124 | * <!-- end-user-doc --> |
---|
125 | * @generated |
---|
126 | */ |
---|
127 | public Annotation getAnnotation() |
---|
128 | { |
---|
129 | return annotation; |
---|
130 | } |
---|
131 | |
---|
132 | /** |
---|
133 | * <!-- begin-user-doc --> |
---|
134 | * <!-- end-user-doc --> |
---|
135 | * @generated |
---|
136 | */ |
---|
137 | public NotificationChain basicSetAnnotation(Annotation newAnnotation, NotificationChain msgs) |
---|
138 | { |
---|
139 | Annotation oldAnnotation = annotation; |
---|
140 | annotation = newAnnotation; |
---|
141 | if (eNotificationRequired()) |
---|
142 | { |
---|
143 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION, oldAnnotation, newAnnotation); |
---|
144 | if (msgs == null) msgs = notification; else msgs.add(notification); |
---|
145 | } |
---|
146 | return msgs; |
---|
147 | } |
---|
148 | |
---|
149 | /** |
---|
150 | * <!-- begin-user-doc --> |
---|
151 | * <!-- end-user-doc --> |
---|
152 | * @generated |
---|
153 | */ |
---|
154 | public void setAnnotation(Annotation newAnnotation) |
---|
155 | { |
---|
156 | if (newAnnotation != annotation) |
---|
157 | { |
---|
158 | NotificationChain msgs = null; |
---|
159 | if (annotation != null) |
---|
160 | msgs = ((InternalEObject)annotation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION, null, msgs); |
---|
161 | if (newAnnotation != null) |
---|
162 | msgs = ((InternalEObject)newAnnotation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION, null, msgs); |
---|
163 | msgs = basicSetAnnotation(newAnnotation, msgs); |
---|
164 | if (msgs != null) msgs.dispatch(); |
---|
165 | } |
---|
166 | else if (eNotificationRequired()) |
---|
167 | eNotify(new ENotificationImpl(this, Notification.SET, ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION, newAnnotation, newAnnotation)); |
---|
168 | } |
---|
169 | |
---|
170 | /** |
---|
171 | * <!-- begin-user-doc --> |
---|
172 | * <!-- end-user-doc --> |
---|
173 | * @generated |
---|
174 | */ |
---|
175 | public Annotation getExtAnnotation() |
---|
176 | { |
---|
177 | return extAnnotation; |
---|
178 | } |
---|
179 | |
---|
180 | /** |
---|
181 | * <!-- begin-user-doc --> |
---|
182 | * <!-- end-user-doc --> |
---|
183 | * @generated |
---|
184 | */ |
---|
185 | public NotificationChain basicSetExtAnnotation(Annotation newExtAnnotation, NotificationChain msgs) |
---|
186 | { |
---|
187 | Annotation oldExtAnnotation = extAnnotation; |
---|
188 | extAnnotation = newExtAnnotation; |
---|
189 | if (eNotificationRequired()) |
---|
190 | { |
---|
191 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION, oldExtAnnotation, newExtAnnotation); |
---|
192 | if (msgs == null) msgs = notification; else msgs.add(notification); |
---|
193 | } |
---|
194 | return msgs; |
---|
195 | } |
---|
196 | |
---|
197 | /** |
---|
198 | * <!-- begin-user-doc --> |
---|
199 | * <!-- end-user-doc --> |
---|
200 | * @generated |
---|
201 | */ |
---|
202 | public void setExtAnnotation(Annotation newExtAnnotation) |
---|
203 | { |
---|
204 | if (newExtAnnotation != extAnnotation) |
---|
205 | { |
---|
206 | NotificationChain msgs = null; |
---|
207 | if (extAnnotation != null) |
---|
208 | msgs = ((InternalEObject)extAnnotation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION, null, msgs); |
---|
209 | if (newExtAnnotation != null) |
---|
210 | msgs = ((InternalEObject)newExtAnnotation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION, null, msgs); |
---|
211 | msgs = basicSetExtAnnotation(newExtAnnotation, msgs); |
---|
212 | if (msgs != null) msgs.dispatch(); |
---|
213 | } |
---|
214 | else if (eNotificationRequired()) |
---|
215 | eNotify(new ENotificationImpl(this, Notification.SET, ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION, newExtAnnotation, newExtAnnotation)); |
---|
216 | } |
---|
217 | |
---|
218 | /** |
---|
219 | * <!-- begin-user-doc --> |
---|
220 | * <!-- end-user-doc --> |
---|
221 | * @generated |
---|
222 | */ |
---|
223 | @Override |
---|
224 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
---|
225 | { |
---|
226 | switch (featureID) |
---|
227 | { |
---|
228 | case ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION: |
---|
229 | return basicSetAnnotation(null, msgs); |
---|
230 | case ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION: |
---|
231 | return basicSetExtAnnotation(null, msgs); |
---|
232 | } |
---|
233 | return super.eInverseRemove(otherEnd, featureID, msgs); |
---|
234 | } |
---|
235 | |
---|
236 | /** |
---|
237 | * <!-- begin-user-doc --> |
---|
238 | * <!-- end-user-doc --> |
---|
239 | * @generated |
---|
240 | */ |
---|
241 | @Override |
---|
242 | public Object eGet(int featureID, boolean resolve, boolean coreType) |
---|
243 | { |
---|
244 | switch (featureID) |
---|
245 | { |
---|
246 | case ModelicaBasePackage.EXTERNAL_CLAUSE__LANGUAGE_SPECIFICATION: |
---|
247 | return getLanguageSpecification(); |
---|
248 | case ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION: |
---|
249 | return getAnnotation(); |
---|
250 | case ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION: |
---|
251 | return getExtAnnotation(); |
---|
252 | } |
---|
253 | return super.eGet(featureID, resolve, coreType); |
---|
254 | } |
---|
255 | |
---|
256 | /** |
---|
257 | * <!-- begin-user-doc --> |
---|
258 | * <!-- end-user-doc --> |
---|
259 | * @generated |
---|
260 | */ |
---|
261 | @Override |
---|
262 | public void eSet(int featureID, Object newValue) |
---|
263 | { |
---|
264 | switch (featureID) |
---|
265 | { |
---|
266 | case ModelicaBasePackage.EXTERNAL_CLAUSE__LANGUAGE_SPECIFICATION: |
---|
267 | setLanguageSpecification((String)newValue); |
---|
268 | return; |
---|
269 | case ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION: |
---|
270 | setAnnotation((Annotation)newValue); |
---|
271 | return; |
---|
272 | case ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION: |
---|
273 | setExtAnnotation((Annotation)newValue); |
---|
274 | return; |
---|
275 | } |
---|
276 | super.eSet(featureID, newValue); |
---|
277 | } |
---|
278 | |
---|
279 | /** |
---|
280 | * <!-- begin-user-doc --> |
---|
281 | * <!-- end-user-doc --> |
---|
282 | * @generated |
---|
283 | */ |
---|
284 | @Override |
---|
285 | public void eUnset(int featureID) |
---|
286 | { |
---|
287 | switch (featureID) |
---|
288 | { |
---|
289 | case ModelicaBasePackage.EXTERNAL_CLAUSE__LANGUAGE_SPECIFICATION: |
---|
290 | setLanguageSpecification(LANGUAGE_SPECIFICATION_EDEFAULT); |
---|
291 | return; |
---|
292 | case ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION: |
---|
293 | setAnnotation((Annotation)null); |
---|
294 | return; |
---|
295 | case ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION: |
---|
296 | setExtAnnotation((Annotation)null); |
---|
297 | return; |
---|
298 | } |
---|
299 | super.eUnset(featureID); |
---|
300 | } |
---|
301 | |
---|
302 | /** |
---|
303 | * <!-- begin-user-doc --> |
---|
304 | * <!-- end-user-doc --> |
---|
305 | * @generated |
---|
306 | */ |
---|
307 | @Override |
---|
308 | public boolean eIsSet(int featureID) |
---|
309 | { |
---|
310 | switch (featureID) |
---|
311 | { |
---|
312 | case ModelicaBasePackage.EXTERNAL_CLAUSE__LANGUAGE_SPECIFICATION: |
---|
313 | return LANGUAGE_SPECIFICATION_EDEFAULT == null ? languageSpecification != null : !LANGUAGE_SPECIFICATION_EDEFAULT.equals(languageSpecification); |
---|
314 | case ModelicaBasePackage.EXTERNAL_CLAUSE__ANNOTATION: |
---|
315 | return annotation != null; |
---|
316 | case ModelicaBasePackage.EXTERNAL_CLAUSE__EXT_ANNOTATION: |
---|
317 | return extAnnotation != null; |
---|
318 | } |
---|
319 | return super.eIsSet(featureID); |
---|
320 | } |
---|
321 | |
---|
322 | /** |
---|
323 | * <!-- begin-user-doc --> |
---|
324 | * <!-- end-user-doc --> |
---|
325 | * @generated |
---|
326 | */ |
---|
327 | @Override |
---|
328 | public String toString() |
---|
329 | { |
---|
330 | if (eIsProxy()) return super.toString(); |
---|
331 | |
---|
332 | StringBuffer result = new StringBuffer(super.toString()); |
---|
333 | result.append(" (languageSpecification: "); |
---|
334 | result.append(languageSpecification); |
---|
335 | result.append(')'); |
---|
336 | return result.toString(); |
---|
337 | } |
---|
338 | |
---|
339 | } //ExternalClauseImpl |
---|