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