Skip to content

Package: VStackFactoryImpl

VStackFactoryImpl

nameinstructionbranchcomplexitylinemethod
VStackFactoryImpl()
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: 14 C: 9
39%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
createStackItem()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
createStackLayout()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
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%
getStackPackage()
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%
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.spi.stack.model.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.spi.stack.model.VStackFactory;
22: import org.eclipse.emf.ecp.view.spi.stack.model.VStackItem;
23: import org.eclipse.emf.ecp.view.spi.stack.model.VStackLayout;
24: import org.eclipse.emf.ecp.view.spi.stack.model.VStackPackage;
25:
26: /**
27: * <!-- begin-user-doc -->
28: * An implementation of the model <b>Factory</b>.
29: * <!-- end-user-doc -->
30: *
31: * @generated
32: */
33: public class VStackFactoryImpl extends EFactoryImpl implements VStackFactory {
34:         /**
35:          * Creates the default factory implementation.
36:          * <!-- begin-user-doc -->
37:          * <!-- end-user-doc -->
38:          *
39:          * @generated
40:          */
41:         public static VStackFactory init() {
42:                 try {
43:                         final VStackFactory theStackFactory = (VStackFactory) EPackage.Registry.INSTANCE
44:                                 .getEFactory(VStackPackage.eNS_URI);
45:•                        if (theStackFactory != null) {
46:                                 return theStackFactory;
47:                         }
48:                 } catch (final Exception exception) {
49:                         EcorePlugin.INSTANCE.log(exception);
50:                 }
51:                 return new VStackFactoryImpl();
52:         }
53:
54:         /**
55:          * Creates an instance of the factory.
56:          * <!-- begin-user-doc -->
57:          * <!-- end-user-doc -->
58:          *
59:          * @generated
60:          */
61:         public VStackFactoryImpl() {
62:                 super();
63:         }
64:
65:         /**
66:          * <!-- begin-user-doc -->
67:          * <!-- end-user-doc -->
68:          *
69:          * @generated
70:          */
71:         @Override
72:         public EObject create(EClass eClass) {
73:•                switch (eClass.getClassifierID()) {
74:                 case VStackPackage.STACK_LAYOUT:
75:                         return createStackLayout();
76:                 case VStackPackage.STACK_ITEM:
77:                         return createStackItem();
78:                 default:
79:                         throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
80:                 }
81:         }
82:
83:         /**
84:          * <!-- begin-user-doc -->
85:          * <!-- end-user-doc -->
86:          *
87:          * @generated
88:          */
89:         @Override
90:         public VStackLayout createStackLayout() {
91:                 final VStackLayoutImpl stackLayout = new VStackLayoutImpl();
92:                 return stackLayout;
93:         }
94:
95:         /**
96:          * <!-- begin-user-doc -->
97:          * <!-- end-user-doc -->
98:          *
99:          * @generated
100:          */
101:         @Override
102:         public VStackItem createStackItem() {
103:                 final VStackItemImpl stackItem = new VStackItemImpl();
104:                 return stackItem;
105:         }
106:
107:         /**
108:          * <!-- begin-user-doc -->
109:          * <!-- end-user-doc -->
110:          *
111:          * @generated
112:          */
113:         @Override
114:         public VStackPackage getStackPackage() {
115:                 return (VStackPackage) getEPackage();
116:         }
117:
118:         /**
119:          * <!-- begin-user-doc -->
120:          * <!-- end-user-doc -->
121:          *
122:          * @deprecated
123:          * @generated
124:          */
125:         @Deprecated
126:         public static VStackPackage getPackage() {
127:                 return VStackPackage.eINSTANCE;
128:         }
129:
130: } // VStackFactoryImpl