Skip to content

Package: ExamplePackageImpl

ExamplePackageImpl

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