Skip to content

Package: VMappingDomainModelReferenceSegmentImpl

VMappingDomainModelReferenceSegmentImpl

nameinstructionbranchcomplexitylinemethod
VMappingDomainModelReferenceSegmentImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
basicGetMappedClass()
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%
eGet(int, boolean, boolean)
M: 9 C: 7
44%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 3
60%
M: 0 C: 1
100%
eIsSet(int)
M: 13 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 12 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
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: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getMappedClass()
M: 28 C: 10
26%
M: 5 C: 3
38%
M: 3 C: 2
40%
M: 7 C: 2
22%
M: 0 C: 1
100%
setMappedClass(EClass)
M: 0 C: 21
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 7
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2018 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: * Lucas Koehler - initial API and implementation
13: */
14: package org.eclipse.emfforms.spi.view.mappingsegment.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.InternalEObject;
19: import org.eclipse.emf.ecore.impl.ENotificationImpl;
20: import org.eclipse.emf.ecp.view.spi.model.impl.VFeatureDomainModelReferenceSegmentImpl;
21: import org.eclipse.emfforms.spi.view.mappingsegment.model.VMappingDomainModelReferenceSegment;
22: import org.eclipse.emfforms.spi.view.mappingsegment.model.VMappingsegmentPackage;
23:
24: /**
25: * <!-- begin-user-doc -->
26: * An implementation of the model object '<em><b>Mapping Domain Model Reference Segment</b></em>'.
27: * <!-- end-user-doc -->
28: * <p>
29: * The following features are implemented:
30: * </p>
31: * <ul>
32: * <li>{@link org.eclipse.emfforms.spi.view.mappingsegment.model.impl.VMappingDomainModelReferenceSegmentImpl#getMappedClass
33: * <em>Mapped Class</em>}</li>
34: * </ul>
35: *
36: * @generated
37: */
38: public class VMappingDomainModelReferenceSegmentImpl extends VFeatureDomainModelReferenceSegmentImpl
39:         implements VMappingDomainModelReferenceSegment {
40:         /**
41:          * The cached value of the '{@link #getMappedClass() <em>Mapped Class</em>}' reference.
42:          * <!-- begin-user-doc -->
43:          * <!-- end-user-doc -->
44:          *
45:          * @see #getMappedClass()
46:          * @generated
47:          * @ordered
48:          */
49:         protected EClass mappedClass;
50:
51:         /**
52:          * <!-- begin-user-doc -->
53:          * <!-- end-user-doc -->
54:          *
55:          * @generated
56:          */
57:         protected VMappingDomainModelReferenceSegmentImpl() {
58:                 super();
59:         }
60:
61:         /**
62:          * <!-- begin-user-doc -->
63:          * <!-- end-user-doc -->
64:          *
65:          * @generated
66:          */
67:         @Override
68:         protected EClass eStaticClass() {
69:                 return VMappingsegmentPackage.Literals.MAPPING_DOMAIN_MODEL_REFERENCE_SEGMENT;
70:         }
71:
72:         /**
73:          * <!-- begin-user-doc -->
74:          * <!-- end-user-doc -->
75:          *
76:          * @generated
77:          */
78:         @Override
79:         public EClass getMappedClass() {
80:•                if (mappedClass != null && mappedClass.eIsProxy()) {
81:                         final InternalEObject oldMappedClass = (InternalEObject) mappedClass;
82:                         mappedClass = (EClass) eResolveProxy(oldMappedClass);
83:•                        if (mappedClass != oldMappedClass) {
84:•                                if (eNotificationRequired()) {
85:                                         eNotify(new ENotificationImpl(this, Notification.RESOLVE,
86:                                                 VMappingsegmentPackage.MAPPING_DOMAIN_MODEL_REFERENCE_SEGMENT__MAPPED_CLASS, oldMappedClass,
87:                                                 mappedClass));
88:                                 }
89:                         }
90:                 }
91:                 return mappedClass;
92:         }
93:
94:         /**
95:          * <!-- begin-user-doc -->
96:          * <!-- end-user-doc -->
97:          *
98:          * @generated
99:          */
100:         public EClass basicGetMappedClass() {
101:                 return mappedClass;
102:         }
103:
104:         /**
105:          * <!-- begin-user-doc -->
106:          * <!-- end-user-doc -->
107:          *
108:          * @generated
109:          */
110:         @Override
111:         public void setMappedClass(EClass newMappedClass) {
112:                 final EClass oldMappedClass = mappedClass;
113:                 mappedClass = newMappedClass;
114:•                if (eNotificationRequired()) {
115:                         eNotify(new ENotificationImpl(this, Notification.SET,
116:                                 VMappingsegmentPackage.MAPPING_DOMAIN_MODEL_REFERENCE_SEGMENT__MAPPED_CLASS, oldMappedClass,
117:                                 mappedClass));
118:                 }
119:         }
120:
121:         /**
122:          * <!-- begin-user-doc -->
123:          * <!-- end-user-doc -->
124:          *
125:          * @generated
126:          */
127:         @Override
128:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
129:•                switch (featureID) {
130:                 case VMappingsegmentPackage.MAPPING_DOMAIN_MODEL_REFERENCE_SEGMENT__MAPPED_CLASS:
131:•                        if (resolve) {
132:                                 return getMappedClass();
133:                         }
134:                         return basicGetMappedClass();
135:                 }
136:                 return super.eGet(featureID, resolve, coreType);
137:         }
138:
139:         /**
140:          * <!-- begin-user-doc -->
141:          * <!-- end-user-doc -->
142:          *
143:          * @generated
144:          */
145:         @Override
146:         public void eSet(int featureID, Object newValue) {
147:•                switch (featureID) {
148:                 case VMappingsegmentPackage.MAPPING_DOMAIN_MODEL_REFERENCE_SEGMENT__MAPPED_CLASS:
149:                         setMappedClass((EClass) newValue);
150:                         return;
151:                 }
152:                 super.eSet(featureID, newValue);
153:         }
154:
155:         /**
156:          * <!-- begin-user-doc -->
157:          * <!-- end-user-doc -->
158:          *
159:          * @generated
160:          */
161:         @Override
162:         public void eUnset(int featureID) {
163:•                switch (featureID) {
164:                 case VMappingsegmentPackage.MAPPING_DOMAIN_MODEL_REFERENCE_SEGMENT__MAPPED_CLASS:
165:                         setMappedClass((EClass) null);
166:                         return;
167:                 }
168:                 super.eUnset(featureID);
169:         }
170:
171:         /**
172:          * <!-- begin-user-doc -->
173:          * <!-- end-user-doc -->
174:          *
175:          * @generated
176:          */
177:         @Override
178:         public boolean eIsSet(int featureID) {
179:•                switch (featureID) {
180:                 case VMappingsegmentPackage.MAPPING_DOMAIN_MODEL_REFERENCE_SEGMENT__MAPPED_CLASS:
181:•                        return mappedClass != null;
182:                 }
183:                 return super.eIsSet(featureID);
184:         }
185:
186: } // VMappingDomainModelReferenceSegmentImpl