1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.core.composition.impl; |
7 | |
8 | import java.util.Map; |
9 | |
10 | import org.eclipse.emf.common.notify.Notification; |
11 | import org.eclipse.emf.common.util.BasicDiagnostic; |
12 | import org.eclipse.emf.common.util.Diagnostic; |
13 | import org.eclipse.emf.common.util.DiagnosticChain; |
14 | import org.eclipse.emf.ecore.EClass; |
15 | import org.eclipse.emf.ecore.InternalEObject; |
16 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
17 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
18 | import org.eclipse.emf.ecore.util.EObjectValidator; |
19 | import org.eclipse.ocl.ParserException; |
20 | import org.eclipse.ocl.ecore.Constraint; |
21 | import org.eclipse.ocl.ecore.OCL; |
22 | |
23 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyContext; |
24 | import de.uka.ipd.sdq.pcm.core.composition.CompositionPackage; |
25 | import de.uka.ipd.sdq.pcm.core.composition.RequiredDelegationConnector; |
26 | import de.uka.ipd.sdq.pcm.core.composition.util.CompositionValidator; |
27 | import de.uka.ipd.sdq.pcm.repository.OperationRequiredRole; |
28 | import de.uka.ipd.sdq.pcm.repository.impl.DelegationConnectorImpl; |
29 | |
30 | /** |
31 | * <!-- begin-user-doc --> |
32 | * An implementation of the model object '<em><b>Required Delegation Connector</b></em>'. |
33 | * <!-- end-user-doc --> |
34 | * <p> |
35 | * The following features are implemented: |
36 | * <ul> |
37 | * <li>{@link de.uka.ipd.sdq.pcm.core.composition.impl.RequiredDelegationConnectorImpl#getInnerRequiredRole_RequiredDelegationConnector <em>Inner Required Role Required Delegation Connector</em>}</li> |
38 | * <li>{@link de.uka.ipd.sdq.pcm.core.composition.impl.RequiredDelegationConnectorImpl#getOuterRequiredRole_RequiredDelegationConnector <em>Outer Required Role Required Delegation Connector</em>}</li> |
39 | * <li>{@link de.uka.ipd.sdq.pcm.core.composition.impl.RequiredDelegationConnectorImpl#getAssemblyContext_RequiredDelegationConnector <em>Assembly Context Required Delegation Connector</em>}</li> |
40 | * </ul> |
41 | * </p> |
42 | * |
43 | * @generated |
44 | */ |
45 | public class RequiredDelegationConnectorImpl extends DelegationConnectorImpl implements RequiredDelegationConnector { |
46 | /** |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @generated |
50 | */ |
51 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
52 | |
53 | /** |
54 | * The cached value of the '{@link #getInnerRequiredRole_RequiredDelegationConnector() <em>Inner Required Role Required Delegation Connector</em>}' reference. |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @see #getInnerRequiredRole_RequiredDelegationConnector() |
58 | * @generated |
59 | * @ordered |
60 | */ |
61 | protected OperationRequiredRole innerRequiredRole_RequiredDelegationConnector; |
62 | |
63 | /** |
64 | * The cached value of the '{@link #getOuterRequiredRole_RequiredDelegationConnector() <em>Outer Required Role Required Delegation Connector</em>}' reference. |
65 | * <!-- begin-user-doc --> |
66 | * <!-- end-user-doc --> |
67 | * @see #getOuterRequiredRole_RequiredDelegationConnector() |
68 | * @generated |
69 | * @ordered |
70 | */ |
71 | protected OperationRequiredRole outerRequiredRole_RequiredDelegationConnector; |
72 | |
73 | /** |
74 | * The cached value of the '{@link #getAssemblyContext_RequiredDelegationConnector() <em>Assembly Context Required Delegation Connector</em>}' reference. |
75 | * <!-- begin-user-doc --> |
76 | * <!-- end-user-doc --> |
77 | * @see #getAssemblyContext_RequiredDelegationConnector() |
78 | * @generated |
79 | * @ordered |
80 | */ |
81 | protected AssemblyContext assemblyContext_RequiredDelegationConnector; |
82 | |
83 | /** |
84 | * <!-- begin-user-doc --> |
85 | * <!-- end-user-doc --> |
86 | * @generated |
87 | */ |
88 | protected RequiredDelegationConnectorImpl() { |
89 | super(); |
90 | } |
91 | |
92 | /** |
93 | * <!-- begin-user-doc --> |
94 | * <!-- end-user-doc --> |
95 | * @generated |
96 | */ |
97 | @Override |
98 | protected EClass eStaticClass() { |
99 | return CompositionPackage.Literals.REQUIRED_DELEGATION_CONNECTOR; |
100 | } |
101 | |
102 | /** |
103 | * <!-- begin-user-doc --> |
104 | * <!-- end-user-doc --> |
105 | * @generated |
106 | */ |
107 | public OperationRequiredRole getInnerRequiredRole_RequiredDelegationConnector() { |
108 | if (innerRequiredRole_RequiredDelegationConnector != null && innerRequiredRole_RequiredDelegationConnector.eIsProxy()) { |
109 | InternalEObject oldInnerRequiredRole_RequiredDelegationConnector = (InternalEObject)innerRequiredRole_RequiredDelegationConnector; |
110 | innerRequiredRole_RequiredDelegationConnector = (OperationRequiredRole)eResolveProxy(oldInnerRequiredRole_RequiredDelegationConnector); |
111 | if (innerRequiredRole_RequiredDelegationConnector != oldInnerRequiredRole_RequiredDelegationConnector) { |
112 | if (eNotificationRequired()) |
113 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__INNER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR, oldInnerRequiredRole_RequiredDelegationConnector, innerRequiredRole_RequiredDelegationConnector)); |
114 | } |
115 | } |
116 | return innerRequiredRole_RequiredDelegationConnector; |
117 | } |
118 | |
119 | /** |
120 | * <!-- begin-user-doc --> |
121 | * <!-- end-user-doc --> |
122 | * @generated |
123 | */ |
124 | public OperationRequiredRole basicGetInnerRequiredRole_RequiredDelegationConnector() { |
125 | return innerRequiredRole_RequiredDelegationConnector; |
126 | } |
127 | |
128 | /** |
129 | * <!-- begin-user-doc --> |
130 | * <!-- end-user-doc --> |
131 | * @generated |
132 | */ |
133 | public void setInnerRequiredRole_RequiredDelegationConnector(OperationRequiredRole newInnerRequiredRole_RequiredDelegationConnector) { |
134 | OperationRequiredRole oldInnerRequiredRole_RequiredDelegationConnector = innerRequiredRole_RequiredDelegationConnector; |
135 | innerRequiredRole_RequiredDelegationConnector = newInnerRequiredRole_RequiredDelegationConnector; |
136 | if (eNotificationRequired()) |
137 | eNotify(new ENotificationImpl(this, Notification.SET, CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__INNER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR, oldInnerRequiredRole_RequiredDelegationConnector, innerRequiredRole_RequiredDelegationConnector)); |
138 | } |
139 | |
140 | /** |
141 | * <!-- begin-user-doc --> |
142 | * <!-- end-user-doc --> |
143 | * @generated |
144 | */ |
145 | public OperationRequiredRole getOuterRequiredRole_RequiredDelegationConnector() { |
146 | if (outerRequiredRole_RequiredDelegationConnector != null && outerRequiredRole_RequiredDelegationConnector.eIsProxy()) { |
147 | InternalEObject oldOuterRequiredRole_RequiredDelegationConnector = (InternalEObject)outerRequiredRole_RequiredDelegationConnector; |
148 | outerRequiredRole_RequiredDelegationConnector = (OperationRequiredRole)eResolveProxy(oldOuterRequiredRole_RequiredDelegationConnector); |
149 | if (outerRequiredRole_RequiredDelegationConnector != oldOuterRequiredRole_RequiredDelegationConnector) { |
150 | if (eNotificationRequired()) |
151 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__OUTER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR, oldOuterRequiredRole_RequiredDelegationConnector, outerRequiredRole_RequiredDelegationConnector)); |
152 | } |
153 | } |
154 | return outerRequiredRole_RequiredDelegationConnector; |
155 | } |
156 | |
157 | /** |
158 | * <!-- begin-user-doc --> |
159 | * <!-- end-user-doc --> |
160 | * @generated |
161 | */ |
162 | public OperationRequiredRole basicGetOuterRequiredRole_RequiredDelegationConnector() { |
163 | return outerRequiredRole_RequiredDelegationConnector; |
164 | } |
165 | |
166 | /** |
167 | * <!-- begin-user-doc --> |
168 | * <!-- end-user-doc --> |
169 | * @generated |
170 | */ |
171 | public void setOuterRequiredRole_RequiredDelegationConnector(OperationRequiredRole newOuterRequiredRole_RequiredDelegationConnector) { |
172 | OperationRequiredRole oldOuterRequiredRole_RequiredDelegationConnector = outerRequiredRole_RequiredDelegationConnector; |
173 | outerRequiredRole_RequiredDelegationConnector = newOuterRequiredRole_RequiredDelegationConnector; |
174 | if (eNotificationRequired()) |
175 | eNotify(new ENotificationImpl(this, Notification.SET, CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__OUTER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR, oldOuterRequiredRole_RequiredDelegationConnector, outerRequiredRole_RequiredDelegationConnector)); |
176 | } |
177 | |
178 | /** |
179 | * <!-- begin-user-doc --> |
180 | * <!-- end-user-doc --> |
181 | * @generated |
182 | */ |
183 | public AssemblyContext getAssemblyContext_RequiredDelegationConnector() { |
184 | if (assemblyContext_RequiredDelegationConnector != null && assemblyContext_RequiredDelegationConnector.eIsProxy()) { |
185 | InternalEObject oldAssemblyContext_RequiredDelegationConnector = (InternalEObject)assemblyContext_RequiredDelegationConnector; |
186 | assemblyContext_RequiredDelegationConnector = (AssemblyContext)eResolveProxy(oldAssemblyContext_RequiredDelegationConnector); |
187 | if (assemblyContext_RequiredDelegationConnector != oldAssemblyContext_RequiredDelegationConnector) { |
188 | if (eNotificationRequired()) |
189 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__ASSEMBLY_CONTEXT_REQUIRED_DELEGATION_CONNECTOR, oldAssemblyContext_RequiredDelegationConnector, assemblyContext_RequiredDelegationConnector)); |
190 | } |
191 | } |
192 | return assemblyContext_RequiredDelegationConnector; |
193 | } |
194 | |
195 | /** |
196 | * <!-- begin-user-doc --> |
197 | * <!-- end-user-doc --> |
198 | * @generated |
199 | */ |
200 | public AssemblyContext basicGetAssemblyContext_RequiredDelegationConnector() { |
201 | return assemblyContext_RequiredDelegationConnector; |
202 | } |
203 | |
204 | /** |
205 | * <!-- begin-user-doc --> |
206 | * <!-- end-user-doc --> |
207 | * @generated |
208 | */ |
209 | public void setAssemblyContext_RequiredDelegationConnector(AssemblyContext newAssemblyContext_RequiredDelegationConnector) { |
210 | AssemblyContext oldAssemblyContext_RequiredDelegationConnector = assemblyContext_RequiredDelegationConnector; |
211 | assemblyContext_RequiredDelegationConnector = newAssemblyContext_RequiredDelegationConnector; |
212 | if (eNotificationRequired()) |
213 | eNotify(new ENotificationImpl(this, Notification.SET, CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__ASSEMBLY_CONTEXT_REQUIRED_DELEGATION_CONNECTOR, oldAssemblyContext_RequiredDelegationConnector, assemblyContext_RequiredDelegationConnector)); |
214 | } |
215 | |
216 | /** |
217 | * The cached OCL expression body for the '{@link #RequiredDelegationConnectorandtheconnectedComponentmustbepartofthesamecompositestructure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Required Delegation Connectorandtheconnected Componentmustbepartofthesamecompositestructure</em>}' operation. |
218 | * <!-- begin-user-doc --> |
219 | * <!-- end-user-doc --> |
220 | * @see #RequiredDelegationConnectorandtheconnectedComponentmustbepartofthesamecompositestructure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
221 | * @generated |
222 | * @ordered |
223 | */ |
224 | protected static final String REQUIRED_DELEGATION_CONNECTORANDTHECONNECTED_COMPONENTMUSTBEPARTOFTHESAMECOMPOSITESTRUCTURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.parentStructure__Connector = self.assemblyContext_RequiredDelegationConnector.parentStructure__AssemblyContext"; |
225 | |
226 | /** |
227 | * The cached OCL invariant for the '{@link #RequiredDelegationConnectorandtheconnectedComponentmustbepartofthesamecompositestructure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Required Delegation Connectorandtheconnected Componentmustbepartofthesamecompositestructure</em>}' invariant operation. |
228 | * <!-- begin-user-doc --> |
229 | * <!-- end-user-doc --> |
230 | * @see #RequiredDelegationConnectorandtheconnectedComponentmustbepartofthesamecompositestructure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
231 | * @generated |
232 | * @ordered |
233 | */ |
234 | protected static Constraint REQUIRED_DELEGATION_CONNECTORANDTHECONNECTED_COMPONENTMUSTBEPARTOFTHESAMECOMPOSITESTRUCTURE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
235 | |
236 | /** |
237 | * <!-- begin-user-doc --> |
238 | * <!-- end-user-doc --> |
239 | * @generated |
240 | */ |
241 | public boolean RequiredDelegationConnectorandtheconnectedComponentmustbepartofthesamecompositestructure(DiagnosticChain diagnostics, Map<Object, Object> context) { |
242 | if (REQUIRED_DELEGATION_CONNECTORANDTHECONNECTED_COMPONENTMUSTBEPARTOFTHESAMECOMPOSITESTRUCTURE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
243 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
244 | helper.setContext(CompositionPackage.Literals.REQUIRED_DELEGATION_CONNECTOR); |
245 | try { |
246 | REQUIRED_DELEGATION_CONNECTORANDTHECONNECTED_COMPONENTMUSTBEPARTOFTHESAMECOMPOSITESTRUCTURE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(REQUIRED_DELEGATION_CONNECTORANDTHECONNECTED_COMPONENTMUSTBEPARTOFTHESAMECOMPOSITESTRUCTURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
247 | } |
248 | catch (ParserException pe) { |
249 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
250 | } |
251 | } |
252 | if (!EOCL_ENV.createQuery(REQUIRED_DELEGATION_CONNECTORANDTHECONNECTED_COMPONENTMUSTBEPARTOFTHESAMECOMPOSITESTRUCTURE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
253 | if (diagnostics != null) { |
254 | diagnostics.add |
255 | (new BasicDiagnostic |
256 | (Diagnostic.ERROR, |
257 | CompositionValidator.DIAGNOSTIC_SOURCE, |
258 | CompositionValidator.REQUIRED_DELEGATION_CONNECTOR__REQUIRED_DELEGATION_CONNECTORANDTHECONNECTED_COMPONENTMUSTBEPARTOFTHESAMECOMPOSITESTRUCTURE, |
259 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "RequiredDelegationConnectorandtheconnectedComponentmustbepartofthesamecompositestructure", EObjectValidator.getObjectLabel(this, context) }), |
260 | new Object [] { this })); |
261 | } |
262 | return false; |
263 | } |
264 | return true; |
265 | } |
266 | |
267 | /** |
268 | * The cached OCL expression body for the '{@link #ComponentOfAssemblyContextAndInnerRoleRequiringComponentNeedToBeTheSame(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Component Of Assembly Context And Inner Role Requiring Component Need To Be The Same</em>}' operation. |
269 | * <!-- begin-user-doc --> |
270 | * <!-- end-user-doc --> |
271 | * @see #ComponentOfAssemblyContextAndInnerRoleRequiringComponentNeedToBeTheSame(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
272 | * @generated |
273 | * @ordered |
274 | */ |
275 | protected static final String COMPONENT_OF_ASSEMBLY_CONTEXT_AND_INNER_ROLE_REQUIRING_COMPONENT_NEED_TO_BE_THE_SAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.innerRequiredRole_RequiredDelegationConnector.requiringEntity_RequiredRole = self.assemblyContext_RequiredDelegationConnector.encapsulatedComponent__AssemblyContext"; |
276 | |
277 | /** |
278 | * The cached OCL invariant for the '{@link #ComponentOfAssemblyContextAndInnerRoleRequiringComponentNeedToBeTheSame(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Component Of Assembly Context And Inner Role Requiring Component Need To Be The Same</em>}' invariant operation. |
279 | * <!-- begin-user-doc --> |
280 | * <!-- end-user-doc --> |
281 | * @see #ComponentOfAssemblyContextAndInnerRoleRequiringComponentNeedToBeTheSame(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
282 | * @generated |
283 | * @ordered |
284 | */ |
285 | protected static Constraint COMPONENT_OF_ASSEMBLY_CONTEXT_AND_INNER_ROLE_REQUIRING_COMPONENT_NEED_TO_BE_THE_SAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
286 | |
287 | /** |
288 | * <!-- begin-user-doc --> |
289 | * <!-- end-user-doc --> |
290 | * @generated |
291 | */ |
292 | public boolean ComponentOfAssemblyContextAndInnerRoleRequiringComponentNeedToBeTheSame(DiagnosticChain diagnostics, Map<Object, Object> context) { |
293 | if (COMPONENT_OF_ASSEMBLY_CONTEXT_AND_INNER_ROLE_REQUIRING_COMPONENT_NEED_TO_BE_THE_SAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
294 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
295 | helper.setContext(CompositionPackage.Literals.REQUIRED_DELEGATION_CONNECTOR); |
296 | try { |
297 | COMPONENT_OF_ASSEMBLY_CONTEXT_AND_INNER_ROLE_REQUIRING_COMPONENT_NEED_TO_BE_THE_SAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(COMPONENT_OF_ASSEMBLY_CONTEXT_AND_INNER_ROLE_REQUIRING_COMPONENT_NEED_TO_BE_THE_SAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
298 | } |
299 | catch (ParserException pe) { |
300 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
301 | } |
302 | } |
303 | if (!EOCL_ENV.createQuery(COMPONENT_OF_ASSEMBLY_CONTEXT_AND_INNER_ROLE_REQUIRING_COMPONENT_NEED_TO_BE_THE_SAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
304 | if (diagnostics != null) { |
305 | diagnostics.add |
306 | (new BasicDiagnostic |
307 | (Diagnostic.ERROR, |
308 | CompositionValidator.DIAGNOSTIC_SOURCE, |
309 | CompositionValidator.REQUIRED_DELEGATION_CONNECTOR__COMPONENT_OF_ASSEMBLY_CONTEXT_AND_INNER_ROLE_REQUIRING_COMPONENT_NEED_TO_BE_THE_SAME, |
310 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ComponentOfAssemblyContextAndInnerRoleRequiringComponentNeedToBeTheSame", EObjectValidator.getObjectLabel(this, context) }), |
311 | new Object [] { this })); |
312 | } |
313 | return false; |
314 | } |
315 | return true; |
316 | } |
317 | |
318 | /** |
319 | * The cached OCL expression body for the '{@link #RequiringEntityOfOuterRequiredRoleMustBeTheSameAsTheParentOfTheRequiredDelegationConnector(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Requiring Entity Of Outer Required Role Must Be The Same As The Parent Of The Required Delegation Connector</em>}' operation. |
320 | * <!-- begin-user-doc --> |
321 | * <!-- end-user-doc --> |
322 | * @see #RequiringEntityOfOuterRequiredRoleMustBeTheSameAsTheParentOfTheRequiredDelegationConnector(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
323 | * @generated |
324 | * @ordered |
325 | */ |
326 | protected static final String REQUIRING_ENTITY_OF_OUTER_REQUIRED_ROLE_MUST_BE_THE_SAME_AS_THE_PARENT_OF_THE_REQUIRED_DELEGATION_CONNECTOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.outerRequiredRole_RequiredDelegationConnector.requiringEntity_RequiredRole=self.parentStructure__Connector"; |
327 | |
328 | /** |
329 | * The cached OCL invariant for the '{@link #RequiringEntityOfOuterRequiredRoleMustBeTheSameAsTheParentOfTheRequiredDelegationConnector(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Requiring Entity Of Outer Required Role Must Be The Same As The Parent Of The Required Delegation Connector</em>}' invariant operation. |
330 | * <!-- begin-user-doc --> |
331 | * <!-- end-user-doc --> |
332 | * @see #RequiringEntityOfOuterRequiredRoleMustBeTheSameAsTheParentOfTheRequiredDelegationConnector(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
333 | * @generated |
334 | * @ordered |
335 | */ |
336 | protected static Constraint REQUIRING_ENTITY_OF_OUTER_REQUIRED_ROLE_MUST_BE_THE_SAME_AS_THE_PARENT_OF_THE_REQUIRED_DELEGATION_CONNECTOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
337 | |
338 | /** |
339 | * <!-- begin-user-doc --> |
340 | * <!-- end-user-doc --> |
341 | * @generated |
342 | */ |
343 | public boolean RequiringEntityOfOuterRequiredRoleMustBeTheSameAsTheParentOfTheRequiredDelegationConnector(DiagnosticChain diagnostics, Map<Object, Object> context) { |
344 | if (REQUIRING_ENTITY_OF_OUTER_REQUIRED_ROLE_MUST_BE_THE_SAME_AS_THE_PARENT_OF_THE_REQUIRED_DELEGATION_CONNECTOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
345 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
346 | helper.setContext(CompositionPackage.Literals.REQUIRED_DELEGATION_CONNECTOR); |
347 | try { |
348 | REQUIRING_ENTITY_OF_OUTER_REQUIRED_ROLE_MUST_BE_THE_SAME_AS_THE_PARENT_OF_THE_REQUIRED_DELEGATION_CONNECTOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(REQUIRING_ENTITY_OF_OUTER_REQUIRED_ROLE_MUST_BE_THE_SAME_AS_THE_PARENT_OF_THE_REQUIRED_DELEGATION_CONNECTOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
349 | } |
350 | catch (ParserException pe) { |
351 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
352 | } |
353 | } |
354 | if (!EOCL_ENV.createQuery(REQUIRING_ENTITY_OF_OUTER_REQUIRED_ROLE_MUST_BE_THE_SAME_AS_THE_PARENT_OF_THE_REQUIRED_DELEGATION_CONNECTOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
355 | if (diagnostics != null) { |
356 | diagnostics.add |
357 | (new BasicDiagnostic |
358 | (Diagnostic.ERROR, |
359 | CompositionValidator.DIAGNOSTIC_SOURCE, |
360 | CompositionValidator.REQUIRED_DELEGATION_CONNECTOR__REQUIRING_ENTITY_OF_OUTER_REQUIRED_ROLE_MUST_BE_THE_SAME_AS_THE_PARENT_OF_THE_REQUIRED_DELEGATION_CONNECTOR, |
361 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "RequiringEntityOfOuterRequiredRoleMustBeTheSameAsTheParentOfTheRequiredDelegationConnector", EObjectValidator.getObjectLabel(this, context) }), |
362 | new Object [] { this })); |
363 | } |
364 | return false; |
365 | } |
366 | return true; |
367 | } |
368 | |
369 | /** |
370 | * <!-- begin-user-doc --> |
371 | * <!-- end-user-doc --> |
372 | * @generated |
373 | */ |
374 | @Override |
375 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
376 | switch (featureID) { |
377 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__INNER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR: |
378 | if (resolve) return getInnerRequiredRole_RequiredDelegationConnector(); |
379 | return basicGetInnerRequiredRole_RequiredDelegationConnector(); |
380 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__OUTER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR: |
381 | if (resolve) return getOuterRequiredRole_RequiredDelegationConnector(); |
382 | return basicGetOuterRequiredRole_RequiredDelegationConnector(); |
383 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__ASSEMBLY_CONTEXT_REQUIRED_DELEGATION_CONNECTOR: |
384 | if (resolve) return getAssemblyContext_RequiredDelegationConnector(); |
385 | return basicGetAssemblyContext_RequiredDelegationConnector(); |
386 | } |
387 | return super.eGet(featureID, resolve, coreType); |
388 | } |
389 | |
390 | /** |
391 | * <!-- begin-user-doc --> |
392 | * <!-- end-user-doc --> |
393 | * @generated |
394 | */ |
395 | @Override |
396 | public void eSet(int featureID, Object newValue) { |
397 | switch (featureID) { |
398 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__INNER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR: |
399 | setInnerRequiredRole_RequiredDelegationConnector((OperationRequiredRole)newValue); |
400 | return; |
401 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__OUTER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR: |
402 | setOuterRequiredRole_RequiredDelegationConnector((OperationRequiredRole)newValue); |
403 | return; |
404 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__ASSEMBLY_CONTEXT_REQUIRED_DELEGATION_CONNECTOR: |
405 | setAssemblyContext_RequiredDelegationConnector((AssemblyContext)newValue); |
406 | return; |
407 | } |
408 | super.eSet(featureID, newValue); |
409 | } |
410 | |
411 | /** |
412 | * <!-- begin-user-doc --> |
413 | * <!-- end-user-doc --> |
414 | * @generated |
415 | */ |
416 | @Override |
417 | public void eUnset(int featureID) { |
418 | switch (featureID) { |
419 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__INNER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR: |
420 | setInnerRequiredRole_RequiredDelegationConnector((OperationRequiredRole)null); |
421 | return; |
422 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__OUTER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR: |
423 | setOuterRequiredRole_RequiredDelegationConnector((OperationRequiredRole)null); |
424 | return; |
425 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__ASSEMBLY_CONTEXT_REQUIRED_DELEGATION_CONNECTOR: |
426 | setAssemblyContext_RequiredDelegationConnector((AssemblyContext)null); |
427 | return; |
428 | } |
429 | super.eUnset(featureID); |
430 | } |
431 | |
432 | /** |
433 | * <!-- begin-user-doc --> |
434 | * <!-- end-user-doc --> |
435 | * @generated |
436 | */ |
437 | @Override |
438 | public boolean eIsSet(int featureID) { |
439 | switch (featureID) { |
440 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__INNER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR: |
441 | return innerRequiredRole_RequiredDelegationConnector != null; |
442 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__OUTER_REQUIRED_ROLE_REQUIRED_DELEGATION_CONNECTOR: |
443 | return outerRequiredRole_RequiredDelegationConnector != null; |
444 | case CompositionPackage.REQUIRED_DELEGATION_CONNECTOR__ASSEMBLY_CONTEXT_REQUIRED_DELEGATION_CONNECTOR: |
445 | return assemblyContext_RequiredDelegationConnector != null; |
446 | } |
447 | return super.eIsSet(featureID); |
448 | } |
449 | |
450 | /** |
451 | * The cached environment for evaluating OCL expressions. |
452 | * <!-- begin-user-doc --> |
453 | * <!-- end-user-doc --> |
454 | * @generated |
455 | * @ordered |
456 | */ |
457 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
458 | |
459 | } //RequiredDelegationConnectorImpl |