Skip to content

Package: VDiffmergePackageImpl

VDiffmergePackageImpl

nameinstructionbranchcomplexitylinemethod
VDiffmergePackageImpl()
M: 0 C: 14
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
createPackageContents()
M: 1 C: 22
96%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 6
86%
M: 0 C: 1
100%
getDiffAttachment()
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%
getDiffAttachment_MergedDiffs()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getDiffAttachment_TotalNumberOfDiffs()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getDiffmergeFactory()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
init()
M: 9 C: 30
77%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 1 C: 11
92%
M: 0 C: 1
100%
initializePackageContents()
M: 1 C: 84
99%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 21
95%
M: 0 C: 1
100%
static {...}
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%

Coverage

1: /**
2: * Copyright (c) 2011-2014 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: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.spi.diffmerge.model.impl;
15:
16: import org.eclipse.emf.ecore.EAttribute;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.EPackage;
19: import org.eclipse.emf.ecore.impl.EPackageImpl;
20: import org.eclipse.emf.ecp.spi.diffmerge.model.VDiffAttachment;
21: import org.eclipse.emf.ecp.spi.diffmerge.model.VDiffmergeFactory;
22: import org.eclipse.emf.ecp.spi.diffmerge.model.VDiffmergePackage;
23: import org.eclipse.emf.ecp.view.spi.model.VViewPackage;
24:
25: /**
26: * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!--
27: * end-user-doc -->
28: *
29: * @generated
30: */
31: public class VDiffmergePackageImpl extends EPackageImpl implements
32:         VDiffmergePackage {
33:         /**
34:          * <!-- begin-user-doc --> <!-- end-user-doc -->
35:          *
36:          * @generated
37:          */
38:         private EClass diffAttachmentEClass = null;
39:
40:         /**
41:          * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
42:          * EPackage.Registry} by the
43:          * package package URI value.
44:          * <p>
45:          * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also
46:          * performs initialization of the package, or returns the registered package, if one already exists. <!--
47:          * begin-user-doc --> <!-- end-user-doc -->
48:          *
49:          * @see org.eclipse.emf.ecore.EPackage.Registry
50:          * @see org.eclipse.emf.ecp.spi.diffmerge.model.VDiffmergePackage#eNS_URI
51:          * @see #init()
52:          * @generated
53:          */
54:         private VDiffmergePackageImpl() {
55:                 super(eNS_URI, VDiffmergeFactory.eINSTANCE);
56:         }
57:
58:         /**
59:          * <!-- begin-user-doc --> <!-- end-user-doc -->
60:          *
61:          * @generated
62:          */
63:         private static boolean isInited = false;
64:
65:         /**
66:          * Creates, registers, and initializes the <b>Package</b> for this model,
67:          * and for any others upon which it depends.
68:          *
69:          * <p>
70:          * This method is used to initialize {@link VDiffmergePackage#eINSTANCE} when that field is accessed. Clients should
71:          * not invoke it directly. Instead, they should simply access that field to obtain the package. <!-- begin-user-doc
72:          * --> <!-- end-user-doc -->
73:          *
74:          * @see #eNS_URI
75:          * @see #createPackageContents()
76:          * @see #initializePackageContents()
77:          * @generated
78:          */
79:         public static VDiffmergePackage init() {
80:•                if (isInited) {
81:                         return (VDiffmergePackage) EPackage.Registry.INSTANCE.getEPackage(VDiffmergePackage.eNS_URI);
82:                 }
83:
84:                 // Obtain or create and register package
85:                 final VDiffmergePackageImpl theDiffmergePackage = (VDiffmergePackageImpl) (EPackage.Registry.INSTANCE
86:•                        .get(eNS_URI) instanceof VDiffmergePackageImpl ? EPackage.Registry.INSTANCE
87:                                 .get(eNS_URI) : new VDiffmergePackageImpl());
88:
89:                 isInited = true;
90:
91:                 // Initialize simple dependencies
92:                 VViewPackage.eINSTANCE.eClass();
93:
94:                 // Create package meta-data objects
95:                 theDiffmergePackage.createPackageContents();
96:
97:                 // Initialize created meta-data
98:                 theDiffmergePackage.initializePackageContents();
99:
100:                 // Mark meta-data to indicate it can't be changed
101:                 theDiffmergePackage.freeze();
102:
103:                 // Update the registry and return the package
104:                 EPackage.Registry.INSTANCE.put(VDiffmergePackage.eNS_URI, theDiffmergePackage);
105:                 return theDiffmergePackage;
106:         }
107:
108:         /**
109:          * <!-- begin-user-doc --> <!-- end-user-doc -->
110:          *
111:          * @generated
112:          */
113:         @Override
114:         public EClass getDiffAttachment() {
115:                 return diffAttachmentEClass;
116:         }
117:
118:         /**
119:          * <!-- begin-user-doc -->
120:          * <!-- end-user-doc -->
121:          *
122:          * @generated
123:          */
124:         @Override
125:         public EAttribute getDiffAttachment_TotalNumberOfDiffs() {
126:                 return (EAttribute) diffAttachmentEClass.getEStructuralFeatures().get(0);
127:         }
128:
129:         /**
130:          * <!-- begin-user-doc -->
131:          * <!-- end-user-doc -->
132:          *
133:          * @generated
134:          */
135:         @Override
136:         public EAttribute getDiffAttachment_MergedDiffs() {
137:                 return (EAttribute) diffAttachmentEClass.getEStructuralFeatures().get(1);
138:         }
139:
140:         /**
141:          * <!-- begin-user-doc --> <!-- end-user-doc -->
142:          *
143:          * @generated
144:          */
145:         @Override
146:         public VDiffmergeFactory getDiffmergeFactory() {
147:                 return (VDiffmergeFactory) getEFactoryInstance();
148:         }
149:
150:         /**
151:          * <!-- begin-user-doc --> <!-- end-user-doc -->
152:          *
153:          * @generated
154:          */
155:         private boolean isCreated = false;
156:
157:         /**
158:          * Creates the meta-model objects for the package. This method is
159:          * guarded to have no affect on any invocation but its first.
160:          * <!-- begin-user-doc -->
161:          * <!-- end-user-doc -->
162:          *
163:          * @generated
164:          */
165:         public void createPackageContents() {
166:•                if (isCreated) {
167:                         return;
168:                 }
169:                 isCreated = true;
170:
171:                 // Create classes and their features
172:                 diffAttachmentEClass = createEClass(DIFF_ATTACHMENT);
173:                 createEAttribute(diffAttachmentEClass, DIFF_ATTACHMENT__TOTAL_NUMBER_OF_DIFFS);
174:                 createEAttribute(diffAttachmentEClass, DIFF_ATTACHMENT__MERGED_DIFFS);
175:         }
176:
177:         /**
178:          * <!-- begin-user-doc --> <!-- end-user-doc -->
179:          *
180:          * @generated
181:          */
182:         private boolean isInitialized = false;
183:
184:         /**
185:          * Complete the initialization of the package and its meta-model. This
186:          * method is guarded to have no affect on any invocation but its first. <!--
187:          * begin-user-doc --> <!-- end-user-doc -->
188:          *
189:          * @generated
190:          */
191:         public void initializePackageContents() {
192:•                if (isInitialized) {
193:                         return;
194:                 }
195:                 isInitialized = true;
196:
197:                 // Initialize package
198:                 setName(eNAME);
199:                 setNsPrefix(eNS_PREFIX);
200:                 setNsURI(eNS_URI);
201:
202:                 // Obtain other dependent packages
203:                 final VViewPackage theViewPackage = (VViewPackage) EPackage.Registry.INSTANCE.getEPackage(VViewPackage.eNS_URI);
204:
205:                 // Create type parameters
206:
207:                 // Set bounds for type parameters
208:
209:                 // Add supertypes to classes
210:                 diffAttachmentEClass.getESuperTypes().add(theViewPackage.getAttachment());
211:
212:                 // Initialize classes and features; add operations and parameters
213:                 initEClass(diffAttachmentEClass, VDiffAttachment.class,
214:                         "DiffAttachment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
215:                 initEAttribute(
216:                         getDiffAttachment_TotalNumberOfDiffs(),
217:                         ecorePackage.getEInt(),
218:                         "totalNumberOfDiffs", "0", 1, 1, VDiffAttachment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, //$NON-NLS-1$ //$NON-NLS-2$
219:                         !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
220:                 initEAttribute(
221:                         getDiffAttachment_MergedDiffs(),
222:                         ecorePackage.getEInt(),
223:                         "mergedDiffs", "0", 0, 1, VDiffAttachment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, //$NON-NLS-1$ //$NON-NLS-2$
224:                         !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
225:
226:                 // Create resource
227:                 createResource(eNS_URI);
228:         }
229:
230: } // VDiffmergePackageImpl