Skip to content

Package: ExampleFactoryImpl

ExampleFactoryImpl

nameinstructionbranchcomplexitylinemethod
ExampleFactoryImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
create(EClass)
M: 35 C: 0
0%
M: 7 C: 0
0%
M: 7 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
createChild()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createContainer()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createIntermediate()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createIntermediateTarget()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createRoot()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createTarget()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getExamplePackage()
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%
getPackage()
M: 2 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: 6 C: 11
65%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 3 C: 4
57%
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 org.eclipse.emf.ecore.EClass;
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emf.ecore.EPackage;
19: import org.eclipse.emf.ecore.impl.EFactoryImpl;
20: import org.eclipse.emf.ecore.plugin.EcorePlugin;
21: import org.eclipse.emf.ecp.view.index.test.example.Child;
22: import org.eclipse.emf.ecp.view.index.test.example.ExampleFactory;
23: import org.eclipse.emf.ecp.view.index.test.example.ExamplePackage;
24: import org.eclipse.emf.ecp.view.index.test.example.Intermediate;
25: import org.eclipse.emf.ecp.view.index.test.example.IntermediateTarget;
26: import org.eclipse.emf.ecp.view.index.test.example.Root;
27: import org.eclipse.emf.ecp.view.index.test.example.Target;
28:
29: /**
30: * <!-- begin-user-doc -->
31: * An implementation of the model <b>Factory</b>.
32: * <!-- end-user-doc -->
33: *
34: * @generated
35: */
36: public class ExampleFactoryImpl extends EFactoryImpl implements ExampleFactory {
37:         /**
38:          * Creates the default factory implementation.
39:          * <!-- begin-user-doc -->
40:          * <!-- end-user-doc -->
41:          *
42:          * @generated
43:          */
44:         public static ExampleFactory init() {
45:                 try {
46:                         final ExampleFactory theExampleFactory = (ExampleFactory) EPackage.Registry.INSTANCE
47:                                 .getEFactory(ExamplePackage.eNS_URI);
48:•                        if (theExampleFactory != null) {
49:                                 return theExampleFactory;
50:                         }
51:                 } catch (final Exception exception) {
52:                         EcorePlugin.INSTANCE.log(exception);
53:                 }
54:                 return new ExampleFactoryImpl();
55:         }
56:
57:         /**
58:          * Creates an instance of the factory.
59:          * <!-- begin-user-doc -->
60:          * <!-- end-user-doc -->
61:          *
62:          * @generated
63:          */
64:         public ExampleFactoryImpl() {
65:                 super();
66:         }
67:
68:         /**
69:          * <!-- begin-user-doc -->
70:          * <!-- end-user-doc -->
71:          *
72:          * @generated
73:          */
74:         @Override
75:         public EObject create(EClass eClass) {
76:•                switch (eClass.getClassifierID()) {
77:                 case ExamplePackage.ROOT:
78:                         return createRoot();
79:                 case ExamplePackage.INTERMEDIATE:
80:                         return createIntermediate();
81:                 case ExamplePackage.CONTAINER:
82:                         return createContainer();
83:                 case ExamplePackage.CHILD:
84:                         return createChild();
85:                 case ExamplePackage.INTERMEDIATE_TARGET:
86:                         return createIntermediateTarget();
87:                 case ExamplePackage.TARGET:
88:                         return createTarget();
89:                 default:
90:                         throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
91:                 }
92:         }
93:
94:         /**
95:          * <!-- begin-user-doc -->
96:          * <!-- end-user-doc -->
97:          *
98:          * @generated
99:          */
100:         @Override
101:         public Root createRoot() {
102:                 final RootImpl root = new RootImpl();
103:                 return root;
104:         }
105:
106:         /**
107:          * <!-- begin-user-doc -->
108:          * <!-- end-user-doc -->
109:          *
110:          * @generated
111:          */
112:         @Override
113:         public Intermediate createIntermediate() {
114:                 final IntermediateImpl intermediate = new IntermediateImpl();
115:                 return intermediate;
116:         }
117:
118:         /**
119:          * <!-- begin-user-doc -->
120:          * <!-- end-user-doc -->
121:          *
122:          * @generated
123:          */
124:         @Override
125:         public org.eclipse.emf.ecp.view.index.test.example.Container createContainer() {
126:                 final ContainerImpl container = new ContainerImpl();
127:                 return container;
128:         }
129:
130:         /**
131:          * <!-- begin-user-doc -->
132:          * <!-- end-user-doc -->
133:          *
134:          * @generated
135:          */
136:         @Override
137:         public Child createChild() {
138:                 final ChildImpl child = new ChildImpl();
139:                 return child;
140:         }
141:
142:         /**
143:          * <!-- begin-user-doc -->
144:          * <!-- end-user-doc -->
145:          *
146:          * @generated
147:          */
148:         @Override
149:         public IntermediateTarget createIntermediateTarget() {
150:                 final IntermediateTargetImpl intermediateTarget = new IntermediateTargetImpl();
151:                 return intermediateTarget;
152:         }
153:
154:         /**
155:          * <!-- begin-user-doc -->
156:          * <!-- end-user-doc -->
157:          *
158:          * @generated
159:          */
160:         @Override
161:         public Target createTarget() {
162:                 final TargetImpl target = new TargetImpl();
163:                 return target;
164:         }
165:
166:         /**
167:          * <!-- begin-user-doc -->
168:          * <!-- end-user-doc -->
169:          *
170:          * @generated
171:          */
172:         @Override
173:         public ExamplePackage getExamplePackage() {
174:                 return (ExamplePackage) getEPackage();
175:         }
176:
177:         /**
178:          * <!-- begin-user-doc -->
179:          * <!-- end-user-doc -->
180:          *
181:          * @deprecated
182:          * @generated
183:          */
184:         @Deprecated
185:         public static ExamplePackage getPackage() {
186:                 return ExamplePackage.eINSTANCE;
187:         }
188:
189: } // ExampleFactoryImpl