1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package copyException.impl; |
8 | |
9 | import copyException.CopyExceptionPackage; |
10 | import copyException.DeletionException; |
11 | |
12 | import org.eclipse.emf.common.notify.Notification; |
13 | |
14 | import org.eclipse.emf.ecore.EClass; |
15 | import org.eclipse.emf.ecore.InternalEObject; |
16 | |
17 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
18 | |
19 | /** |
20 | * <!-- begin-user-doc --> |
21 | * An implementation of the model object '<em><b>Deletion Exception</b></em>'. |
22 | * <!-- end-user-doc --> |
23 | * <p> |
24 | * The following features are implemented: |
25 | * <ul> |
26 | * <li>{@link copyException.impl.DeletionExceptionImpl#getObject <em>Object</em>}</li> |
27 | * <li>{@link copyException.impl.DeletionExceptionImpl#getOcle <em>Ocle</em>}</li> |
28 | * </ul> |
29 | * </p> |
30 | * |
31 | * @generated |
32 | */ |
33 | public class DeletionExceptionImpl extends ExceptionImpl implements DeletionException { |
34 | /** |
35 | * The cached value of the '{@link #getObject() <em>Object</em>}' reference. |
36 | * <!-- begin-user-doc --> |
37 | * <!-- end-user-doc --> |
38 | * @see #getObject() |
39 | * @generated |
40 | * @ordered |
41 | */ |
42 | protected EClass object; |
43 | |
44 | /** |
45 | * The default value of the '{@link #getOcle() <em>Ocle</em>}' attribute. |
46 | * <!-- begin-user-doc --> |
47 | * <!-- end-user-doc --> |
48 | * @see #getOcle() |
49 | * @generated |
50 | * @ordered |
51 | */ |
52 | protected static final String OCLE_EDEFAULT = null; |
53 | |
54 | /** |
55 | * The cached value of the '{@link #getOcle() <em>Ocle</em>}' attribute. |
56 | * <!-- begin-user-doc --> |
57 | * <!-- end-user-doc --> |
58 | * @see #getOcle() |
59 | * @generated |
60 | * @ordered |
61 | */ |
62 | protected String ocle = OCLE_EDEFAULT; |
63 | |
64 | /** |
65 | * <!-- begin-user-doc --> |
66 | * <!-- end-user-doc --> |
67 | * @generated |
68 | */ |
69 | protected DeletionExceptionImpl() { |
70 | super(); |
71 | } |
72 | |
73 | /** |
74 | * <!-- begin-user-doc --> |
75 | * <!-- end-user-doc --> |
76 | * @generated |
77 | */ |
78 | @Override |
79 | protected EClass eStaticClass() { |
80 | return CopyExceptionPackage.Literals.DELETION_EXCEPTION; |
81 | } |
82 | |
83 | /** |
84 | * <!-- begin-user-doc --> |
85 | * <!-- end-user-doc --> |
86 | * @generated |
87 | */ |
88 | public EClass getObject() { |
89 | if (object != null && object.eIsProxy()) { |
90 | InternalEObject oldObject = (InternalEObject)object; |
91 | object = (EClass)eResolveProxy(oldObject); |
92 | if (object != oldObject) { |
93 | if (eNotificationRequired()) |
94 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CopyExceptionPackage.DELETION_EXCEPTION__OBJECT, oldObject, object)); |
95 | } |
96 | } |
97 | return object; |
98 | } |
99 | |
100 | /** |
101 | * <!-- begin-user-doc --> |
102 | * <!-- end-user-doc --> |
103 | * @generated |
104 | */ |
105 | public EClass basicGetObject() { |
106 | return object; |
107 | } |
108 | |
109 | /** |
110 | * <!-- begin-user-doc --> |
111 | * <!-- end-user-doc --> |
112 | * @generated |
113 | */ |
114 | public void setObject(EClass newObject) { |
115 | EClass oldObject = object; |
116 | object = newObject; |
117 | if (eNotificationRequired()) |
118 | eNotify(new ENotificationImpl(this, Notification.SET, CopyExceptionPackage.DELETION_EXCEPTION__OBJECT, oldObject, object)); |
119 | } |
120 | |
121 | /** |
122 | * <!-- begin-user-doc --> |
123 | * <!-- end-user-doc --> |
124 | * @generated |
125 | */ |
126 | public String getOcle() { |
127 | return ocle; |
128 | } |
129 | |
130 | /** |
131 | * <!-- begin-user-doc --> |
132 | * <!-- end-user-doc --> |
133 | * @generated |
134 | */ |
135 | public void setOcle(String newOcle) { |
136 | String oldOcle = ocle; |
137 | ocle = newOcle; |
138 | if (eNotificationRequired()) |
139 | eNotify(new ENotificationImpl(this, Notification.SET, CopyExceptionPackage.DELETION_EXCEPTION__OCLE, oldOcle, ocle)); |
140 | } |
141 | |
142 | /** |
143 | * <!-- begin-user-doc --> |
144 | * <!-- end-user-doc --> |
145 | * @generated |
146 | */ |
147 | @Override |
148 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
149 | switch (featureID) { |
150 | case CopyExceptionPackage.DELETION_EXCEPTION__OBJECT: |
151 | if (resolve) return getObject(); |
152 | return basicGetObject(); |
153 | case CopyExceptionPackage.DELETION_EXCEPTION__OCLE: |
154 | return getOcle(); |
155 | } |
156 | return super.eGet(featureID, resolve, coreType); |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @generated |
163 | */ |
164 | @Override |
165 | public void eSet(int featureID, Object newValue) { |
166 | switch (featureID) { |
167 | case CopyExceptionPackage.DELETION_EXCEPTION__OBJECT: |
168 | setObject((EClass)newValue); |
169 | return; |
170 | case CopyExceptionPackage.DELETION_EXCEPTION__OCLE: |
171 | setOcle((String)newValue); |
172 | return; |
173 | } |
174 | super.eSet(featureID, newValue); |
175 | } |
176 | |
177 | /** |
178 | * <!-- begin-user-doc --> |
179 | * <!-- end-user-doc --> |
180 | * @generated |
181 | */ |
182 | @Override |
183 | public void eUnset(int featureID) { |
184 | switch (featureID) { |
185 | case CopyExceptionPackage.DELETION_EXCEPTION__OBJECT: |
186 | setObject((EClass)null); |
187 | return; |
188 | case CopyExceptionPackage.DELETION_EXCEPTION__OCLE: |
189 | setOcle(OCLE_EDEFAULT); |
190 | return; |
191 | } |
192 | super.eUnset(featureID); |
193 | } |
194 | |
195 | /** |
196 | * <!-- begin-user-doc --> |
197 | * <!-- end-user-doc --> |
198 | * @generated |
199 | */ |
200 | @Override |
201 | public boolean eIsSet(int featureID) { |
202 | switch (featureID) { |
203 | case CopyExceptionPackage.DELETION_EXCEPTION__OBJECT: |
204 | return object != null; |
205 | case CopyExceptionPackage.DELETION_EXCEPTION__OCLE: |
206 | return OCLE_EDEFAULT == null ? ocle != null : !OCLE_EDEFAULT.equals(ocle); |
207 | } |
208 | return super.eIsSet(featureID); |
209 | } |
210 | |
211 | /** |
212 | * <!-- begin-user-doc --> |
213 | * <!-- end-user-doc --> |
214 | * @generated |
215 | */ |
216 | @Override |
217 | public String toString() { |
218 | if (eIsProxy()) return super.toString(); |
219 | |
220 | StringBuffer result = new StringBuffer(super.toString()); |
221 | result.append(" (ocle: "); |
222 | result.append(ocle); |
223 | result.append(')'); |
224 | return result.toString(); |
225 | } |
226 | |
227 | } //DeletionExceptionImpl |