Skip to content

Package: VAnnotationImpl

VAnnotationImpl

nameinstructionbranchcomplexitylinemethod
VAnnotationImpl()
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%
eGet(int, boolean, boolean)
M: 6 C: 8
57%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
eIsSet(int)
M: 20 C: 22
52%
M: 7 C: 8
53%
M: 5 C: 4
44%
M: 1 C: 3
75%
M: 0 C: 1
100%
eSet(int, Object)
M: 5 C: 12
71%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 2 C: 5
71%
M: 0 C: 1
100%
eStaticClass()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
eUnset(int)
M: 14 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
getKey()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getValue()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setKey(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 4
80%
M: 0 C: 1
100%
setValue(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%
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.emf.emfforms.spi.view.annotation.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.impl.ENotificationImpl;
19: import org.eclipse.emf.ecp.view.spi.model.impl.VAttachmentImpl;
20: import org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotation;
21: import org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotationPackage;
22:
23: /**
24: * <!-- begin-user-doc -->
25: * An implementation of the model object '<em><b>Annotation</b></em>'.
26: * <!-- end-user-doc -->
27: * <p>
28: * The following features are implemented:
29: * </p>
30: * <ul>
31: * <li>{@link org.eclipse.emf.emfforms.spi.view.annotation.model.impl.VAnnotationImpl#getKey <em>Key</em>}</li>
32: * <li>{@link org.eclipse.emf.emfforms.spi.view.annotation.model.impl.VAnnotationImpl#getValue <em>Value</em>}</li>
33: * </ul>
34: *
35: * @generated
36: */
37: public class VAnnotationImpl extends VAttachmentImpl implements VAnnotation {
38:         /**
39:          * The default value of the '{@link #getKey() <em>Key</em>}' attribute.
40:          * <!-- begin-user-doc -->
41:          * <!-- end-user-doc -->
42:          *
43:          * @see #getKey()
44:          * @generated
45:          * @ordered
46:          */
47:         protected static final String KEY_EDEFAULT = null;
48:
49:         /**
50:          * The cached value of the '{@link #getKey() <em>Key</em>}' attribute.
51:          * <!-- begin-user-doc -->
52:          * <!-- end-user-doc -->
53:          *
54:          * @see #getKey()
55:          * @generated
56:          * @ordered
57:          */
58:         protected String key = KEY_EDEFAULT;
59:
60:         /**
61:          * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
62:          * <!-- begin-user-doc -->
63:          * <!-- end-user-doc -->
64:          *
65:          * @see #getValue()
66:          * @generated
67:          * @ordered
68:          */
69:         protected static final String VALUE_EDEFAULT = null;
70:
71:         /**
72:          * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
73:          * <!-- begin-user-doc -->
74:          * <!-- end-user-doc -->
75:          *
76:          * @see #getValue()
77:          * @generated
78:          * @ordered
79:          */
80:         protected String value = VALUE_EDEFAULT;
81:
82:         /**
83:          * <!-- begin-user-doc -->
84:          * <!-- end-user-doc -->
85:          *
86:          * @generated
87:          */
88:         protected VAnnotationImpl() {
89:                 super();
90:         }
91:
92:         /**
93:          * <!-- begin-user-doc -->
94:          * <!-- end-user-doc -->
95:          *
96:          * @generated
97:          */
98:         @Override
99:         protected EClass eStaticClass() {
100:                 return VAnnotationPackage.Literals.ANNOTATION;
101:         }
102:
103:         /**
104:          * <!-- begin-user-doc -->
105:          * <!-- end-user-doc -->
106:          *
107:          * @generated
108:          */
109:         @Override
110:         public String getKey() {
111:                 return key;
112:         }
113:
114:         /**
115:          * <!-- begin-user-doc -->
116:          * <!-- end-user-doc -->
117:          *
118:          * @generated
119:          */
120:         @Override
121:         public void setKey(String newKey) {
122:                 final String oldKey = key;
123:                 key = newKey;
124:•                if (eNotificationRequired()) {
125:                         eNotify(new ENotificationImpl(this, Notification.SET, VAnnotationPackage.ANNOTATION__KEY, oldKey, key));
126:                 }
127:         }
128:
129:         /**
130:          * <!-- begin-user-doc -->
131:          * <!-- end-user-doc -->
132:          *
133:          * @generated
134:          */
135:         @Override
136:         public String getValue() {
137:                 return value;
138:         }
139:
140:         /**
141:          * <!-- begin-user-doc -->
142:          * <!-- end-user-doc -->
143:          *
144:          * @generated
145:          */
146:         @Override
147:         public void setValue(String newValue) {
148:                 final String oldValue = value;
149:                 value = newValue;
150:•                if (eNotificationRequired()) {
151:                         eNotify(
152:                                 new ENotificationImpl(this, Notification.SET, VAnnotationPackage.ANNOTATION__VALUE, oldValue, value));
153:                 }
154:         }
155:
156:         /**
157:          * <!-- begin-user-doc -->
158:          * <!-- end-user-doc -->
159:          *
160:          * @generated
161:          */
162:         @Override
163:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
164:•                switch (featureID) {
165:                 case VAnnotationPackage.ANNOTATION__KEY:
166:                         return getKey();
167:                 case VAnnotationPackage.ANNOTATION__VALUE:
168:                         return getValue();
169:                 }
170:                 return super.eGet(featureID, resolve, coreType);
171:         }
172:
173:         /**
174:          * <!-- begin-user-doc -->
175:          * <!-- end-user-doc -->
176:          *
177:          * @generated
178:          */
179:         @Override
180:         public void eSet(int featureID, Object newValue) {
181:•                switch (featureID) {
182:                 case VAnnotationPackage.ANNOTATION__KEY:
183:                         setKey((String) newValue);
184:                         return;
185:                 case VAnnotationPackage.ANNOTATION__VALUE:
186:                         setValue((String) newValue);
187:                         return;
188:                 }
189:                 super.eSet(featureID, newValue);
190:         }
191:
192:         /**
193:          * <!-- begin-user-doc -->
194:          * <!-- end-user-doc -->
195:          *
196:          * @generated
197:          */
198:         @Override
199:         public void eUnset(int featureID) {
200:•                switch (featureID) {
201:                 case VAnnotationPackage.ANNOTATION__KEY:
202:                         setKey(KEY_EDEFAULT);
203:                         return;
204:                 case VAnnotationPackage.ANNOTATION__VALUE:
205:                         setValue(VALUE_EDEFAULT);
206:                         return;
207:                 }
208:                 super.eUnset(featureID);
209:         }
210:
211:         /**
212:          * <!-- begin-user-doc -->
213:          * <!-- end-user-doc -->
214:          *
215:          * @generated
216:          */
217:         @Override
218:         public boolean eIsSet(int featureID) {
219:•                switch (featureID) {
220:                 case VAnnotationPackage.ANNOTATION__KEY:
221:•                        return KEY_EDEFAULT == null ? key != null : !KEY_EDEFAULT.equals(key);
222:                 case VAnnotationPackage.ANNOTATION__VALUE:
223:•                        return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
224:                 }
225:                 return super.eIsSet(featureID);
226:         }
227:
228:         /**
229:          * <!-- begin-user-doc -->
230:          * <!-- end-user-doc -->
231:          *
232:          * @generated
233:          */
234:         @Override
235:         public String toString() {
236:•                if (eIsProxy()) {
237:                         return super.toString();
238:                 }
239:
240:                 final StringBuffer result = new StringBuffer(super.toString());
241:                 result.append(" (key: "); //$NON-NLS-1$
242:                 result.append(key);
243:                 result.append(", value: "); //$NON-NLS-1$
244:                 result.append(value);
245:                 result.append(')');
246:                 return result.toString();
247:         }
248:
249: } // VAnnotationImpl