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