| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package copyException.impl; |
| 8 | |
| 9 | import copyException.CopyExceptionPackage; |
| 10 | import copyException.ReferenceException; |
| 11 | |
| 12 | import org.eclipse.emf.common.notify.Notification; |
| 13 | |
| 14 | import org.eclipse.emf.ecore.EClass; |
| 15 | import org.eclipse.emf.ecore.EPackage; |
| 16 | import org.eclipse.emf.ecore.InternalEObject; |
| 17 | |
| 18 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| 19 | |
| 20 | /** |
| 21 | * <!-- begin-user-doc --> |
| 22 | * An implementation of the model object '<em><b>Reference Exception</b></em>'. |
| 23 | * <!-- end-user-doc --> |
| 24 | * <p> |
| 25 | * The following features are implemented: |
| 26 | * <ul> |
| 27 | * <li>{@link copyException.impl.ReferenceExceptionImpl#getO <em>O</em>}</li> |
| 28 | * </ul> |
| 29 | * </p> |
| 30 | * |
| 31 | * @generated |
| 32 | */ |
| 33 | public class ReferenceExceptionImpl extends ExceptionImpl implements ReferenceException { |
| 34 | /** |
| 35 | * The cached value of the '{@link #getO() <em>O</em>}' reference. |
| 36 | * <!-- begin-user-doc --> |
| 37 | * <!-- end-user-doc --> |
| 38 | * @see #getO() |
| 39 | * @generated |
| 40 | * @ordered |
| 41 | */ |
| 42 | protected EPackage o; |
| 43 | |
| 44 | /** |
| 45 | * <!-- begin-user-doc --> |
| 46 | * <!-- end-user-doc --> |
| 47 | * @generated |
| 48 | */ |
| 49 | protected ReferenceExceptionImpl() { |
| 50 | super(); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * <!-- begin-user-doc --> |
| 55 | * <!-- end-user-doc --> |
| 56 | * @generated |
| 57 | */ |
| 58 | @Override |
| 59 | protected EClass eStaticClass() { |
| 60 | return CopyExceptionPackage.Literals.REFERENCE_EXCEPTION; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * <!-- begin-user-doc --> |
| 65 | * <!-- end-user-doc --> |
| 66 | * @generated |
| 67 | */ |
| 68 | public EPackage getO() { |
| 69 | if (o != null && o.eIsProxy()) { |
| 70 | InternalEObject oldO = (InternalEObject)o; |
| 71 | o = (EPackage)eResolveProxy(oldO); |
| 72 | if (o != oldO) { |
| 73 | if (eNotificationRequired()) |
| 74 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CopyExceptionPackage.REFERENCE_EXCEPTION__O, oldO, o)); |
| 75 | } |
| 76 | } |
| 77 | return o; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * <!-- begin-user-doc --> |
| 82 | * <!-- end-user-doc --> |
| 83 | * @generated |
| 84 | */ |
| 85 | public EPackage basicGetO() { |
| 86 | return o; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * <!-- begin-user-doc --> |
| 91 | * <!-- end-user-doc --> |
| 92 | * @generated |
| 93 | */ |
| 94 | public void setO(EPackage newO) { |
| 95 | EPackage oldO = o; |
| 96 | o = newO; |
| 97 | if (eNotificationRequired()) |
| 98 | eNotify(new ENotificationImpl(this, Notification.SET, CopyExceptionPackage.REFERENCE_EXCEPTION__O, oldO, o)); |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * <!-- begin-user-doc --> |
| 103 | * <!-- end-user-doc --> |
| 104 | * @generated |
| 105 | */ |
| 106 | @Override |
| 107 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 108 | switch (featureID) { |
| 109 | case CopyExceptionPackage.REFERENCE_EXCEPTION__O: |
| 110 | if (resolve) return getO(); |
| 111 | return basicGetO(); |
| 112 | } |
| 113 | return super.eGet(featureID, resolve, coreType); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * <!-- begin-user-doc --> |
| 118 | * <!-- end-user-doc --> |
| 119 | * @generated |
| 120 | */ |
| 121 | @Override |
| 122 | public void eSet(int featureID, Object newValue) { |
| 123 | switch (featureID) { |
| 124 | case CopyExceptionPackage.REFERENCE_EXCEPTION__O: |
| 125 | setO((EPackage)newValue); |
| 126 | return; |
| 127 | } |
| 128 | super.eSet(featureID, newValue); |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * <!-- begin-user-doc --> |
| 133 | * <!-- end-user-doc --> |
| 134 | * @generated |
| 135 | */ |
| 136 | @Override |
| 137 | public void eUnset(int featureID) { |
| 138 | switch (featureID) { |
| 139 | case CopyExceptionPackage.REFERENCE_EXCEPTION__O: |
| 140 | setO((EPackage)null); |
| 141 | return; |
| 142 | } |
| 143 | super.eUnset(featureID); |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * <!-- begin-user-doc --> |
| 148 | * <!-- end-user-doc --> |
| 149 | * @generated |
| 150 | */ |
| 151 | @Override |
| 152 | public boolean eIsSet(int featureID) { |
| 153 | switch (featureID) { |
| 154 | case CopyExceptionPackage.REFERENCE_EXCEPTION__O: |
| 155 | return o != null; |
| 156 | } |
| 157 | return super.eIsSet(featureID); |
| 158 | } |
| 159 | |
| 160 | } //ReferenceExceptionImpl |