Skip to content

Package: TestPackageImpl

TestPackageImpl

nameinstructionbranchcomplexitylinemethod
TestPackageImpl()
M: 0 C: 20
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
createPackageContents()
M: 1 C: 37
97%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 9
90%
M: 0 C: 1
100%
getComponent()
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%
getComponent2()
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%
getComponent2_Composites()
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%
getComponent_Component()
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%
getComposite()
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%
getComposite_Composites()
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%
getTestFactory()
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: 27
75%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 10
83%
M: 0 C: 1
100%
initializePackageContents()
M: 1 C: 123
99%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 23
96%
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-2013 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 Muenchen GmbH - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.ui.view.editor.test.model.test.impl;
15:
16: import org.eclipse.emf.ecore.EClass;
17: import org.eclipse.emf.ecore.EPackage;
18: import org.eclipse.emf.ecore.EReference;
19: import org.eclipse.emf.ecore.impl.EPackageImpl;
20: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.Component;
21: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.Component2;
22: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.Composite;
23: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.TestFactory;
24: import org.eclipse.emf.ecp.ui.view.editor.test.model.test.TestPackage;
25:
26: /**
27: * <!-- begin-user-doc -->
28: * An implementation of the model <b>Package</b>.
29: * <!-- end-user-doc -->
30: *
31: * @generated
32: */
33: public class TestPackageImpl extends EPackageImpl implements TestPackage {
34:         /**
35:          * <!-- begin-user-doc -->
36:          * <!-- end-user-doc -->
37:          *
38:          * @generated
39:          */
40:         private EClass componentEClass = null;
41:
42:         /**
43:          * <!-- begin-user-doc -->
44:          * <!-- end-user-doc -->
45:          *
46:          * @generated
47:          */
48:         private EClass compositeEClass = null;
49:
50:         /**
51:          * <!-- begin-user-doc -->
52:          * <!-- end-user-doc -->
53:          *
54:          * @generated
55:          */
56:         private EClass component2EClass = null;
57:
58:         /**
59:          * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
60:          * EPackage.Registry} by the package
61:          * package URI value.
62:          * <p>
63:          * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also
64:          * performs initialization of the package, or returns the registered package, if one already exists. <!--
65:          * begin-user-doc --> <!-- end-user-doc -->
66:          *
67:          * @see org.eclipse.emf.ecore.EPackage.Registry
68:          * @see org.eclipse.emf.ecp.ui.view.editor.test.model.test.TestPackage#eNS_URI
69:          * @see #init()
70:          * @generated
71:          */
72:         private TestPackageImpl() {
73:                 super(eNS_URI, TestFactory.eINSTANCE);
74:         }
75:
76:         /**
77:          * <!-- begin-user-doc -->
78:          * <!-- end-user-doc -->
79:          *
80:          * @generated
81:          */
82:         private static boolean isInited = false;
83:
84:         /**
85:          * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
86:          *
87:          * <p>
88:          * This method is used to initialize {@link TestPackage#eINSTANCE} when that field is accessed. Clients should not
89:          * invoke it directly. Instead, they should simply access that field to obtain the package. <!-- begin-user-doc -->
90:          * <!-- end-user-doc -->
91:          *
92:          * @see #eNS_URI
93:          * @see #createPackageContents()
94:          * @see #initializePackageContents()
95:          * @generated
96:          */
97:         public static TestPackage init() {
98:•                if (isInited) {
99:                         return (TestPackage) EPackage.Registry.INSTANCE.getEPackage(TestPackage.eNS_URI);
100:                 }
101:
102:                 // Obtain or create and register package
103:                 final TestPackageImpl theTestPackage = (TestPackageImpl) (EPackage.Registry.INSTANCE
104:•                        .get(eNS_URI) instanceof TestPackageImpl ? EPackage.Registry.INSTANCE
105:                                 .get(eNS_URI)
106:                                 : new TestPackageImpl());
107:
108:                 isInited = true;
109:
110:                 // Create package meta-data objects
111:                 theTestPackage.createPackageContents();
112:
113:                 // Initialize created meta-data
114:                 theTestPackage.initializePackageContents();
115:
116:                 // Mark meta-data to indicate it can't be changed
117:                 theTestPackage.freeze();
118:
119:                 // Update the registry and return the package
120:                 EPackage.Registry.INSTANCE.put(TestPackage.eNS_URI, theTestPackage);
121:                 return theTestPackage;
122:         }
123:
124:         /**
125:          * <!-- begin-user-doc -->
126:          * <!-- end-user-doc -->
127:          *
128:          * @generated
129:          */
130:         @Override
131:         public EClass getComponent() {
132:                 return componentEClass;
133:         }
134:
135:         /**
136:          * <!-- begin-user-doc -->
137:          * <!-- end-user-doc -->
138:          *
139:          * @generated
140:          */
141:         @Override
142:         public EReference getComponent_Component() {
143:                 return (EReference) componentEClass.getEStructuralFeatures().get(0);
144:         }
145:
146:         /**
147:          * <!-- begin-user-doc -->
148:          * <!-- end-user-doc -->
149:          *
150:          * @generated
151:          */
152:         @Override
153:         public EClass getComposite() {
154:                 return compositeEClass;
155:         }
156:
157:         /**
158:          * <!-- begin-user-doc -->
159:          * <!-- end-user-doc -->
160:          *
161:          * @generated
162:          */
163:         @Override
164:         public EReference getComposite_Composites() {
165:                 return (EReference) compositeEClass.getEStructuralFeatures().get(0);
166:         }
167:
168:         /**
169:          * <!-- begin-user-doc -->
170:          * <!-- end-user-doc -->
171:          *
172:          * @generated
173:          */
174:         @Override
175:         public EClass getComponent2() {
176:                 return component2EClass;
177:         }
178:
179:         /**
180:          * <!-- begin-user-doc -->
181:          * <!-- end-user-doc -->
182:          *
183:          * @generated
184:          */
185:         @Override
186:         public EReference getComponent2_Composites() {
187:                 return (EReference) component2EClass.getEStructuralFeatures().get(0);
188:         }
189:
190:         /**
191:          * <!-- begin-user-doc -->
192:          * <!-- end-user-doc -->
193:          *
194:          * @generated
195:          */
196:         @Override
197:         public TestFactory getTestFactory() {
198:                 return (TestFactory) getEFactoryInstance();
199:         }
200:
201:         /**
202:          * <!-- begin-user-doc -->
203:          * <!-- end-user-doc -->
204:          *
205:          * @generated
206:          */
207:         private boolean isCreated = false;
208:
209:         /**
210:          * Creates the meta-model objects for the package. This method is
211:          * guarded to have no affect on any invocation but its first.
212:          * <!-- begin-user-doc -->
213:          * <!-- end-user-doc -->
214:          *
215:          * @generated
216:          */
217:         public void createPackageContents() {
218:•                if (isCreated) {
219:                         return;
220:                 }
221:                 isCreated = true;
222:
223:                 // Create classes and their features
224:                 componentEClass = createEClass(COMPONENT);
225:                 createEReference(componentEClass, COMPONENT__COMPONENT);
226:
227:                 compositeEClass = createEClass(COMPOSITE);
228:                 createEReference(compositeEClass, COMPOSITE__COMPOSITES);
229:
230:                 component2EClass = createEClass(COMPONENT2);
231:                 createEReference(component2EClass, COMPONENT2__COMPOSITES);
232:         }
233:
234:         /**
235:          * <!-- begin-user-doc -->
236:          * <!-- end-user-doc -->
237:          *
238:          * @generated
239:          */
240:         private boolean isInitialized = false;
241:
242:         /**
243:          * Complete the initialization of the package and its meta-model. This
244:          * method is guarded to have no affect on any invocation but its first.
245:          * <!-- begin-user-doc -->
246:          * <!-- end-user-doc -->
247:          *
248:          * @generated
249:          */
250:         public void initializePackageContents() {
251:•                if (isInitialized) {
252:                         return;
253:                 }
254:                 isInitialized = true;
255:
256:                 // Initialize package
257:                 setName(eNAME);
258:                 setNsPrefix(eNS_PREFIX);
259:                 setNsURI(eNS_URI);
260:
261:                 // Create type parameters
262:
263:                 // Set bounds for type parameters
264:
265:                 // Add supertypes to classes
266:                 compositeEClass.getESuperTypes().add(getComponent());
267:
268:                 // Initialize classes, features, and operations; add parameters
269:                 initEClass(componentEClass, Component.class, "Component", !IS_ABSTRACT, !IS_INTERFACE,
270:                         IS_GENERATED_INSTANCE_CLASS);
271:                 initEReference(getComponent_Component(), getComponent2(), null, "component", null, 0, 1, Component.class,
272:                         !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
273:                         !IS_DERIVED, IS_ORDERED);
274:
275:                 initEClass(compositeEClass, Composite.class, "Composite", !IS_ABSTRACT, !IS_INTERFACE,
276:                         IS_GENERATED_INSTANCE_CLASS);
277:                 initEReference(getComposite_Composites(), getComponent(), null, "composites", null, 0, -1, Composite.class,
278:                         !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
279:                         !IS_DERIVED, IS_ORDERED);
280:
281:                 initEClass(component2EClass, Component2.class, "Component2", !IS_ABSTRACT, !IS_INTERFACE,
282:                         IS_GENERATED_INSTANCE_CLASS);
283:                 initEReference(getComponent2_Composites(), getComposite(), null, "composites", null, 0, -1, Component2.class,
284:                         !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
285:                         !IS_DERIVED, IS_ORDERED);
286:
287:                 // Create resource
288:                 createResource(eNS_URI);
289:         }
290:
291: } // TestPackageImpl