1
2
3
4
5
6
7 package org.mod4j.dsl.service.mm.ServiceDsl.impl;
8
9 import org.eclipse.emf.common.notify.Notification;
10
11 import org.eclipse.emf.ecore.EClass;
12 import org.eclipse.emf.ecore.InternalEObject;
13
14 import org.eclipse.emf.ecore.impl.ENotificationImpl;
15
16 import org.mod4j.dsl.service.mm.ServiceDsl.AssociationMethod;
17 import org.mod4j.dsl.service.mm.ServiceDsl.DtoReference;
18 import org.mod4j.dsl.service.mm.ServiceDsl.ServiceDslPackage;
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 public class AssociationMethodImpl extends ServiceMethodImpl implements AssociationMethod {
36
37
38
39
40
41
42
43
44 protected DtoReference main;
45
46
47
48
49
50
51
52
53
54 protected DtoReference part;
55
56
57
58
59
60
61
62
63
64 protected static final String ROLENAME_EDEFAULT = null;
65
66
67
68
69
70
71
72
73
74 protected String rolename = ROLENAME_EDEFAULT;
75
76
77
78
79
80
81 protected AssociationMethodImpl() {
82 super();
83 }
84
85
86
87
88
89
90 @Override
91 protected EClass eStaticClass() {
92 return ServiceDslPackage.Literals.ASSOCIATION_METHOD;
93 }
94
95
96
97
98
99
100 public DtoReference getMain() {
101 if (main != null && main.eIsProxy()) {
102 InternalEObject oldMain = (InternalEObject)main;
103 main = (DtoReference)eResolveProxy(oldMain);
104 if (main != oldMain) {
105 if (eNotificationRequired())
106 eNotify(new ENotificationImpl(this, Notification.RESOLVE, ServiceDslPackage.ASSOCIATION_METHOD__MAIN, oldMain, main));
107 }
108 }
109 return main;
110 }
111
112
113
114
115
116
117 public DtoReference basicGetMain() {
118 return main;
119 }
120
121
122
123
124
125
126 public void setMain(DtoReference newMain) {
127 DtoReference oldMain = main;
128 main = newMain;
129 if (eNotificationRequired())
130 eNotify(new ENotificationImpl(this, Notification.SET, ServiceDslPackage.ASSOCIATION_METHOD__MAIN, oldMain, main));
131 }
132
133
134
135
136
137
138 public DtoReference getPart() {
139 if (part != null && part.eIsProxy()) {
140 InternalEObject oldPart = (InternalEObject)part;
141 part = (DtoReference)eResolveProxy(oldPart);
142 if (part != oldPart) {
143 if (eNotificationRequired())
144 eNotify(new ENotificationImpl(this, Notification.RESOLVE, ServiceDslPackage.ASSOCIATION_METHOD__PART, oldPart, part));
145 }
146 }
147 return part;
148 }
149
150
151
152
153
154
155 public DtoReference basicGetPart() {
156 return part;
157 }
158
159
160
161
162
163
164 public void setPart(DtoReference newPart) {
165 DtoReference oldPart = part;
166 part = newPart;
167 if (eNotificationRequired())
168 eNotify(new ENotificationImpl(this, Notification.SET, ServiceDslPackage.ASSOCIATION_METHOD__PART, oldPart, part));
169 }
170
171
172
173
174
175
176 public String getRolename() {
177 return rolename;
178 }
179
180
181
182
183
184
185 public void setRolename(String newRolename) {
186 String oldRolename = rolename;
187 rolename = newRolename;
188 if (eNotificationRequired())
189 eNotify(new ENotificationImpl(this, Notification.SET, ServiceDslPackage.ASSOCIATION_METHOD__ROLENAME, oldRolename, rolename));
190 }
191
192
193
194
195
196
197 @Override
198 public Object eGet(int featureID, boolean resolve, boolean coreType) {
199 switch (featureID) {
200 case ServiceDslPackage.ASSOCIATION_METHOD__MAIN:
201 if (resolve) return getMain();
202 return basicGetMain();
203 case ServiceDslPackage.ASSOCIATION_METHOD__PART:
204 if (resolve) return getPart();
205 return basicGetPart();
206 case ServiceDslPackage.ASSOCIATION_METHOD__ROLENAME:
207 return getRolename();
208 }
209 return super.eGet(featureID, resolve, coreType);
210 }
211
212
213
214
215
216
217 @Override
218 public void eSet(int featureID, Object newValue) {
219 switch (featureID) {
220 case ServiceDslPackage.ASSOCIATION_METHOD__MAIN:
221 setMain((DtoReference)newValue);
222 return;
223 case ServiceDslPackage.ASSOCIATION_METHOD__PART:
224 setPart((DtoReference)newValue);
225 return;
226 case ServiceDslPackage.ASSOCIATION_METHOD__ROLENAME:
227 setRolename((String)newValue);
228 return;
229 }
230 super.eSet(featureID, newValue);
231 }
232
233
234
235
236
237
238 @Override
239 public void eUnset(int featureID) {
240 switch (featureID) {
241 case ServiceDslPackage.ASSOCIATION_METHOD__MAIN:
242 setMain((DtoReference)null);
243 return;
244 case ServiceDslPackage.ASSOCIATION_METHOD__PART:
245 setPart((DtoReference)null);
246 return;
247 case ServiceDslPackage.ASSOCIATION_METHOD__ROLENAME:
248 setRolename(ROLENAME_EDEFAULT);
249 return;
250 }
251 super.eUnset(featureID);
252 }
253
254
255
256
257
258
259 @Override
260 public boolean eIsSet(int featureID) {
261 switch (featureID) {
262 case ServiceDslPackage.ASSOCIATION_METHOD__MAIN:
263 return main != null;
264 case ServiceDslPackage.ASSOCIATION_METHOD__PART:
265 return part != null;
266 case ServiceDslPackage.ASSOCIATION_METHOD__ROLENAME:
267 return ROLENAME_EDEFAULT == null ? rolename != null : !ROLENAME_EDEFAULT.equals(rolename);
268 }
269 return super.eIsSet(featureID);
270 }
271
272
273
274
275
276
277 @Override
278 public String toString() {
279 if (eIsProxy()) return super.toString();
280
281 StringBuffer result = new StringBuffer(super.toString());
282 result.append(" (rolename: ");
283 result.append(rolename);
284 result.append(')');
285 return result.toString();
286 }
287
288 }