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.DtoReference;
17 import org.mod4j.dsl.service.mm.ServiceDsl.ServiceDslPackage;
18 import org.mod4j.dsl.service.mm.ServiceDsl.SpecialMethod;
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 public class SpecialMethodImpl extends ServiceMethodImpl implements SpecialMethod {
34
35
36
37
38
39
40
41
42 protected DtoReference dto;
43
44
45
46
47
48
49 protected SpecialMethodImpl() {
50 super();
51 }
52
53
54
55
56
57
58 @Override
59 protected EClass eStaticClass() {
60 return ServiceDslPackage.Literals.SPECIAL_METHOD;
61 }
62
63
64
65
66
67
68 public DtoReference getDto() {
69 if (dto != null && dto.eIsProxy()) {
70 InternalEObject oldDto = (InternalEObject)dto;
71 dto = (DtoReference)eResolveProxy(oldDto);
72 if (dto != oldDto) {
73 if (eNotificationRequired())
74 eNotify(new ENotificationImpl(this, Notification.RESOLVE, ServiceDslPackage.SPECIAL_METHOD__DTO, oldDto, dto));
75 }
76 }
77 return dto;
78 }
79
80
81
82
83
84
85 public DtoReference basicGetDto() {
86 return dto;
87 }
88
89
90
91
92
93
94 public void setDto(DtoReference newDto) {
95 DtoReference oldDto = dto;
96 dto = newDto;
97 if (eNotificationRequired())
98 eNotify(new ENotificationImpl(this, Notification.SET, ServiceDslPackage.SPECIAL_METHOD__DTO, oldDto, dto));
99 }
100
101
102
103
104
105
106 @Override
107 public Object eGet(int featureID, boolean resolve, boolean coreType) {
108 switch (featureID) {
109 case ServiceDslPackage.SPECIAL_METHOD__DTO:
110 if (resolve) return getDto();
111 return basicGetDto();
112 }
113 return super.eGet(featureID, resolve, coreType);
114 }
115
116
117
118
119
120
121 @Override
122 public void eSet(int featureID, Object newValue) {
123 switch (featureID) {
124 case ServiceDslPackage.SPECIAL_METHOD__DTO:
125 setDto((DtoReference)newValue);
126 return;
127 }
128 super.eSet(featureID, newValue);
129 }
130
131
132
133
134
135
136 @Override
137 public void eUnset(int featureID) {
138 switch (featureID) {
139 case ServiceDslPackage.SPECIAL_METHOD__DTO:
140 setDto((DtoReference)null);
141 return;
142 }
143 super.eUnset(featureID);
144 }
145
146
147
148
149
150
151 @Override
152 public boolean eIsSet(int featureID) {
153 switch (featureID) {
154 case ServiceDslPackage.SPECIAL_METHOD__DTO:
155 return dto != null;
156 }
157 return super.eIsSet(featureID);
158 }
159
160 }