| 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.AssemblyConnector; |
| 24 | import de.uka.ipd.sdq.pcm.core.composition.AssemblyContext; |
| 25 | import de.uka.ipd.sdq.pcm.core.composition.CompositionPackage; |
| 26 | import de.uka.ipd.sdq.pcm.core.composition.util.CompositionValidator; |
| 27 | import de.uka.ipd.sdq.pcm.repository.OperationProvidedRole; |
| 28 | import de.uka.ipd.sdq.pcm.repository.OperationRequiredRole; |
| 29 | |
| 30 | /** |
| 31 | * <!-- begin-user-doc --> |
| 32 | * An implementation of the model object '<em><b>Assembly 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.AssemblyConnectorImpl#getRequiringAssemblyContext_AssemblyConnector <em>Requiring Assembly Context Assembly Connector</em>}</li> |
| 38 | * <li>{@link de.uka.ipd.sdq.pcm.core.composition.impl.AssemblyConnectorImpl#getProvidingAssemblyContext_AssemblyConnector <em>Providing Assembly Context Assembly Connector</em>}</li> |
| 39 | * <li>{@link de.uka.ipd.sdq.pcm.core.composition.impl.AssemblyConnectorImpl#getProvidedRole_AssemblyConnector <em>Provided Role Assembly Connector</em>}</li> |
| 40 | * <li>{@link de.uka.ipd.sdq.pcm.core.composition.impl.AssemblyConnectorImpl#getRequiredRole_AssemblyConnector <em>Required Role Assembly Connector</em>}</li> |
| 41 | * </ul> |
| 42 | * </p> |
| 43 | * |
| 44 | * @generated |
| 45 | */ |
| 46 | public class AssemblyConnectorImpl extends ConnectorImpl implements AssemblyConnector { |
| 47 | /** |
| 48 | * <!-- begin-user-doc --> |
| 49 | * <!-- end-user-doc --> |
| 50 | * @generated |
| 51 | */ |
| 52 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 53 | |
| 54 | /** |
| 55 | * The cached value of the '{@link #getRequiringAssemblyContext_AssemblyConnector() <em>Requiring Assembly Context Assembly Connector</em>}' reference. |
| 56 | * <!-- begin-user-doc --> |
| 57 | * <!-- end-user-doc --> |
| 58 | * @see #getRequiringAssemblyContext_AssemblyConnector() |
| 59 | * @generated |
| 60 | * @ordered |
| 61 | */ |
| 62 | protected AssemblyContext requiringAssemblyContext_AssemblyConnector; |
| 63 | |
| 64 | /** |
| 65 | * The cached value of the '{@link #getProvidingAssemblyContext_AssemblyConnector() <em>Providing Assembly Context Assembly Connector</em>}' reference. |
| 66 | * <!-- begin-user-doc --> |
| 67 | * <!-- end-user-doc --> |
| 68 | * @see #getProvidingAssemblyContext_AssemblyConnector() |
| 69 | * @generated |
| 70 | * @ordered |
| 71 | */ |
| 72 | protected AssemblyContext providingAssemblyContext_AssemblyConnector; |
| 73 | |
| 74 | /** |
| 75 | * The cached value of the '{@link #getProvidedRole_AssemblyConnector() <em>Provided Role Assembly Connector</em>}' reference. |
| 76 | * <!-- begin-user-doc --> |
| 77 | * <!-- end-user-doc --> |
| 78 | * @see #getProvidedRole_AssemblyConnector() |
| 79 | * @generated |
| 80 | * @ordered |
| 81 | */ |
| 82 | protected OperationProvidedRole providedRole_AssemblyConnector; |
| 83 | |
| 84 | /** |
| 85 | * The cached value of the '{@link #getRequiredRole_AssemblyConnector() <em>Required Role Assembly Connector</em>}' reference. |
| 86 | * <!-- begin-user-doc --> |
| 87 | * <!-- end-user-doc --> |
| 88 | * @see #getRequiredRole_AssemblyConnector() |
| 89 | * @generated |
| 90 | * @ordered |
| 91 | */ |
| 92 | protected OperationRequiredRole requiredRole_AssemblyConnector; |
| 93 | |
| 94 | /** |
| 95 | * <!-- begin-user-doc --> |
| 96 | * <!-- end-user-doc --> |
| 97 | * @generated |
| 98 | */ |
| 99 | protected AssemblyConnectorImpl() { |
| 100 | super(); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * <!-- begin-user-doc --> |
| 105 | * <!-- end-user-doc --> |
| 106 | * @generated |
| 107 | */ |
| 108 | @Override |
| 109 | protected EClass eStaticClass() { |
| 110 | return CompositionPackage.Literals.ASSEMBLY_CONNECTOR; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * <!-- begin-user-doc --> |
| 115 | * <!-- end-user-doc --> |
| 116 | * @generated |
| 117 | */ |
| 118 | public AssemblyContext getRequiringAssemblyContext_AssemblyConnector() { |
| 119 | if (requiringAssemblyContext_AssemblyConnector != null && requiringAssemblyContext_AssemblyConnector.eIsProxy()) { |
| 120 | InternalEObject oldRequiringAssemblyContext_AssemblyConnector = (InternalEObject)requiringAssemblyContext_AssemblyConnector; |
| 121 | requiringAssemblyContext_AssemblyConnector = (AssemblyContext)eResolveProxy(oldRequiringAssemblyContext_AssemblyConnector); |
| 122 | if (requiringAssemblyContext_AssemblyConnector != oldRequiringAssemblyContext_AssemblyConnector) { |
| 123 | if (eNotificationRequired()) |
| 124 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR, oldRequiringAssemblyContext_AssemblyConnector, requiringAssemblyContext_AssemblyConnector)); |
| 125 | } |
| 126 | } |
| 127 | return requiringAssemblyContext_AssemblyConnector; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * <!-- begin-user-doc --> |
| 132 | * <!-- end-user-doc --> |
| 133 | * @generated |
| 134 | */ |
| 135 | public AssemblyContext basicGetRequiringAssemblyContext_AssemblyConnector() { |
| 136 | return requiringAssemblyContext_AssemblyConnector; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * <!-- begin-user-doc --> |
| 141 | * <!-- end-user-doc --> |
| 142 | * @generated |
| 143 | */ |
| 144 | public void setRequiringAssemblyContext_AssemblyConnector(AssemblyContext newRequiringAssemblyContext_AssemblyConnector) { |
| 145 | AssemblyContext oldRequiringAssemblyContext_AssemblyConnector = requiringAssemblyContext_AssemblyConnector; |
| 146 | requiringAssemblyContext_AssemblyConnector = newRequiringAssemblyContext_AssemblyConnector; |
| 147 | if (eNotificationRequired()) |
| 148 | eNotify(new ENotificationImpl(this, Notification.SET, CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR, oldRequiringAssemblyContext_AssemblyConnector, requiringAssemblyContext_AssemblyConnector)); |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * <!-- begin-user-doc --> |
| 153 | * <!-- end-user-doc --> |
| 154 | * @generated |
| 155 | */ |
| 156 | public AssemblyContext getProvidingAssemblyContext_AssemblyConnector() { |
| 157 | if (providingAssemblyContext_AssemblyConnector != null && providingAssemblyContext_AssemblyConnector.eIsProxy()) { |
| 158 | InternalEObject oldProvidingAssemblyContext_AssemblyConnector = (InternalEObject)providingAssemblyContext_AssemblyConnector; |
| 159 | providingAssemblyContext_AssemblyConnector = (AssemblyContext)eResolveProxy(oldProvidingAssemblyContext_AssemblyConnector); |
| 160 | if (providingAssemblyContext_AssemblyConnector != oldProvidingAssemblyContext_AssemblyConnector) { |
| 161 | if (eNotificationRequired()) |
| 162 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR, oldProvidingAssemblyContext_AssemblyConnector, providingAssemblyContext_AssemblyConnector)); |
| 163 | } |
| 164 | } |
| 165 | return providingAssemblyContext_AssemblyConnector; |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * <!-- begin-user-doc --> |
| 170 | * <!-- end-user-doc --> |
| 171 | * @generated |
| 172 | */ |
| 173 | public AssemblyContext basicGetProvidingAssemblyContext_AssemblyConnector() { |
| 174 | return providingAssemblyContext_AssemblyConnector; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * <!-- begin-user-doc --> |
| 179 | * <!-- end-user-doc --> |
| 180 | * @generated |
| 181 | */ |
| 182 | public void setProvidingAssemblyContext_AssemblyConnector(AssemblyContext newProvidingAssemblyContext_AssemblyConnector) { |
| 183 | AssemblyContext oldProvidingAssemblyContext_AssemblyConnector = providingAssemblyContext_AssemblyConnector; |
| 184 | providingAssemblyContext_AssemblyConnector = newProvidingAssemblyContext_AssemblyConnector; |
| 185 | if (eNotificationRequired()) |
| 186 | eNotify(new ENotificationImpl(this, Notification.SET, CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR, oldProvidingAssemblyContext_AssemblyConnector, providingAssemblyContext_AssemblyConnector)); |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * <!-- begin-user-doc --> |
| 191 | * <!-- end-user-doc --> |
| 192 | * @generated |
| 193 | */ |
| 194 | public OperationProvidedRole getProvidedRole_AssemblyConnector() { |
| 195 | if (providedRole_AssemblyConnector != null && providedRole_AssemblyConnector.eIsProxy()) { |
| 196 | InternalEObject oldProvidedRole_AssemblyConnector = (InternalEObject)providedRole_AssemblyConnector; |
| 197 | providedRole_AssemblyConnector = (OperationProvidedRole)eResolveProxy(oldProvidedRole_AssemblyConnector); |
| 198 | if (providedRole_AssemblyConnector != oldProvidedRole_AssemblyConnector) { |
| 199 | if (eNotificationRequired()) |
| 200 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDED_ROLE_ASSEMBLY_CONNECTOR, oldProvidedRole_AssemblyConnector, providedRole_AssemblyConnector)); |
| 201 | } |
| 202 | } |
| 203 | return providedRole_AssemblyConnector; |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * <!-- begin-user-doc --> |
| 208 | * <!-- end-user-doc --> |
| 209 | * @generated |
| 210 | */ |
| 211 | public OperationProvidedRole basicGetProvidedRole_AssemblyConnector() { |
| 212 | return providedRole_AssemblyConnector; |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * <!-- begin-user-doc --> |
| 217 | * <!-- end-user-doc --> |
| 218 | * @generated |
| 219 | */ |
| 220 | public void setProvidedRole_AssemblyConnector(OperationProvidedRole newProvidedRole_AssemblyConnector) { |
| 221 | OperationProvidedRole oldProvidedRole_AssemblyConnector = providedRole_AssemblyConnector; |
| 222 | providedRole_AssemblyConnector = newProvidedRole_AssemblyConnector; |
| 223 | if (eNotificationRequired()) |
| 224 | eNotify(new ENotificationImpl(this, Notification.SET, CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDED_ROLE_ASSEMBLY_CONNECTOR, oldProvidedRole_AssemblyConnector, providedRole_AssemblyConnector)); |
| 225 | } |
| 226 | |
| 227 | /** |
| 228 | * <!-- begin-user-doc --> |
| 229 | * <!-- end-user-doc --> |
| 230 | * @generated |
| 231 | */ |
| 232 | public OperationRequiredRole getRequiredRole_AssemblyConnector() { |
| 233 | if (requiredRole_AssemblyConnector != null && requiredRole_AssemblyConnector.eIsProxy()) { |
| 234 | InternalEObject oldRequiredRole_AssemblyConnector = (InternalEObject)requiredRole_AssemblyConnector; |
| 235 | requiredRole_AssemblyConnector = (OperationRequiredRole)eResolveProxy(oldRequiredRole_AssemblyConnector); |
| 236 | if (requiredRole_AssemblyConnector != oldRequiredRole_AssemblyConnector) { |
| 237 | if (eNotificationRequired()) |
| 238 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRED_ROLE_ASSEMBLY_CONNECTOR, oldRequiredRole_AssemblyConnector, requiredRole_AssemblyConnector)); |
| 239 | } |
| 240 | } |
| 241 | return requiredRole_AssemblyConnector; |
| 242 | } |
| 243 | |
| 244 | /** |
| 245 | * <!-- begin-user-doc --> |
| 246 | * <!-- end-user-doc --> |
| 247 | * @generated |
| 248 | */ |
| 249 | public OperationRequiredRole basicGetRequiredRole_AssemblyConnector() { |
| 250 | return requiredRole_AssemblyConnector; |
| 251 | } |
| 252 | |
| 253 | /** |
| 254 | * <!-- begin-user-doc --> |
| 255 | * <!-- end-user-doc --> |
| 256 | * @generated |
| 257 | */ |
| 258 | public void setRequiredRole_AssemblyConnector(OperationRequiredRole newRequiredRole_AssemblyConnector) { |
| 259 | OperationRequiredRole oldRequiredRole_AssemblyConnector = requiredRole_AssemblyConnector; |
| 260 | requiredRole_AssemblyConnector = newRequiredRole_AssemblyConnector; |
| 261 | if (eNotificationRequired()) |
| 262 | eNotify(new ENotificationImpl(this, Notification.SET, CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRED_ROLE_ASSEMBLY_CONNECTOR, oldRequiredRole_AssemblyConnector, requiredRole_AssemblyConnector)); |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * The cached OCL expression body for the '{@link #AssemblyConnectorsReferencedProvidedRolesAndChildContextMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Assembly Connectors Referenced Provided Roles And Child Context Must Match</em>}' operation. |
| 267 | * <!-- begin-user-doc --> |
| 268 | * <!-- end-user-doc --> |
| 269 | * @see #AssemblyConnectorsReferencedProvidedRolesAndChildContextMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 270 | * @generated |
| 271 | * @ordered |
| 272 | */ |
| 273 | protected static final String ASSEMBLY_CONNECTORS_REFERENCED_PROVIDED_ROLES_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.providingAssemblyContext_AssemblyConnector.encapsulatedComponent__AssemblyContext.providedRoles_InterfaceProvidingEntity->includes(self.providedRole_AssemblyConnector)\n"+"\n"+""; |
| 274 | |
| 275 | /** |
| 276 | * The cached OCL invariant for the '{@link #AssemblyConnectorsReferencedProvidedRolesAndChildContextMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Assembly Connectors Referenced Provided Roles And Child Context Must Match</em>}' invariant operation. |
| 277 | * <!-- begin-user-doc --> |
| 278 | * <!-- end-user-doc --> |
| 279 | * @see #AssemblyConnectorsReferencedProvidedRolesAndChildContextMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 280 | * @generated |
| 281 | * @ordered |
| 282 | */ |
| 283 | protected static Constraint ASSEMBLY_CONNECTORS_REFERENCED_PROVIDED_ROLES_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 284 | |
| 285 | /** |
| 286 | * <!-- begin-user-doc --> |
| 287 | * <!-- end-user-doc --> |
| 288 | * @generated |
| 289 | */ |
| 290 | public boolean AssemblyConnectorsReferencedProvidedRolesAndChildContextMustMatch(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 291 | if (ASSEMBLY_CONNECTORS_REFERENCED_PROVIDED_ROLES_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 292 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 293 | helper.setContext(CompositionPackage.Literals.ASSEMBLY_CONNECTOR); |
| 294 | try { |
| 295 | ASSEMBLY_CONNECTORS_REFERENCED_PROVIDED_ROLES_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(ASSEMBLY_CONNECTORS_REFERENCED_PROVIDED_ROLES_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 296 | } |
| 297 | catch (ParserException pe) { |
| 298 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 299 | } |
| 300 | } |
| 301 | if (!EOCL_ENV.createQuery(ASSEMBLY_CONNECTORS_REFERENCED_PROVIDED_ROLES_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 302 | if (diagnostics != null) { |
| 303 | diagnostics.add |
| 304 | (new BasicDiagnostic |
| 305 | (Diagnostic.ERROR, |
| 306 | CompositionValidator.DIAGNOSTIC_SOURCE, |
| 307 | CompositionValidator.ASSEMBLY_CONNECTOR__ASSEMBLY_CONNECTORS_REFERENCED_PROVIDED_ROLES_AND_CHILD_CONTEXT_MUST_MATCH, |
| 308 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "AssemblyConnectorsReferencedProvidedRolesAndChildContextMustMatch", EObjectValidator.getObjectLabel(this, context) }), |
| 309 | new Object [] { this })); |
| 310 | } |
| 311 | return false; |
| 312 | } |
| 313 | return true; |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * The cached OCL expression body for the '{@link #AssemblyConnectorsReferencedRequiredRoleAndChildContextMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Assembly Connectors Referenced Required Role And Child Context Must Match</em>}' operation. |
| 318 | * <!-- begin-user-doc --> |
| 319 | * <!-- end-user-doc --> |
| 320 | * @see #AssemblyConnectorsReferencedRequiredRoleAndChildContextMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 321 | * @generated |
| 322 | * @ordered |
| 323 | */ |
| 324 | protected static final String ASSEMBLY_CONNECTORS_REFERENCED_REQUIRED_ROLE_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.requiringAssemblyContext_AssemblyConnector.encapsulatedComponent__AssemblyContext.requiredRoles_InterfaceRequiringEntity->includes(self.requiredRole_AssemblyConnector)\n"+"\n"+""; |
| 325 | |
| 326 | /** |
| 327 | * The cached OCL invariant for the '{@link #AssemblyConnectorsReferencedRequiredRoleAndChildContextMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Assembly Connectors Referenced Required Role And Child Context Must Match</em>}' invariant operation. |
| 328 | * <!-- begin-user-doc --> |
| 329 | * <!-- end-user-doc --> |
| 330 | * @see #AssemblyConnectorsReferencedRequiredRoleAndChildContextMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 331 | * @generated |
| 332 | * @ordered |
| 333 | */ |
| 334 | protected static Constraint ASSEMBLY_CONNECTORS_REFERENCED_REQUIRED_ROLE_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 335 | |
| 336 | /** |
| 337 | * <!-- begin-user-doc --> |
| 338 | * <!-- end-user-doc --> |
| 339 | * @generated |
| 340 | */ |
| 341 | public boolean AssemblyConnectorsReferencedRequiredRoleAndChildContextMustMatch(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 342 | if (ASSEMBLY_CONNECTORS_REFERENCED_REQUIRED_ROLE_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 343 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 344 | helper.setContext(CompositionPackage.Literals.ASSEMBLY_CONNECTOR); |
| 345 | try { |
| 346 | ASSEMBLY_CONNECTORS_REFERENCED_REQUIRED_ROLE_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(ASSEMBLY_CONNECTORS_REFERENCED_REQUIRED_ROLE_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 347 | } |
| 348 | catch (ParserException pe) { |
| 349 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 350 | } |
| 351 | } |
| 352 | if (!EOCL_ENV.createQuery(ASSEMBLY_CONNECTORS_REFERENCED_REQUIRED_ROLE_AND_CHILD_CONTEXT_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 353 | if (diagnostics != null) { |
| 354 | diagnostics.add |
| 355 | (new BasicDiagnostic |
| 356 | (Diagnostic.ERROR, |
| 357 | CompositionValidator.DIAGNOSTIC_SOURCE, |
| 358 | CompositionValidator.ASSEMBLY_CONNECTOR__ASSEMBLY_CONNECTORS_REFERENCED_REQUIRED_ROLE_AND_CHILD_CONTEXT_MUST_MATCH, |
| 359 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "AssemblyConnectorsReferencedRequiredRoleAndChildContextMustMatch", EObjectValidator.getObjectLabel(this, context) }), |
| 360 | new Object [] { this })); |
| 361 | } |
| 362 | return false; |
| 363 | } |
| 364 | return true; |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * The cached OCL expression body for the '{@link #AssemblyConnectorsReferencedInterfacesMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Assembly Connectors Referenced Interfaces Must Match</em>}' operation. |
| 369 | * <!-- begin-user-doc --> |
| 370 | * <!-- end-user-doc --> |
| 371 | * @see #AssemblyConnectorsReferencedInterfacesMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 372 | * @generated |
| 373 | * @ordered |
| 374 | */ |
| 375 | protected static final String ASSEMBLY_CONNECTORS_REFERENCED_INTERFACES_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.providedRole_AssemblyConnector.providedInterface__OperationProvidedRole = self.requiredRole_AssemblyConnector.requiredInterface__OperationRequiredRole"; |
| 376 | |
| 377 | /** |
| 378 | * The cached OCL invariant for the '{@link #AssemblyConnectorsReferencedInterfacesMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Assembly Connectors Referenced Interfaces Must Match</em>}' invariant operation. |
| 379 | * <!-- begin-user-doc --> |
| 380 | * <!-- end-user-doc --> |
| 381 | * @see #AssemblyConnectorsReferencedInterfacesMustMatch(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 382 | * @generated |
| 383 | * @ordered |
| 384 | */ |
| 385 | protected static Constraint ASSEMBLY_CONNECTORS_REFERENCED_INTERFACES_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 386 | |
| 387 | /** |
| 388 | * <!-- begin-user-doc --> |
| 389 | * <!-- end-user-doc --> |
| 390 | * @generated |
| 391 | */ |
| 392 | public boolean AssemblyConnectorsReferencedInterfacesMustMatch(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 393 | if (ASSEMBLY_CONNECTORS_REFERENCED_INTERFACES_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 394 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 395 | helper.setContext(CompositionPackage.Literals.ASSEMBLY_CONNECTOR); |
| 396 | try { |
| 397 | ASSEMBLY_CONNECTORS_REFERENCED_INTERFACES_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(ASSEMBLY_CONNECTORS_REFERENCED_INTERFACES_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 398 | } |
| 399 | catch (ParserException pe) { |
| 400 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 401 | } |
| 402 | } |
| 403 | if (!EOCL_ENV.createQuery(ASSEMBLY_CONNECTORS_REFERENCED_INTERFACES_MUST_MATCH__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 404 | if (diagnostics != null) { |
| 405 | diagnostics.add |
| 406 | (new BasicDiagnostic |
| 407 | (Diagnostic.ERROR, |
| 408 | CompositionValidator.DIAGNOSTIC_SOURCE, |
| 409 | CompositionValidator.ASSEMBLY_CONNECTOR__ASSEMBLY_CONNECTORS_REFERENCED_INTERFACES_MUST_MATCH, |
| 410 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "AssemblyConnectorsReferencedInterfacesMustMatch", EObjectValidator.getObjectLabel(this, context) }), |
| 411 | new Object [] { this })); |
| 412 | } |
| 413 | return false; |
| 414 | } |
| 415 | return true; |
| 416 | } |
| 417 | |
| 418 | /** |
| 419 | * <!-- begin-user-doc --> |
| 420 | * <!-- end-user-doc --> |
| 421 | * @generated |
| 422 | */ |
| 423 | @Override |
| 424 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 425 | switch (featureID) { |
| 426 | case CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR: |
| 427 | if (resolve) return getRequiringAssemblyContext_AssemblyConnector(); |
| 428 | return basicGetRequiringAssemblyContext_AssemblyConnector(); |
| 429 | case CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR: |
| 430 | if (resolve) return getProvidingAssemblyContext_AssemblyConnector(); |
| 431 | return basicGetProvidingAssemblyContext_AssemblyConnector(); |
| 432 | case CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDED_ROLE_ASSEMBLY_CONNECTOR: |
| 433 | if (resolve) return getProvidedRole_AssemblyConnector(); |
| 434 | return basicGetProvidedRole_AssemblyConnector(); |
| 435 | case CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRED_ROLE_ASSEMBLY_CONNECTOR: |
| 436 | if (resolve) return getRequiredRole_AssemblyConnector(); |
| 437 | return basicGetRequiredRole_AssemblyConnector(); |
| 438 | } |
| 439 | return super.eGet(featureID, resolve, coreType); |
| 440 | } |
| 441 | |
| 442 | /** |
| 443 | * <!-- begin-user-doc --> |
| 444 | * <!-- end-user-doc --> |
| 445 | * @generated |
| 446 | */ |
| 447 | @Override |
| 448 | public void eSet(int featureID, Object newValue) { |
| 449 | switch (featureID) { |
| 450 | case CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR: |
| 451 | setRequiringAssemblyContext_AssemblyConnector((AssemblyContext)newValue); |
| 452 | return; |
| 453 | case CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR: |
| 454 | setProvidingAssemblyContext_AssemblyConnector((AssemblyContext)newValue); |
| 455 | return; |
| 456 | case CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDED_ROLE_ASSEMBLY_CONNECTOR: |
| 457 | setProvidedRole_AssemblyConnector((OperationProvidedRole)newValue); |
| 458 | return; |
| 459 | case CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRED_ROLE_ASSEMBLY_CONNECTOR: |
| 460 | setRequiredRole_AssemblyConnector((OperationRequiredRole)newValue); |
| 461 | return; |
| 462 | } |
| 463 | super.eSet(featureID, newValue); |
| 464 | } |
| 465 | |
| 466 | /** |
| 467 | * <!-- begin-user-doc --> |
| 468 | * <!-- end-user-doc --> |
| 469 | * @generated |
| 470 | */ |
| 471 | @Override |
| 472 | public void eUnset(int featureID) { |
| 473 | switch (featureID) { |
| 474 | case CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR: |
| 475 | setRequiringAssemblyContext_AssemblyConnector((AssemblyContext)null); |
| 476 | return; |
| 477 | case CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR: |
| 478 | setProvidingAssemblyContext_AssemblyConnector((AssemblyContext)null); |
| 479 | return; |
| 480 | case CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDED_ROLE_ASSEMBLY_CONNECTOR: |
| 481 | setProvidedRole_AssemblyConnector((OperationProvidedRole)null); |
| 482 | return; |
| 483 | case CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRED_ROLE_ASSEMBLY_CONNECTOR: |
| 484 | setRequiredRole_AssemblyConnector((OperationRequiredRole)null); |
| 485 | return; |
| 486 | } |
| 487 | super.eUnset(featureID); |
| 488 | } |
| 489 | |
| 490 | /** |
| 491 | * <!-- begin-user-doc --> |
| 492 | * <!-- end-user-doc --> |
| 493 | * @generated |
| 494 | */ |
| 495 | @Override |
| 496 | public boolean eIsSet(int featureID) { |
| 497 | switch (featureID) { |
| 498 | case CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR: |
| 499 | return requiringAssemblyContext_AssemblyConnector != null; |
| 500 | case CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDING_ASSEMBLY_CONTEXT_ASSEMBLY_CONNECTOR: |
| 501 | return providingAssemblyContext_AssemblyConnector != null; |
| 502 | case CompositionPackage.ASSEMBLY_CONNECTOR__PROVIDED_ROLE_ASSEMBLY_CONNECTOR: |
| 503 | return providedRole_AssemblyConnector != null; |
| 504 | case CompositionPackage.ASSEMBLY_CONNECTOR__REQUIRED_ROLE_ASSEMBLY_CONNECTOR: |
| 505 | return requiredRole_AssemblyConnector != null; |
| 506 | } |
| 507 | return super.eIsSet(featureID); |
| 508 | } |
| 509 | |
| 510 | /** |
| 511 | * The cached environment for evaluating OCL expressions. |
| 512 | * <!-- begin-user-doc --> |
| 513 | * <!-- end-user-doc --> |
| 514 | * @generated |
| 515 | * @ordered |
| 516 | */ |
| 517 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
| 518 | |
| 519 | } //AssemblyConnectorImpl |