| 1 | /** |
| 2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.pcm.repository.impl; |
| 7 | |
| 8 | import java.util.Collection; |
| 9 | import java.util.Map; |
| 10 | |
| 11 | import org.eclipse.emf.common.notify.Notification; |
| 12 | import org.eclipse.emf.common.notify.NotificationChain; |
| 13 | import org.eclipse.emf.common.util.BasicDiagnostic; |
| 14 | import org.eclipse.emf.common.util.Diagnostic; |
| 15 | import org.eclipse.emf.common.util.DiagnosticChain; |
| 16 | import org.eclipse.emf.common.util.EList; |
| 17 | import org.eclipse.emf.ecore.EClass; |
| 18 | import org.eclipse.emf.ecore.InternalEObject; |
| 19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 20 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| 21 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| 22 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| 23 | import org.eclipse.emf.ecore.util.EObjectValidator; |
| 24 | import org.eclipse.emf.ecore.util.InternalEList; |
| 25 | import org.eclipse.ocl.ParserException; |
| 26 | import org.eclipse.ocl.ecore.Constraint; |
| 27 | import org.eclipse.ocl.ecore.OCL; |
| 28 | |
| 29 | import de.uka.ipd.sdq.pcm.parameter.VariableUsage; |
| 30 | import de.uka.ipd.sdq.pcm.repository.CompleteComponentType; |
| 31 | import de.uka.ipd.sdq.pcm.repository.ComponentType; |
| 32 | import de.uka.ipd.sdq.pcm.repository.ImplementationComponentType; |
| 33 | import de.uka.ipd.sdq.pcm.repository.RepositoryPackage; |
| 34 | import de.uka.ipd.sdq.pcm.repository.util.RepositoryValidator; |
| 35 | |
| 36 | /** |
| 37 | * <!-- begin-user-doc --> |
| 38 | * An implementation of the model object '<em><b>Implementation Component Type</b></em>'. |
| 39 | * <!-- end-user-doc --> |
| 40 | * <p> |
| 41 | * The following features are implemented: |
| 42 | * <ul> |
| 43 | * <li>{@link de.uka.ipd.sdq.pcm.repository.impl.ImplementationComponentTypeImpl#getParentCompleteComponentTypes <em>Parent Complete Component Types</em>}</li> |
| 44 | * <li>{@link de.uka.ipd.sdq.pcm.repository.impl.ImplementationComponentTypeImpl#getComponentParameterUsage_ImplementationComponentType <em>Component Parameter Usage Implementation Component Type</em>}</li> |
| 45 | * <li>{@link de.uka.ipd.sdq.pcm.repository.impl.ImplementationComponentTypeImpl#getComponentType <em>Component Type</em>}</li> |
| 46 | * </ul> |
| 47 | * </p> |
| 48 | * |
| 49 | * @generated |
| 50 | */ |
| 51 | public abstract class ImplementationComponentTypeImpl extends RepositoryComponentImpl implements ImplementationComponentType { |
| 52 | /** |
| 53 | * <!-- begin-user-doc --> |
| 54 | * <!-- end-user-doc --> |
| 55 | * @generated |
| 56 | */ |
| 57 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 58 | |
| 59 | /** |
| 60 | * The cached value of the '{@link #getParentCompleteComponentTypes() <em>Parent Complete Component Types</em>}' reference list. |
| 61 | * <!-- begin-user-doc --> |
| 62 | * <!-- end-user-doc --> |
| 63 | * @see #getParentCompleteComponentTypes() |
| 64 | * @generated |
| 65 | * @ordered |
| 66 | */ |
| 67 | protected EList<CompleteComponentType> parentCompleteComponentTypes; |
| 68 | |
| 69 | /** |
| 70 | * The cached value of the '{@link #getComponentParameterUsage_ImplementationComponentType() <em>Component Parameter Usage Implementation Component Type</em>}' containment reference list. |
| 71 | * <!-- begin-user-doc --> |
| 72 | * <!-- end-user-doc --> |
| 73 | * @see #getComponentParameterUsage_ImplementationComponentType() |
| 74 | * @generated |
| 75 | * @ordered |
| 76 | */ |
| 77 | protected EList<VariableUsage> componentParameterUsage_ImplementationComponentType; |
| 78 | |
| 79 | /** |
| 80 | * The default value of the '{@link #getComponentType() <em>Component Type</em>}' attribute. |
| 81 | * <!-- begin-user-doc --> |
| 82 | * <!-- end-user-doc --> |
| 83 | * @see #getComponentType() |
| 84 | * @generated |
| 85 | * @ordered |
| 86 | */ |
| 87 | protected static final ComponentType COMPONENT_TYPE_EDEFAULT = ComponentType.BUSINESS_COMPONENT; |
| 88 | |
| 89 | /** |
| 90 | * The cached value of the '{@link #getComponentType() <em>Component Type</em>}' attribute. |
| 91 | * <!-- begin-user-doc --> |
| 92 | * <!-- end-user-doc --> |
| 93 | * @see #getComponentType() |
| 94 | * @generated |
| 95 | * @ordered |
| 96 | */ |
| 97 | protected ComponentType componentType = COMPONENT_TYPE_EDEFAULT; |
| 98 | |
| 99 | /** |
| 100 | * <!-- begin-user-doc --> |
| 101 | * <!-- end-user-doc --> |
| 102 | * @generated |
| 103 | */ |
| 104 | protected ImplementationComponentTypeImpl() { |
| 105 | super(); |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * <!-- begin-user-doc --> |
| 110 | * <!-- end-user-doc --> |
| 111 | * @generated |
| 112 | */ |
| 113 | @Override |
| 114 | protected EClass eStaticClass() { |
| 115 | return RepositoryPackage.Literals.IMPLEMENTATION_COMPONENT_TYPE; |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * <!-- begin-user-doc --> |
| 120 | * <!-- end-user-doc --> |
| 121 | * @generated |
| 122 | */ |
| 123 | public EList<CompleteComponentType> getParentCompleteComponentTypes() { |
| 124 | if (parentCompleteComponentTypes == null) { |
| 125 | parentCompleteComponentTypes = new EObjectResolvingEList<CompleteComponentType>(CompleteComponentType.class, this, RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__PARENT_COMPLETE_COMPONENT_TYPES); |
| 126 | } |
| 127 | return parentCompleteComponentTypes; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * <!-- begin-user-doc --> |
| 132 | * <!-- end-user-doc --> |
| 133 | * @generated |
| 134 | */ |
| 135 | public EList<VariableUsage> getComponentParameterUsage_ImplementationComponentType() { |
| 136 | if (componentParameterUsage_ImplementationComponentType == null) { |
| 137 | componentParameterUsage_ImplementationComponentType = new EObjectContainmentEList<VariableUsage>(VariableUsage.class, this, RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_PARAMETER_USAGE_IMPLEMENTATION_COMPONENT_TYPE); |
| 138 | } |
| 139 | return componentParameterUsage_ImplementationComponentType; |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * <!-- begin-user-doc --> |
| 144 | * <!-- end-user-doc --> |
| 145 | * @generated |
| 146 | */ |
| 147 | public ComponentType getComponentType() { |
| 148 | return componentType; |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * <!-- begin-user-doc --> |
| 153 | * <!-- end-user-doc --> |
| 154 | * @generated |
| 155 | */ |
| 156 | public void setComponentType(ComponentType newComponentType) { |
| 157 | ComponentType oldComponentType = componentType; |
| 158 | componentType = newComponentType == null ? COMPONENT_TYPE_EDEFAULT : newComponentType; |
| 159 | if (eNotificationRequired()) |
| 160 | eNotify(new ENotificationImpl(this, Notification.SET, RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_TYPE, oldComponentType, componentType)); |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * The cached OCL expression body for the '{@link #RequiredInterfacesHaveToConformToCompleteType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Required Interfaces Have To Conform To Complete Type</em>}' operation. |
| 165 | * <!-- begin-user-doc --> |
| 166 | * <!-- end-user-doc --> |
| 167 | * @see #RequiredInterfacesHaveToConformToCompleteType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 168 | * @generated |
| 169 | * @ordered |
| 170 | */ |
| 171 | protected static final String REQUIRED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "-- ImplementationTypes required Interfaces have to be a subset\n"+"-- of CompleteComponentType required Interfaces #\n"+"--\n"+"-- ACCx are used to accumulate Sets/Bags; usually only the very inner ACCx is used at all.\n"+"--\n"+"-- Recursive Query for parent Interface IDs\n"+"-- see 'lpar2005.pdf' (Second-order principles in specification languages for Object-Oriented Programs; Beckert, Tretelman) pp. 11 #\n"+"--let parentInterfaces : Bag(Interface) =\n"+"-- self.parentCompleteComponentTypes->iterate(pt : CompleteComponentType; acc1 : Bag(Interface) = Bag{} |\n"+"-- acc1->union(pt.requiredRoles->iterate(r : RequiredRole; acc2 : Bag(Interface) = Bag{} |\n"+"-- acc2->union(r.requiredInterface.parentInterface->asBag()) -- asBag required to allow Set operations #\n"+"-- ))\n"+"-- ) in\n"+"--let anchestorInterfaces : Bag(Interface) =\n"+"-- self.parentCompleteComponentTypes->iterate(pt : CompleteComponentType; acc3 : Bag(Interface) = Bag{} |\n"+"-- acc3->union(pt.requiredRoles->iterate(r : RequiredRole; acc4 : Bag(Interface) = Bag{} |\n"+"-- acc4->union(r.requiredInterface.parentInterface->asBag()) -- asBag required to allow Set operations #\n"+"-- ))\n"+"-- )->union( -- union with anchestors found in former recursion #\n"+"-- self.parentCompleteComponentTypes->iterate(pt : CompleteComponentType; acc5 : Bag(Interface) = Bag{} |\n"+"-- acc5->union(pt.requiredRoles->iterate(r : RequiredRole; acc6 : Bag(Interface) = Bag{} |\n"+"-- acc6->union(r.requiredInterface.parentInterface.anchestorInterfaces) --already Set/Bag\n"+"-- ))\n"+"-- )\n"+"-- ) in\n"+"-- Directly required interfaces need to be a subset of required anchestorInterfaces of Supertype #\n"+"--anchestorInterfaces.identifier.id->includesAll(\n"+"-- self.requiredRoles->iterate(p : RequiredRole; acc7 : Bag(String) = Bag{} |\n"+"-- acc7->union(p.requiredInterface.identifier.id->asBag())\n"+"-- ) \n"+"--)\n"+"true"; |
| 172 | |
| 173 | /** |
| 174 | * The cached OCL invariant for the '{@link #RequiredInterfacesHaveToConformToCompleteType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Required Interfaces Have To Conform To Complete Type</em>}' invariant operation. |
| 175 | * <!-- begin-user-doc --> |
| 176 | * <!-- end-user-doc --> |
| 177 | * @see #RequiredInterfacesHaveToConformToCompleteType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 178 | * @generated |
| 179 | * @ordered |
| 180 | */ |
| 181 | protected static Constraint REQUIRED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 182 | |
| 183 | /** |
| 184 | * <!-- begin-user-doc --> |
| 185 | * <!-- end-user-doc --> |
| 186 | * @generated |
| 187 | */ |
| 188 | public boolean RequiredInterfacesHaveToConformToCompleteType(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 189 | if (REQUIRED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 190 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 191 | helper.setContext(RepositoryPackage.Literals.IMPLEMENTATION_COMPONENT_TYPE); |
| 192 | try { |
| 193 | REQUIRED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(REQUIRED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 194 | } |
| 195 | catch (ParserException pe) { |
| 196 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 197 | } |
| 198 | } |
| 199 | if (!EOCL_ENV.createQuery(REQUIRED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 200 | if (diagnostics != null) { |
| 201 | diagnostics.add |
| 202 | (new BasicDiagnostic |
| 203 | (Diagnostic.ERROR, |
| 204 | RepositoryValidator.DIAGNOSTIC_SOURCE, |
| 205 | RepositoryValidator.IMPLEMENTATION_COMPONENT_TYPE__REQUIRED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE, |
| 206 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "RequiredInterfacesHaveToConformToCompleteType", EObjectValidator.getObjectLabel(this, context) }), |
| 207 | new Object [] { this })); |
| 208 | } |
| 209 | return false; |
| 210 | } |
| 211 | return true; |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * The cached OCL expression body for the '{@link #providedInterfacesHaveToConformToCompleteType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Provided Interfaces Have To Conform To Complete Type</em>}' operation. |
| 216 | * <!-- begin-user-doc --> |
| 217 | * <!-- end-user-doc --> |
| 218 | * @see #providedInterfacesHaveToConformToCompleteType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 219 | * @generated |
| 220 | * @ordered |
| 221 | */ |
| 222 | protected static final String PROVIDED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "-- ### EXACT COPY FROM ABOVE ###\n"+"-- ImplementationComponentTypes provided Interfaces have to be a superset\n"+"-- of CompleteComponentType provided Interfaces #\n"+"--\n"+"-- ACCx are used to accumulate Sets/Bags; usually only the very inner ACCx is used at all.\n"+"--\n"+"-- Recursive Query for parent Interface IDs\n"+"-- see 'lpar2005.pdf' (Second-order principles in specification languages for Object-Oriented Programs; Beckert, Tretelman) pp. 11 #\n"+"--let parentInterfaces : Bag(Interface) =\n"+"-- self.providedRoles->iterate(r : ProvidedRole; acc2 : Bag(Interface) = Bag{} |\n"+"-- acc2->union(r.providedInterface.parentInterface->asBag()) -- asBag required to allow Set operations #\n"+"-- ) in\n"+"--let anchestorInterfaces : Bag(Interface) =\n"+"-- self.providedRoles->iterate(r : ProvidedRole; acc4 : Bag(Interface) = Bag{} |\n"+"-- acc4->union(r.providedInterface.parentInterface->asBag()) -- asBag required to allow Set operations #\n"+"-- )->union( -- union with anchestors found in former recursion #\n"+"-- self.providedRoles->iterate(r : ProvidedRole; acc6 : Bag(Interface) = Bag{} |\n"+"-- acc6->union(r.providedInterface.parentInterface.anchestorInterfaces) --already Set/Bag\n"+"-- )\n"+"-- ) in\n"+" -- Directly provided anchestorInterfaces need to be a superset of provided interfaces of Supertype #\n"+"-- anchestorInterfaces.identifier.id->includesAll(\n"+"-- self.parentProvidesComponentTypes->iterate(pt : ProvidesComponentType; acc1 : Bag(String) = Bag{} |\n"+"-- pt.providedRoles->iterate(r : ProvidedRole; acc2 : Bag(String) = Bag{} |\n"+"-- acc2->union(r.providedInterface.identifier.id->asBag()) -- asBag required to allow Set operations #\n"+"-- )\n"+"-- )\n"+"-- )\n"+"true"; |
| 223 | |
| 224 | /** |
| 225 | * The cached OCL invariant for the '{@link #providedInterfacesHaveToConformToCompleteType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Provided Interfaces Have To Conform To Complete Type</em>}' invariant operation. |
| 226 | * <!-- begin-user-doc --> |
| 227 | * <!-- end-user-doc --> |
| 228 | * @see #providedInterfacesHaveToConformToCompleteType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 229 | * @generated |
| 230 | * @ordered |
| 231 | */ |
| 232 | protected static Constraint PROVIDED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 233 | |
| 234 | /** |
| 235 | * <!-- begin-user-doc --> |
| 236 | * <!-- end-user-doc --> |
| 237 | * @generated |
| 238 | */ |
| 239 | public boolean providedInterfacesHaveToConformToCompleteType(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 240 | if (PROVIDED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 241 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 242 | helper.setContext(RepositoryPackage.Literals.IMPLEMENTATION_COMPONENT_TYPE); |
| 243 | try { |
| 244 | PROVIDED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(PROVIDED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 245 | } |
| 246 | catch (ParserException pe) { |
| 247 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 248 | } |
| 249 | } |
| 250 | if (!EOCL_ENV.createQuery(PROVIDED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 251 | if (diagnostics != null) { |
| 252 | diagnostics.add |
| 253 | (new BasicDiagnostic |
| 254 | (Diagnostic.ERROR, |
| 255 | RepositoryValidator.DIAGNOSTIC_SOURCE, |
| 256 | RepositoryValidator.IMPLEMENTATION_COMPONENT_TYPE__PROVIDED_INTERFACES_HAVE_TO_CONFORM_TO_COMPLETE_TYPE, |
| 257 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "providedInterfacesHaveToConformToCompleteType", EObjectValidator.getObjectLabel(this, context) }), |
| 258 | new Object [] { this })); |
| 259 | } |
| 260 | return false; |
| 261 | } |
| 262 | return true; |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * The cached OCL expression body for the '{@link #ProvidedInterfaceHaveToConformToComponentType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Provided Interface Have To Conform To Component Type</em>}' operation. |
| 267 | * <!-- begin-user-doc --> |
| 268 | * <!-- end-user-doc --> |
| 269 | * @see #ProvidedInterfaceHaveToConformToComponentType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 270 | * @generated |
| 271 | * @ordered |
| 272 | */ |
| 273 | protected static final String PROVIDED_INTERFACE_HAVE_TO_CONFORM_TO_COMPONENT_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "if self.componentType = ComponentType::INFRASTRUCTURE_COMPONENT then\n"+" self.providedRoles_InterfaceProvidingEntity->select(role | role.oclIsTypeOf(OperationInterface) or role.oclIsTypeOf(EventGroup))->size() = 0\n"+"else if self.componentType = ComponentType::BUSINESS_COMPONENT then\n"+" self.providedRoles_InterfaceProvidingEntity->select(role | role.oclIsTypeOf(InfrastructureInterface))->size() = 0\n"+"else\n"+" 1 = 0\n"+"endif\n"+"endif"; |
| 274 | |
| 275 | /** |
| 276 | * The cached OCL invariant for the '{@link #ProvidedInterfaceHaveToConformToComponentType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Provided Interface Have To Conform To Component Type</em>}' invariant operation. |
| 277 | * <!-- begin-user-doc --> |
| 278 | * <!-- end-user-doc --> |
| 279 | * @see #ProvidedInterfaceHaveToConformToComponentType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
| 280 | * @generated |
| 281 | * @ordered |
| 282 | */ |
| 283 | protected static Constraint PROVIDED_INTERFACE_HAVE_TO_CONFORM_TO_COMPONENT_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
| 284 | |
| 285 | /** |
| 286 | * <!-- begin-user-doc --> |
| 287 | * <!-- end-user-doc --> |
| 288 | * @generated |
| 289 | */ |
| 290 | public boolean ProvidedInterfaceHaveToConformToComponentType(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 291 | if (PROVIDED_INTERFACE_HAVE_TO_CONFORM_TO_COMPONENT_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
| 292 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
| 293 | helper.setContext(RepositoryPackage.Literals.IMPLEMENTATION_COMPONENT_TYPE); |
| 294 | try { |
| 295 | PROVIDED_INTERFACE_HAVE_TO_CONFORM_TO_COMPONENT_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(PROVIDED_INTERFACE_HAVE_TO_CONFORM_TO_COMPONENT_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
| 296 | } |
| 297 | catch (ParserException pe) { |
| 298 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
| 299 | } |
| 300 | } |
| 301 | if (!EOCL_ENV.createQuery(PROVIDED_INTERFACE_HAVE_TO_CONFORM_TO_COMPONENT_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
| 302 | if (diagnostics != null) { |
| 303 | diagnostics.add |
| 304 | (new BasicDiagnostic |
| 305 | (Diagnostic.ERROR, |
| 306 | RepositoryValidator.DIAGNOSTIC_SOURCE, |
| 307 | RepositoryValidator.IMPLEMENTATION_COMPONENT_TYPE__PROVIDED_INTERFACE_HAVE_TO_CONFORM_TO_COMPONENT_TYPE, |
| 308 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ProvidedInterfaceHaveToConformToComponentType", EObjectValidator.getObjectLabel(this, context) }), |
| 309 | new Object [] { this })); |
| 310 | } |
| 311 | return false; |
| 312 | } |
| 313 | return true; |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * <!-- begin-user-doc --> |
| 318 | * <!-- end-user-doc --> |
| 319 | * @generated |
| 320 | */ |
| 321 | @Override |
| 322 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 323 | switch (featureID) { |
| 324 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_PARAMETER_USAGE_IMPLEMENTATION_COMPONENT_TYPE: |
| 325 | return ((InternalEList<?>)getComponentParameterUsage_ImplementationComponentType()).basicRemove(otherEnd, msgs); |
| 326 | } |
| 327 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 328 | } |
| 329 | |
| 330 | /** |
| 331 | * <!-- begin-user-doc --> |
| 332 | * <!-- end-user-doc --> |
| 333 | * @generated |
| 334 | */ |
| 335 | @Override |
| 336 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 337 | switch (featureID) { |
| 338 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__PARENT_COMPLETE_COMPONENT_TYPES: |
| 339 | return getParentCompleteComponentTypes(); |
| 340 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_PARAMETER_USAGE_IMPLEMENTATION_COMPONENT_TYPE: |
| 341 | return getComponentParameterUsage_ImplementationComponentType(); |
| 342 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_TYPE: |
| 343 | return getComponentType(); |
| 344 | } |
| 345 | return super.eGet(featureID, resolve, coreType); |
| 346 | } |
| 347 | |
| 348 | /** |
| 349 | * <!-- begin-user-doc --> |
| 350 | * <!-- end-user-doc --> |
| 351 | * @generated |
| 352 | */ |
| 353 | @SuppressWarnings("unchecked") |
| 354 | @Override |
| 355 | public void eSet(int featureID, Object newValue) { |
| 356 | switch (featureID) { |
| 357 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__PARENT_COMPLETE_COMPONENT_TYPES: |
| 358 | getParentCompleteComponentTypes().clear(); |
| 359 | getParentCompleteComponentTypes().addAll((Collection<? extends CompleteComponentType>)newValue); |
| 360 | return; |
| 361 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_PARAMETER_USAGE_IMPLEMENTATION_COMPONENT_TYPE: |
| 362 | getComponentParameterUsage_ImplementationComponentType().clear(); |
| 363 | getComponentParameterUsage_ImplementationComponentType().addAll((Collection<? extends VariableUsage>)newValue); |
| 364 | return; |
| 365 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_TYPE: |
| 366 | setComponentType((ComponentType)newValue); |
| 367 | return; |
| 368 | } |
| 369 | super.eSet(featureID, newValue); |
| 370 | } |
| 371 | |
| 372 | /** |
| 373 | * <!-- begin-user-doc --> |
| 374 | * <!-- end-user-doc --> |
| 375 | * @generated |
| 376 | */ |
| 377 | @Override |
| 378 | public void eUnset(int featureID) { |
| 379 | switch (featureID) { |
| 380 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__PARENT_COMPLETE_COMPONENT_TYPES: |
| 381 | getParentCompleteComponentTypes().clear(); |
| 382 | return; |
| 383 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_PARAMETER_USAGE_IMPLEMENTATION_COMPONENT_TYPE: |
| 384 | getComponentParameterUsage_ImplementationComponentType().clear(); |
| 385 | return; |
| 386 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_TYPE: |
| 387 | setComponentType(COMPONENT_TYPE_EDEFAULT); |
| 388 | return; |
| 389 | } |
| 390 | super.eUnset(featureID); |
| 391 | } |
| 392 | |
| 393 | /** |
| 394 | * <!-- begin-user-doc --> |
| 395 | * <!-- end-user-doc --> |
| 396 | * @generated |
| 397 | */ |
| 398 | @Override |
| 399 | public boolean eIsSet(int featureID) { |
| 400 | switch (featureID) { |
| 401 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__PARENT_COMPLETE_COMPONENT_TYPES: |
| 402 | return parentCompleteComponentTypes != null && !parentCompleteComponentTypes.isEmpty(); |
| 403 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_PARAMETER_USAGE_IMPLEMENTATION_COMPONENT_TYPE: |
| 404 | return componentParameterUsage_ImplementationComponentType != null && !componentParameterUsage_ImplementationComponentType.isEmpty(); |
| 405 | case RepositoryPackage.IMPLEMENTATION_COMPONENT_TYPE__COMPONENT_TYPE: |
| 406 | return componentType != COMPONENT_TYPE_EDEFAULT; |
| 407 | } |
| 408 | return super.eIsSet(featureID); |
| 409 | } |
| 410 | |
| 411 | /** |
| 412 | * <!-- begin-user-doc --> |
| 413 | * <!-- end-user-doc --> |
| 414 | * @generated |
| 415 | */ |
| 416 | @Override |
| 417 | public String toString() { |
| 418 | if (eIsProxy()) return super.toString(); |
| 419 | |
| 420 | StringBuffer result = new StringBuffer(super.toString()); |
| 421 | result.append(" (componentType: "); |
| 422 | result.append(componentType); |
| 423 | result.append(')'); |
| 424 | return result.toString(); |
| 425 | } |
| 426 | |
| 427 | /** |
| 428 | * The cached environment for evaluating OCL expressions. |
| 429 | * <!-- begin-user-doc --> |
| 430 | * <!-- end-user-doc --> |
| 431 | * @generated |
| 432 | * @ordered |
| 433 | */ |
| 434 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
| 435 | |
| 436 | } //ImplementationComponentTypeImpl |