Skip to content

Package: ExamplePackageImpl

ExamplePackageImpl

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