Skip to content

Package: ErrorReportImpl

ErrorReportImpl

nameinstructionbranchcomplexitylinemethod
ErrorReportImpl()
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
basicSetEmfLocation(EMFLocation, NotificationChain)
M: 18 C: 11
38%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 6 C: 4
40%
M: 0 C: 1
100%
basicSetSheetLocation(SheetLocation, NotificationChain)
M: 18 C: 11
38%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 6 C: 4
40%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 20 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 18 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 46 C: 0
0%
M: 17 C: 0
0%
M: 11 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 27 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
eStaticClass()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
eUnset(int)
M: 22 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
getEmfLocation()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMessage()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSeverity()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSheetLocation()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setEmfLocation(EMFLocation)
M: 22 C: 30
58%
M: 4 C: 6
60%
M: 4 C: 2
33%
M: 5 C: 10
67%
M: 0 C: 1
100%
setMessage(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setSeverity(Severity)
M: 13 C: 12
48%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 4
67%
M: 0 C: 1
100%
setSheetLocation(SheetLocation)
M: 25 C: 27
52%
M: 6 C: 4
40%
M: 5 C: 1
17%
M: 6 C: 9
60%
M: 0 C: 1
100%
static {...}
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
toString()
M: 37 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emfforms.spi.spreadsheet.core.error.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.common.notify.NotificationChain;
18: import org.eclipse.emf.ecore.EClass;
19: import org.eclipse.emf.ecore.InternalEObject;
20: import org.eclipse.emf.ecore.impl.ENotificationImpl;
21: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
22: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.EMFLocation;
23: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.ErrorPackage;
24: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.ErrorReport;
25: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.Severity;
26: import org.eclipse.emfforms.spi.spreadsheet.core.error.model.SheetLocation;
27:
28: /**
29: * <!-- begin-user-doc -->
30: * An implementation of the model object '<em><b>Report</b></em>'.
31: * <!-- end-user-doc -->
32: * <p>
33: * The following features are implemented:
34: * </p>
35: * <ul>
36: * <li>{@link org.eclipse.emfforms.spi.spreadsheet.core.error.model.impl.ErrorReportImpl#getSeverity <em>Severity</em>}
37: * </li>
38: * <li>{@link org.eclipse.emfforms.spi.spreadsheet.core.error.model.impl.ErrorReportImpl#getMessage <em>Message</em>}
39: * </li>
40: * <li>{@link org.eclipse.emfforms.spi.spreadsheet.core.error.model.impl.ErrorReportImpl#getEmfLocation
41: * <em>Emf Location</em>}</li>
42: * <li>{@link org.eclipse.emfforms.spi.spreadsheet.core.error.model.impl.ErrorReportImpl#getSheetLocation
43: * <em>Sheet Location</em>}</li>
44: * </ul>
45: *
46: * @generated
47: */
48: public class ErrorReportImpl extends MinimalEObjectImpl.Container implements ErrorReport {
49:         /**
50:          * The default value of the '{@link #getSeverity() <em>Severity</em>}' attribute.
51:          * <!-- begin-user-doc -->
52:          * <!-- end-user-doc -->
53:          *
54:          * @see #getSeverity()
55:          * @generated
56:          * @ordered
57:          */
58:         protected static final Severity SEVERITY_EDEFAULT = Severity.OK;
59:
60:         /**
61:          * The cached value of the '{@link #getSeverity() <em>Severity</em>}' attribute.
62:          * <!-- begin-user-doc -->
63:          * <!-- end-user-doc -->
64:          *
65:          * @see #getSeverity()
66:          * @generated
67:          * @ordered
68:          */
69:         protected Severity severity = SEVERITY_EDEFAULT;
70:
71:         /**
72:          * The default value of the '{@link #getMessage() <em>Message</em>}' attribute.
73:          * <!-- begin-user-doc -->
74:          * <!-- end-user-doc -->
75:          *
76:          * @see #getMessage()
77:          * @generated
78:          * @ordered
79:          */
80:         protected static final String MESSAGE_EDEFAULT = null;
81:
82:         /**
83:          * The cached value of the '{@link #getMessage() <em>Message</em>}' attribute.
84:          * <!-- begin-user-doc -->
85:          * <!-- end-user-doc -->
86:          *
87:          * @see #getMessage()
88:          * @generated
89:          * @ordered
90:          */
91:         protected String message = MESSAGE_EDEFAULT;
92:
93:         /**
94:          * The cached value of the '{@link #getEmfLocation() <em>Emf Location</em>}' containment reference.
95:          * <!-- begin-user-doc -->
96:          * <!-- end-user-doc -->
97:          *
98:          * @see #getEmfLocation()
99:          * @generated
100:          * @ordered
101:          */
102:         protected EMFLocation emfLocation;
103:
104:         /**
105:          * The cached value of the '{@link #getSheetLocation() <em>Sheet Location</em>}' containment reference.
106:          * <!-- begin-user-doc -->
107:          * <!-- end-user-doc -->
108:          *
109:          * @see #getSheetLocation()
110:          * @generated
111:          * @ordered
112:          */
113:         protected SheetLocation sheetLocation;
114:
115:         /**
116:          * <!-- begin-user-doc -->
117:          * <!-- end-user-doc -->
118:          *
119:          * @generated
120:          */
121:         protected ErrorReportImpl() {
122:                 super();
123:         }
124:
125:         /**
126:          * <!-- begin-user-doc -->
127:          * <!-- end-user-doc -->
128:          *
129:          * @generated
130:          */
131:         @Override
132:         protected EClass eStaticClass() {
133:                 return ErrorPackage.Literals.ERROR_REPORT;
134:         }
135:
136:         /**
137:          * <!-- begin-user-doc -->
138:          * <!-- end-user-doc -->
139:          *
140:          * @generated
141:          */
142:         @Override
143:         public Severity getSeverity() {
144:                 return severity;
145:         }
146:
147:         /**
148:          * <!-- begin-user-doc -->
149:          * <!-- end-user-doc -->
150:          *
151:          * @generated
152:          */
153:         @Override
154:         public void setSeverity(Severity newSeverity) {
155:                 final Severity oldSeverity = severity;
156:•                severity = newSeverity == null ? SEVERITY_EDEFAULT : newSeverity;
157:•                if (eNotificationRequired()) {
158:                         eNotify(new ENotificationImpl(this, Notification.SET, ErrorPackage.ERROR_REPORT__SEVERITY, oldSeverity,
159:                                 severity));
160:                 }
161:         }
162:
163:         /**
164:          * <!-- begin-user-doc -->
165:          * <!-- end-user-doc -->
166:          *
167:          * @generated
168:          */
169:         @Override
170:         public String getMessage() {
171:                 return message;
172:         }
173:
174:         /**
175:          * <!-- begin-user-doc -->
176:          * <!-- end-user-doc -->
177:          *
178:          * @generated
179:          */
180:         @Override
181:         public void setMessage(String newMessage) {
182:                 final String oldMessage = message;
183:                 message = newMessage;
184:•                if (eNotificationRequired()) {
185:                         eNotify(
186:                                 new ENotificationImpl(this, Notification.SET, ErrorPackage.ERROR_REPORT__MESSAGE, oldMessage, message));
187:                 }
188:         }
189:
190:         /**
191:          * <!-- begin-user-doc -->
192:          * <!-- end-user-doc -->
193:          *
194:          * @generated
195:          */
196:         @Override
197:         public EMFLocation getEmfLocation() {
198:                 return emfLocation;
199:         }
200:
201:         /**
202:          * <!-- begin-user-doc -->
203:          * <!-- end-user-doc -->
204:          *
205:          * @generated
206:          */
207:         public NotificationChain basicSetEmfLocation(EMFLocation newEmfLocation, NotificationChain msgs) {
208:                 final EMFLocation oldEmfLocation = emfLocation;
209:                 emfLocation = newEmfLocation;
210:•                if (eNotificationRequired()) {
211:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
212:                                 ErrorPackage.ERROR_REPORT__EMF_LOCATION, oldEmfLocation, newEmfLocation);
213:•                        if (msgs == null) {
214:                                 msgs = notification;
215:                         } else {
216:                                 msgs.add(notification);
217:                         }
218:                 }
219:                 return msgs;
220:         }
221:
222:         /**
223:          * <!-- begin-user-doc -->
224:          * <!-- end-user-doc -->
225:          *
226:          * @generated
227:          */
228:         @Override
229:         public void setEmfLocation(EMFLocation newEmfLocation) {
230:•                if (newEmfLocation != emfLocation) {
231:                         NotificationChain msgs = null;
232:•                        if (emfLocation != null) {
233:                                 msgs = ((InternalEObject) emfLocation).eInverseRemove(this,
234:                                         EOPPOSITE_FEATURE_BASE - ErrorPackage.ERROR_REPORT__EMF_LOCATION, null, msgs);
235:                         }
236:•                        if (newEmfLocation != null) {
237:                                 msgs = ((InternalEObject) newEmfLocation).eInverseAdd(this,
238:                                         EOPPOSITE_FEATURE_BASE - ErrorPackage.ERROR_REPORT__EMF_LOCATION, null, msgs);
239:                         }
240:                         msgs = basicSetEmfLocation(newEmfLocation, msgs);
241:•                        if (msgs != null) {
242:                                 msgs.dispatch();
243:                         }
244:•                } else if (eNotificationRequired()) {
245:                         eNotify(new ENotificationImpl(this, Notification.SET, ErrorPackage.ERROR_REPORT__EMF_LOCATION,
246:                                 newEmfLocation, newEmfLocation));
247:                 }
248:         }
249:
250:         /**
251:          * <!-- begin-user-doc -->
252:          * <!-- end-user-doc -->
253:          *
254:          * @generated
255:          */
256:         @Override
257:         public SheetLocation getSheetLocation() {
258:                 return sheetLocation;
259:         }
260:
261:         /**
262:          * <!-- begin-user-doc -->
263:          * <!-- end-user-doc -->
264:          *
265:          * @generated
266:          */
267:         public NotificationChain basicSetSheetLocation(SheetLocation newSheetLocation, NotificationChain msgs) {
268:                 final SheetLocation oldSheetLocation = sheetLocation;
269:                 sheetLocation = newSheetLocation;
270:•                if (eNotificationRequired()) {
271:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
272:                                 ErrorPackage.ERROR_REPORT__SHEET_LOCATION, oldSheetLocation, newSheetLocation);
273:•                        if (msgs == null) {
274:                                 msgs = notification;
275:                         } else {
276:                                 msgs.add(notification);
277:                         }
278:                 }
279:                 return msgs;
280:         }
281:
282:         /**
283:          * <!-- begin-user-doc -->
284:          * <!-- end-user-doc -->
285:          *
286:          * @generated
287:          */
288:         @Override
289:         public void setSheetLocation(SheetLocation newSheetLocation) {
290:•                if (newSheetLocation != sheetLocation) {
291:                         NotificationChain msgs = null;
292:•                        if (sheetLocation != null) {
293:                                 msgs = ((InternalEObject) sheetLocation).eInverseRemove(this,
294:                                         EOPPOSITE_FEATURE_BASE - ErrorPackage.ERROR_REPORT__SHEET_LOCATION, null, msgs);
295:                         }
296:•                        if (newSheetLocation != null) {
297:                                 msgs = ((InternalEObject) newSheetLocation).eInverseAdd(this,
298:                                         EOPPOSITE_FEATURE_BASE - ErrorPackage.ERROR_REPORT__SHEET_LOCATION, null, msgs);
299:                         }
300:                         msgs = basicSetSheetLocation(newSheetLocation, msgs);
301:•                        if (msgs != null) {
302:                                 msgs.dispatch();
303:                         }
304:•                } else if (eNotificationRequired()) {
305:                         eNotify(new ENotificationImpl(this, Notification.SET, ErrorPackage.ERROR_REPORT__SHEET_LOCATION,
306:                                 newSheetLocation, newSheetLocation));
307:                 }
308:         }
309:
310:         /**
311:          * <!-- begin-user-doc -->
312:          * <!-- end-user-doc -->
313:          *
314:          * @generated
315:          */
316:         @Override
317:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
318:•                switch (featureID) {
319:                 case ErrorPackage.ERROR_REPORT__EMF_LOCATION:
320:                         return basicSetEmfLocation(null, msgs);
321:                 case ErrorPackage.ERROR_REPORT__SHEET_LOCATION:
322:                         return basicSetSheetLocation(null, msgs);
323:                 }
324:                 return super.eInverseRemove(otherEnd, featureID, msgs);
325:         }
326:
327:         /**
328:          * <!-- begin-user-doc -->
329:          * <!-- end-user-doc -->
330:          *
331:          * @generated
332:          */
333:         @Override
334:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
335:•                switch (featureID) {
336:                 case ErrorPackage.ERROR_REPORT__SEVERITY:
337:                         return getSeverity();
338:                 case ErrorPackage.ERROR_REPORT__MESSAGE:
339:                         return getMessage();
340:                 case ErrorPackage.ERROR_REPORT__EMF_LOCATION:
341:                         return getEmfLocation();
342:                 case ErrorPackage.ERROR_REPORT__SHEET_LOCATION:
343:                         return getSheetLocation();
344:                 }
345:                 return super.eGet(featureID, resolve, coreType);
346:         }
347:
348:         /**
349:          * <!-- begin-user-doc -->
350:          * <!-- end-user-doc -->
351:          *
352:          * @generated
353:          */
354:         @Override
355:         public void eSet(int featureID, Object newValue) {
356:•                switch (featureID) {
357:                 case ErrorPackage.ERROR_REPORT__SEVERITY:
358:                         setSeverity((Severity) newValue);
359:                         return;
360:                 case ErrorPackage.ERROR_REPORT__MESSAGE:
361:                         setMessage((String) newValue);
362:                         return;
363:                 case ErrorPackage.ERROR_REPORT__EMF_LOCATION:
364:                         setEmfLocation((EMFLocation) newValue);
365:                         return;
366:                 case ErrorPackage.ERROR_REPORT__SHEET_LOCATION:
367:                         setSheetLocation((SheetLocation) newValue);
368:                         return;
369:                 }
370:                 super.eSet(featureID, newValue);
371:         }
372:
373:         /**
374:          * <!-- begin-user-doc -->
375:          * <!-- end-user-doc -->
376:          *
377:          * @generated
378:          */
379:         @Override
380:         public void eUnset(int featureID) {
381:•                switch (featureID) {
382:                 case ErrorPackage.ERROR_REPORT__SEVERITY:
383:                         setSeverity(SEVERITY_EDEFAULT);
384:                         return;
385:                 case ErrorPackage.ERROR_REPORT__MESSAGE:
386:                         setMessage(MESSAGE_EDEFAULT);
387:                         return;
388:                 case ErrorPackage.ERROR_REPORT__EMF_LOCATION:
389:                         setEmfLocation((EMFLocation) null);
390:                         return;
391:                 case ErrorPackage.ERROR_REPORT__SHEET_LOCATION:
392:                         setSheetLocation((SheetLocation) null);
393:                         return;
394:                 }
395:                 super.eUnset(featureID);
396:         }
397:
398:         /**
399:          * <!-- begin-user-doc -->
400:          * <!-- end-user-doc -->
401:          *
402:          * @generated
403:          */
404:         @Override
405:         public boolean eIsSet(int featureID) {
406:•                switch (featureID) {
407:                 case ErrorPackage.ERROR_REPORT__SEVERITY:
408:•                        return severity != SEVERITY_EDEFAULT;
409:                 case ErrorPackage.ERROR_REPORT__MESSAGE:
410:•                        return MESSAGE_EDEFAULT == null ? message != null : !MESSAGE_EDEFAULT.equals(message);
411:                 case ErrorPackage.ERROR_REPORT__EMF_LOCATION:
412:•                        return emfLocation != null;
413:                 case ErrorPackage.ERROR_REPORT__SHEET_LOCATION:
414:•                        return sheetLocation != null;
415:                 }
416:                 return super.eIsSet(featureID);
417:         }
418:
419:         /**
420:          * <!-- begin-user-doc -->
421:          * <!-- end-user-doc -->
422:          *
423:          * @generated
424:          */
425:         @Override
426:         public String toString() {
427:•                if (eIsProxy()) {
428:                         return super.toString();
429:                 }
430:
431:                 final StringBuffer result = new StringBuffer(super.toString());
432:                 result.append(" (severity: "); //$NON-NLS-1$
433:                 result.append(severity);
434:                 result.append(", message: "); //$NON-NLS-1$
435:                 result.append(message);
436:                 result.append(')');
437:                 return result.toString();
438:         }
439:
440: } // ErrorReportImpl