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
13 import org.eclipse.emf.ecore.impl.ENotificationImpl;
14 import org.eclipse.emf.ecore.impl.EObjectImpl;
15
16 import org.mod4j.dsl.service.mm.ServiceDsl.ModelElement;
17 import org.mod4j.dsl.service.mm.ServiceDsl.ServiceDslPackage;
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 public class ModelElementImpl extends EObjectImpl implements ModelElement {
34
35
36
37
38
39
40
41
42 protected static final String NAME_EDEFAULT = null;
43
44
45
46
47
48
49
50
51
52 protected String name = NAME_EDEFAULT;
53
54
55
56
57
58
59
60
61
62 protected static final String DESCRIPTION_EDEFAULT = null;
63
64
65
66
67
68
69
70
71
72 protected String description = DESCRIPTION_EDEFAULT;
73
74
75
76
77
78
79 protected ModelElementImpl() {
80 super();
81 }
82
83
84
85
86
87
88 @Override
89 protected EClass eStaticClass() {
90 return ServiceDslPackage.Literals.MODEL_ELEMENT;
91 }
92
93
94
95
96
97
98 public String getName() {
99 return name;
100 }
101
102
103
104
105
106
107 public void setName(String newName) {
108 String oldName = name;
109 name = newName;
110 if (eNotificationRequired())
111 eNotify(new ENotificationImpl(this, Notification.SET, ServiceDslPackage.MODEL_ELEMENT__NAME, oldName, name));
112 }
113
114
115
116
117
118
119 public String getDescription() {
120 return description;
121 }
122
123
124
125
126
127
128 public void setDescription(String newDescription) {
129 String oldDescription = description;
130 description = newDescription;
131 if (eNotificationRequired())
132 eNotify(new ENotificationImpl(this, Notification.SET, ServiceDslPackage.MODEL_ELEMENT__DESCRIPTION, oldDescription, description));
133 }
134
135
136
137
138
139
140 @Override
141 public Object eGet(int featureID, boolean resolve, boolean coreType) {
142 switch (featureID) {
143 case ServiceDslPackage.MODEL_ELEMENT__NAME:
144 return getName();
145 case ServiceDslPackage.MODEL_ELEMENT__DESCRIPTION:
146 return getDescription();
147 }
148 return super.eGet(featureID, resolve, coreType);
149 }
150
151
152
153
154
155
156 @Override
157 public void eSet(int featureID, Object newValue) {
158 switch (featureID) {
159 case ServiceDslPackage.MODEL_ELEMENT__NAME:
160 setName((String)newValue);
161 return;
162 case ServiceDslPackage.MODEL_ELEMENT__DESCRIPTION:
163 setDescription((String)newValue);
164 return;
165 }
166 super.eSet(featureID, newValue);
167 }
168
169
170
171
172
173
174 @Override
175 public void eUnset(int featureID) {
176 switch (featureID) {
177 case ServiceDslPackage.MODEL_ELEMENT__NAME:
178 setName(NAME_EDEFAULT);
179 return;
180 case ServiceDslPackage.MODEL_ELEMENT__DESCRIPTION:
181 setDescription(DESCRIPTION_EDEFAULT);
182 return;
183 }
184 super.eUnset(featureID);
185 }
186
187
188
189
190
191
192 @Override
193 public boolean eIsSet(int featureID) {
194 switch (featureID) {
195 case ServiceDslPackage.MODEL_ELEMENT__NAME:
196 return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
197 case ServiceDslPackage.MODEL_ELEMENT__DESCRIPTION:
198 return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
199 }
200 return super.eIsSet(featureID);
201 }
202
203
204
205
206
207
208 @Override
209 public String toString() {
210 if (eIsProxy()) return super.toString();
211
212 StringBuffer result = new StringBuffer(super.toString());
213 result.append(" (name: ");
214 result.append(name);
215 result.append(", description: ");
216 result.append(description);
217 result.append(')');
218 return result.toString();
219 }
220
221 }