Skip to content

Package: ExamplePackageImpl

ExamplePackageImpl

nameinstructionbranchcomplexitylinemethod
ExamplePackageImpl()
M: 0 C: 35
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 12
100%
M: 0 C: 1
100%
createPackageContents()
M: 1 C: 87
99%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 19
95%
M: 0 C: 1
100%
getAbstractChild()
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%
getChild()
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%
getChild_IntermediateTarget()
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%
getContainer()
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%
getContainer_Children()
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%
getEClassToAdditionMap()
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%
getEClassToAdditionMap_Key()
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%
getEClassToAdditionMap_Value()
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%
getExampleFactory()
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%
getIntermediate()
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%
getIntermediateTarget()
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%
getIntermediateTarget_Target()
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%
getIntermediate_Container()
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%
getRoot()
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%
getRoot_Intermediate()
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%
getTarget()
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%
getTarget_Name()
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%
init()
M: 9 C: 30
77%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 11
85%
M: 0 C: 1
100%
initializePackageContents()
M: 1 C: 287
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 46
98%
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: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.mapping.test.example.impl;
15:
16: import java.util.Map;
17:
18: import org.eclipse.emf.ecore.EAttribute;
19: import org.eclipse.emf.ecore.EClass;
20: import org.eclipse.emf.ecore.EPackage;
21: import org.eclipse.emf.ecore.EReference;
22: import org.eclipse.emf.ecore.EcorePackage;
23: import org.eclipse.emf.ecore.impl.EPackageImpl;
24: import org.eclipse.emf.ecp.view.mapping.test.example.AbstractChild;
25: import org.eclipse.emf.ecp.view.mapping.test.example.Child;
26: import org.eclipse.emf.ecp.view.mapping.test.example.ExampleFactory;
27: import org.eclipse.emf.ecp.view.mapping.test.example.ExamplePackage;
28: import org.eclipse.emf.ecp.view.mapping.test.example.Intermediate;
29: import org.eclipse.emf.ecp.view.mapping.test.example.IntermediateTarget;
30: import org.eclipse.emf.ecp.view.mapping.test.example.Root;
31: import org.eclipse.emf.ecp.view.mapping.test.example.Target;
32:
33: /**
34: * <!-- begin-user-doc -->
35: * An implementation of the model <b>Package</b>.
36: * <!-- end-user-doc -->
37: *
38: * @generated
39: */
40: public class ExamplePackageImpl extends EPackageImpl implements ExamplePackage {
41:         /**
42:          * <!-- begin-user-doc -->
43:          * <!-- end-user-doc -->
44:          *
45:          * @generated
46:          */
47:         private EClass rootEClass = null;
48:
49:         /**
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @generated
54:          */
55:         private EClass intermediateEClass = null;
56:
57:         /**
58:          * <!-- begin-user-doc -->
59:          * <!-- end-user-doc -->
60:          *
61:          * @generated
62:          */
63:         private EClass containerEClass = null;
64:
65:         /**
66:          * <!-- begin-user-doc -->
67:          * <!-- end-user-doc -->
68:          *
69:          * @generated
70:          */
71:         private EClass abstractChildEClass = null;
72:
73:         /**
74:          * <!-- begin-user-doc -->
75:          * <!-- end-user-doc -->
76:          *
77:          * @generated
78:          */
79:         private EClass childEClass = null;
80:
81:         /**
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @generated
86:          */
87:         private EClass intermediateTargetEClass = null;
88:
89:         /**
90:          * <!-- begin-user-doc -->
91:          * <!-- end-user-doc -->
92:          *
93:          * @generated
94:          */
95:         private EClass targetEClass = null;
96:
97:         /**
98:          * <!-- begin-user-doc -->
99:          * <!-- end-user-doc -->
100:          *
101:          * @generated
102:          */
103:         private EClass eClassToAdditionMapEClass = null;
104:
105:         /**
106:          * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
107:          * EPackage.Registry} by the package
108:          * package URI value.
109:          * <p>
110:          * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also
111:          * performs initialization of the package, or returns the registered package, if one already exists. <!--
112:          * begin-user-doc --> <!-- end-user-doc -->
113:          *
114:          * @see org.eclipse.emf.ecore.EPackage.Registry
115:          * @see org.eclipse.emf.ecp.view.mapping.test.example.ExamplePackage#eNS_URI
116:          * @see #init()
117:          * @generated
118:          */
119:         private ExamplePackageImpl() {
120:                 super(eNS_URI, ExampleFactory.eINSTANCE);
121:         }
122:
123:         /**
124:          * <!-- begin-user-doc -->
125:          * <!-- end-user-doc -->
126:          *
127:          * @generated
128:          */
129:         private static boolean isInited = false;
130:
131:         /**
132:          * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
133:          *
134:          * <p>
135:          * This method is used to initialize {@link ExamplePackage#eINSTANCE} when that field is accessed. Clients should
136:          * not invoke it directly. Instead, they should simply access that field to obtain the package. <!-- begin-user-doc
137:          * --> <!-- end-user-doc -->
138:          *
139:          * @see #eNS_URI
140:          * @see #createPackageContents()
141:          * @see #initializePackageContents()
142:          * @generated
143:          */
144:         public static ExamplePackage init() {
145:•                if (isInited) {
146:                         return (ExamplePackage) EPackage.Registry.INSTANCE.getEPackage(ExamplePackage.eNS_URI);
147:                 }
148:
149:                 // Obtain or create and register package
150:                 final ExamplePackageImpl theExamplePackage = (ExamplePackageImpl) (EPackage.Registry.INSTANCE
151:•                        .get(eNS_URI) instanceof ExamplePackageImpl ? EPackage.Registry.INSTANCE
152:                                 .get(eNS_URI)
153:                                 : new ExamplePackageImpl());
154:
155:                 isInited = true;
156:
157:                 // Initialize simple dependencies
158:                 EcorePackage.eINSTANCE.eClass();
159:
160:                 // Create package meta-data objects
161:                 theExamplePackage.createPackageContents();
162:
163:                 // Initialize created meta-data
164:                 theExamplePackage.initializePackageContents();
165:
166:                 // Mark meta-data to indicate it can't be changed
167:                 theExamplePackage.freeze();
168:
169:                 // Update the registry and return the package
170:                 EPackage.Registry.INSTANCE.put(ExamplePackage.eNS_URI, theExamplePackage);
171:                 return theExamplePackage;
172:         }
173:
174:         /**
175:          * <!-- begin-user-doc -->
176:          * <!-- end-user-doc -->
177:          *
178:          * @generated
179:          */
180:         @Override
181:         public EClass getRoot() {
182:                 return rootEClass;
183:         }
184:
185:         /**
186:          * <!-- begin-user-doc -->
187:          * <!-- end-user-doc -->
188:          *
189:          * @generated
190:          */
191:         @Override
192:         public EReference getRoot_Intermediate() {
193:                 return (EReference) rootEClass.getEStructuralFeatures().get(0);
194:         }
195:
196:         /**
197:          * <!-- begin-user-doc -->
198:          * <!-- end-user-doc -->
199:          *
200:          * @generated
201:          */
202:         @Override
203:         public EClass getIntermediate() {
204:                 return intermediateEClass;
205:         }
206:
207:         /**
208:          * <!-- begin-user-doc -->
209:          * <!-- end-user-doc -->
210:          *
211:          * @generated
212:          */
213:         @Override
214:         public EReference getIntermediate_Container() {
215:                 return (EReference) intermediateEClass.getEStructuralFeatures().get(0);
216:         }
217:
218:         /**
219:          * <!-- begin-user-doc -->
220:          * <!-- end-user-doc -->
221:          *
222:          * @generated
223:          */
224:         @Override
225:         public EClass getContainer() {
226:                 return containerEClass;
227:         }
228:
229:         /**
230:          * <!-- begin-user-doc -->
231:          * <!-- end-user-doc -->
232:          *
233:          * @generated
234:          */
235:         @Override
236:         public EReference getContainer_Children() {
237:                 return (EReference) containerEClass.getEStructuralFeatures().get(0);
238:         }
239:
240:         /**
241:          * <!-- begin-user-doc -->
242:          * <!-- end-user-doc -->
243:          *
244:          * @generated
245:          */
246:         @Override
247:         public EClass getAbstractChild() {
248:                 return abstractChildEClass;
249:         }
250:
251:         /**
252:          * <!-- begin-user-doc -->
253:          * <!-- end-user-doc -->
254:          *
255:          * @generated
256:          */
257:         @Override
258:         public EClass getChild() {
259:                 return childEClass;
260:         }
261:
262:         /**
263:          * <!-- begin-user-doc -->
264:          * <!-- end-user-doc -->
265:          *
266:          * @generated
267:          */
268:         @Override
269:         public EReference getChild_IntermediateTarget() {
270:                 return (EReference) childEClass.getEStructuralFeatures().get(0);
271:         }
272:
273:         /**
274:          * <!-- begin-user-doc -->
275:          * <!-- end-user-doc -->
276:          *
277:          * @generated
278:          */
279:         @Override
280:         public EClass getIntermediateTarget() {
281:                 return intermediateTargetEClass;
282:         }
283:
284:         /**
285:          * <!-- begin-user-doc -->
286:          * <!-- end-user-doc -->
287:          *
288:          * @generated
289:          */
290:         @Override
291:         public EReference getIntermediateTarget_Target() {
292:                 return (EReference) intermediateTargetEClass.getEStructuralFeatures().get(0);
293:         }
294:
295:         /**
296:          * <!-- begin-user-doc -->
297:          * <!-- end-user-doc -->
298:          *
299:          * @generated
300:          */
301:         @Override
302:         public EClass getTarget() {
303:                 return targetEClass;
304:         }
305:
306:         /**
307:          * <!-- begin-user-doc -->
308:          * <!-- end-user-doc -->
309:          *
310:          * @generated
311:          */
312:         @Override
313:         public EAttribute getTarget_Name() {
314:                 return (EAttribute) targetEClass.getEStructuralFeatures().get(0);
315:         }
316:
317:         /**
318:          * <!-- begin-user-doc -->
319:          * <!-- end-user-doc -->
320:          *
321:          * @generated
322:          */
323:         @Override
324:         public EClass getEClassToAdditionMap() {
325:                 return eClassToAdditionMapEClass;
326:         }
327:
328:         /**
329:          * <!-- begin-user-doc -->
330:          * <!-- end-user-doc -->
331:          *
332:          * @generated
333:          */
334:         @Override
335:         public EReference getEClassToAdditionMap_Key() {
336:                 return (EReference) eClassToAdditionMapEClass.getEStructuralFeatures().get(0);
337:         }
338:
339:         /**
340:          * <!-- begin-user-doc -->
341:          * <!-- end-user-doc -->
342:          *
343:          * @generated
344:          */
345:         @Override
346:         public EReference getEClassToAdditionMap_Value() {
347:                 return (EReference) eClassToAdditionMapEClass.getEStructuralFeatures().get(1);
348:         }
349:
350:         /**
351:          * <!-- begin-user-doc -->
352:          * <!-- end-user-doc -->
353:          *
354:          * @generated
355:          */
356:         @Override
357:         public ExampleFactory getExampleFactory() {
358:                 return (ExampleFactory) getEFactoryInstance();
359:         }
360:
361:         /**
362:          * <!-- begin-user-doc -->
363:          * <!-- end-user-doc -->
364:          *
365:          * @generated
366:          */
367:         private boolean isCreated = false;
368:
369:         /**
370:          * Creates the meta-model objects for the package. This method is
371:          * guarded to have no affect on any invocation but its first.
372:          * <!-- begin-user-doc -->
373:          * <!-- end-user-doc -->
374:          *
375:          * @generated
376:          */
377:         public void createPackageContents() {
378:•                if (isCreated) {
379:                         return;
380:                 }
381:                 isCreated = true;
382:
383:                 // Create classes and their features
384:                 rootEClass = createEClass(ROOT);
385:                 createEReference(rootEClass, ROOT__INTERMEDIATE);
386:
387:                 intermediateEClass = createEClass(INTERMEDIATE);
388:                 createEReference(intermediateEClass, INTERMEDIATE__CONTAINER);
389:
390:                 containerEClass = createEClass(org.eclipse.emf.ecp.view.mapping.test.example.ExamplePackage.CONTAINER);
391:                 createEReference(containerEClass, CONTAINER__CHILDREN);
392:
393:                 abstractChildEClass = createEClass(ABSTRACT_CHILD);
394:
395:                 childEClass = createEClass(CHILD);
396:                 createEReference(childEClass, CHILD__INTERMEDIATE_TARGET);
397:
398:                 intermediateTargetEClass = createEClass(INTERMEDIATE_TARGET);
399:                 createEReference(intermediateTargetEClass, INTERMEDIATE_TARGET__TARGET);
400:
401:                 targetEClass = createEClass(TARGET);
402:                 createEAttribute(targetEClass, TARGET__NAME);
403:
404:                 eClassToAdditionMapEClass = createEClass(ECLASS_TO_ADDITION_MAP);
405:                 createEReference(eClassToAdditionMapEClass, ECLASS_TO_ADDITION_MAP__KEY);
406:                 createEReference(eClassToAdditionMapEClass, ECLASS_TO_ADDITION_MAP__VALUE);
407:         }
408:
409:         /**
410:          * <!-- begin-user-doc -->
411:          * <!-- end-user-doc -->
412:          *
413:          * @generated
414:          */
415:         private boolean isInitialized = false;
416:
417:         /**
418:          * Complete the initialization of the package and its meta-model. This
419:          * method is guarded to have no affect on any invocation but its first.
420:          * <!-- begin-user-doc -->
421:          * <!-- end-user-doc -->
422:          *
423:          * @generated
424:          */
425:         public void initializePackageContents() {
426:•                if (isInitialized) {
427:                         return;
428:                 }
429:                 isInitialized = true;
430:
431:                 // Initialize package
432:                 setName(eNAME);
433:                 setNsPrefix(eNS_PREFIX);
434:                 setNsURI(eNS_URI);
435:
436:                 // Obtain other dependent packages
437:                 final EcorePackage theEcorePackage = (EcorePackage) EPackage.Registry.INSTANCE
438:                         .getEPackage(EcorePackage.eNS_URI);
439:
440:                 // Create type parameters
441:
442:                 // Set bounds for type parameters
443:
444:                 // Add supertypes to classes
445:                 childEClass.getESuperTypes().add(getAbstractChild());
446:
447:                 // Initialize classes, features, and operations; add parameters
448:                 initEClass(rootEClass, Root.class, "Root", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
449:                 initEReference(getRoot_Intermediate(), getIntermediate(), null, "intermediate", null, 0, 1, Root.class, //$NON-NLS-1$
450:                         !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
451:                         !IS_DERIVED, IS_ORDERED);
452:
453:                 initEClass(intermediateEClass, Intermediate.class, "Intermediate", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$
454:                         IS_GENERATED_INSTANCE_CLASS);
455:                 initEReference(getIntermediate_Container(), getContainer(), null, "container", null, 0, 1, //$NON-NLS-1$
456:                         Intermediate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
457:                         !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
458:
459:                 initEClass(containerEClass, org.eclipse.emf.ecp.view.mapping.test.example.Container.class, "Container", //$NON-NLS-1$
460:                         !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
461:                 initEReference(getContainer_Children(), getEClassToAdditionMap(), null, "children", null, 0, -1, //$NON-NLS-1$
462:                         org.eclipse.emf.ecp.view.mapping.test.example.Container.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
463:                         IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
464:
465:                 initEClass(abstractChildEClass, AbstractChild.class, "AbstractChild", IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$
466:                         IS_GENERATED_INSTANCE_CLASS);
467:
468:                 initEClass(childEClass, Child.class, "Child", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
469:                 initEReference(getChild_IntermediateTarget(), getIntermediateTarget(), null, "intermediateTarget", null, //$NON-NLS-1$
470:                         0, 1, Child.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
471:                         !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
472:
473:                 initEClass(intermediateTargetEClass, IntermediateTarget.class, "IntermediateTarget", !IS_ABSTRACT, //$NON-NLS-1$
474:                         !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
475:                 initEReference(getIntermediateTarget_Target(), getTarget(), null, "target", null, 0, 1, //$NON-NLS-1$
476:                         IntermediateTarget.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
477:                         !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
478:
479:                 initEClass(targetEClass, Target.class, "Target", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
480:                 initEAttribute(getTarget_Name(), ecorePackage.getEString(), "name", null, 0, 1, Target.class, !IS_TRANSIENT, //$NON-NLS-1$
481:                         !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
482:
483:                 initEClass(eClassToAdditionMapEClass, Map.Entry.class, "EClassToAdditionMap", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$
484:                         !IS_GENERATED_INSTANCE_CLASS);
485:                 initEReference(getEClassToAdditionMap_Key(), theEcorePackage.getEClass(), null, "key", null, 0, 1, //$NON-NLS-1$
486:                         Map.Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
487:                         !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
488:                 initEReference(getEClassToAdditionMap_Value(), getAbstractChild(), null, "value", null, 0, 1, //$NON-NLS-1$
489:                         Map.Entry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
490:                         !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
491:
492:                 // Create resource
493:                 createResource(eNS_URI);
494:         }
495:
496: } // ExamplePackageImpl