| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.fzi.se.quality.qualityannotation.impl; |
| 8 | |
| 9 | import de.fzi.se.quality.qualityannotation.PCMREInterface; |
| 10 | import de.fzi.se.quality.qualityannotation.QualityAnnotationPackage; |
| 11 | |
| 12 | import de.fzi.se.quality.qualityannotation.util.QualityAnnotationValidator; |
| 13 | |
| 14 | import de.uka.ipd.sdq.pcm.repository.Interface; |
| 15 | |
| 16 | import java.util.Map; |
| 17 | |
| 18 | import org.eclipse.emf.common.notify.Notification; |
| 19 | |
| 20 | import org.eclipse.emf.common.util.BasicDiagnostic; |
| 21 | import org.eclipse.emf.common.util.Diagnostic; |
| 22 | import org.eclipse.emf.common.util.DiagnosticChain; |
| 23 | |
| 24 | import org.eclipse.emf.ecore.EClass; |
| 25 | import org.eclipse.emf.ecore.InternalEObject; |
| 26 | |
| 27 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 28 | |
| 29 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| 30 | |
| 31 | import org.eclipse.emf.ecore.util.EObjectValidator; |
| 32 | |
| 33 | /** |
| 34 | * <!-- begin-user-doc --> |
| 35 | * An implementation of the model object '<em><b>PCMRE Interface</b></em>'. |
| 36 | * <!-- end-user-doc --> |
| 37 | * <p> |
| 38 | * The following features are implemented: |
| 39 | * <ul> |
| 40 | * <li>{@link de.fzi.se.quality.qualityannotation.impl.PCMREInterfaceImpl#getInterface <em>Interface</em>}</li> |
| 41 | * </ul> |
| 42 | * </p> |
| 43 | * |
| 44 | * @generated |
| 45 | */ |
| 46 | public class PCMREInterfaceImpl extends PCMREImpl implements PCMREInterface { |
| 47 | /** |
| 48 | * The cached value of the '{@link #getInterface() <em>Interface</em>}' reference. |
| 49 | * <!-- begin-user-doc --> |
| 50 | * <!-- end-user-doc --> |
| 51 | * @see #getInterface() |
| 52 | * @generated |
| 53 | * @ordered |
| 54 | */ |
| 55 | protected Interface interface_; |
| 56 | |
| 57 | /** |
| 58 | * <!-- begin-user-doc --> |
| 59 | * <!-- end-user-doc --> |
| 60 | * @generated |
| 61 | */ |
| 62 | protected PCMREInterfaceImpl() { |
| 63 | super(); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * <!-- begin-user-doc --> |
| 68 | * <!-- end-user-doc --> |
| 69 | * @generated |
| 70 | */ |
| 71 | @Override |
| 72 | protected EClass eStaticClass() { |
| 73 | return QualityAnnotationPackage.Literals.PCMRE_INTERFACE; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * <!-- begin-user-doc --> |
| 78 | * <!-- end-user-doc --> |
| 79 | * @generated |
| 80 | */ |
| 81 | public Interface getInterface() { |
| 82 | if (interface_ != null && interface_.eIsProxy()) { |
| 83 | InternalEObject oldInterface = (InternalEObject)interface_; |
| 84 | interface_ = (Interface)eResolveProxy(oldInterface); |
| 85 | if (interface_ != oldInterface) { |
| 86 | if (eNotificationRequired()) |
| 87 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, QualityAnnotationPackage.PCMRE_INTERFACE__INTERFACE, oldInterface, interface_)); |
| 88 | } |
| 89 | } |
| 90 | return interface_; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * <!-- begin-user-doc --> |
| 95 | * <!-- end-user-doc --> |
| 96 | * @generated |
| 97 | */ |
| 98 | public Interface basicGetInterface() { |
| 99 | return interface_; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * <!-- begin-user-doc --> |
| 104 | * <!-- end-user-doc --> |
| 105 | * @generated |
| 106 | */ |
| 107 | public void setInterface(Interface newInterface) { |
| 108 | Interface oldInterface = interface_; |
| 109 | interface_ = newInterface; |
| 110 | if (eNotificationRequired()) |
| 111 | eNotify(new ENotificationImpl(this, Notification.SET, QualityAnnotationPackage.PCMRE_INTERFACE__INTERFACE, oldInterface, interface_)); |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * <!-- begin-user-doc --> |
| 116 | * <!-- end-user-doc --> |
| 117 | * @generated |
| 118 | */ |
| 119 | public boolean NextLowerHierachyLevelIsRole(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 120 | // TODO: implement this method |
| 121 | // -> specify the condition that violates the invariant |
| 122 | // -> verify the details of the diagnostic, including severity and message |
| 123 | // Ensure that you remove @generated or mark it @generated NOT |
| 124 | if (false) { |
| 125 | if (diagnostics != null) { |
| 126 | diagnostics.add |
| 127 | (new BasicDiagnostic |
| 128 | (Diagnostic.ERROR, |
| 129 | QualityAnnotationValidator.DIAGNOSTIC_SOURCE, |
| 130 | QualityAnnotationValidator.PCMRE_INTERFACE__NEXT_LOWER_HIERACHY_LEVEL_IS_ROLE, |
| 131 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "NextLowerHierachyLevelIsRole", EObjectValidator.getObjectLabel(this, context) }), |
| 132 | new Object [] { this })); |
| 133 | } |
| 134 | return false; |
| 135 | } |
| 136 | return true; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * <!-- begin-user-doc --> |
| 141 | * <!-- end-user-doc --> |
| 142 | * @generated |
| 143 | */ |
| 144 | public boolean NextUpperHierarchyLevelIsCategory(DiagnosticChain diagnostics, Map<Object, Object> context) { |
| 145 | // TODO: implement this method |
| 146 | // -> specify the condition that violates the invariant |
| 147 | // -> verify the details of the diagnostic, including severity and message |
| 148 | // Ensure that you remove @generated or mark it @generated NOT |
| 149 | if (false) { |
| 150 | if (diagnostics != null) { |
| 151 | diagnostics.add |
| 152 | (new BasicDiagnostic |
| 153 | (Diagnostic.ERROR, |
| 154 | QualityAnnotationValidator.DIAGNOSTIC_SOURCE, |
| 155 | QualityAnnotationValidator.PCMRE_INTERFACE__NEXT_UPPER_HIERARCHY_LEVEL_IS_CATEGORY, |
| 156 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "NextUpperHierarchyLevelIsCategory", EObjectValidator.getObjectLabel(this, context) }), |
| 157 | new Object [] { this })); |
| 158 | } |
| 159 | return false; |
| 160 | } |
| 161 | return true; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * <!-- begin-user-doc --> |
| 166 | * <!-- end-user-doc --> |
| 167 | * @generated |
| 168 | */ |
| 169 | @Override |
| 170 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 171 | switch (featureID) { |
| 172 | case QualityAnnotationPackage.PCMRE_INTERFACE__INTERFACE: |
| 173 | if (resolve) return getInterface(); |
| 174 | return basicGetInterface(); |
| 175 | } |
| 176 | return super.eGet(featureID, resolve, coreType); |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * <!-- begin-user-doc --> |
| 181 | * <!-- end-user-doc --> |
| 182 | * @generated |
| 183 | */ |
| 184 | @Override |
| 185 | public void eSet(int featureID, Object newValue) { |
| 186 | switch (featureID) { |
| 187 | case QualityAnnotationPackage.PCMRE_INTERFACE__INTERFACE: |
| 188 | setInterface((Interface)newValue); |
| 189 | return; |
| 190 | } |
| 191 | super.eSet(featureID, newValue); |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * <!-- begin-user-doc --> |
| 196 | * <!-- end-user-doc --> |
| 197 | * @generated |
| 198 | */ |
| 199 | @Override |
| 200 | public void eUnset(int featureID) { |
| 201 | switch (featureID) { |
| 202 | case QualityAnnotationPackage.PCMRE_INTERFACE__INTERFACE: |
| 203 | setInterface((Interface)null); |
| 204 | return; |
| 205 | } |
| 206 | super.eUnset(featureID); |
| 207 | } |
| 208 | |
| 209 | /** |
| 210 | * <!-- begin-user-doc --> |
| 211 | * <!-- end-user-doc --> |
| 212 | * @generated |
| 213 | */ |
| 214 | @Override |
| 215 | public boolean eIsSet(int featureID) { |
| 216 | switch (featureID) { |
| 217 | case QualityAnnotationPackage.PCMRE_INTERFACE__INTERFACE: |
| 218 | return interface_ != null; |
| 219 | } |
| 220 | return super.eIsSet(featureID); |
| 221 | } |
| 222 | |
| 223 | } //PCMREInterfaceImpl |