Skip to content

Package: ModelFactoryImpl

ModelFactoryImpl

nameinstructionbranchcomplexitylinemethod
ModelFactoryImpl()
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: 32 C: 6
16%
M: 7 C: 1
13%
M: 7 C: 1
13%
M: 7 C: 2
22%
M: 0 C: 1
100%
createDomainIntermediate()
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%
createDomainRoot()
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%
createDynamicContainmentItem()
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%
createDynamicContainmentTree()
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%
createDynamicContainmentTreeDomainModelReference()
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%
createTestElement()
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%
createTestElementContainer()
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%
getModelPackage()
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-2013 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: * Edgar Mueller - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.dynamictree.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.dynamictree.model.DomainIntermediate;
22: import org.eclipse.emf.ecp.view.dynamictree.model.DomainRoot;
23: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentItem;
24: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentTree;
25: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentTreeDomainModelReference;
26: import org.eclipse.emf.ecp.view.dynamictree.model.ModelFactory;
27: import org.eclipse.emf.ecp.view.dynamictree.model.ModelPackage;
28: import org.eclipse.emf.ecp.view.dynamictree.model.TestElement;
29: import org.eclipse.emf.ecp.view.dynamictree.model.TestElementContainer;
30:
31: /**
32: * <!-- begin-user-doc -->
33: * An implementation of the model <b>Factory</b>.
34: * <!-- end-user-doc -->
35: *
36: * @generated
37: */
38: public class ModelFactoryImpl extends EFactoryImpl implements ModelFactory {
39:         /**
40:          * Creates the default factory implementation.
41:          * <!-- begin-user-doc -->
42:          * <!-- end-user-doc -->
43:          *
44:          * @generated
45:          */
46:         public static ModelFactory init() {
47:                 try {
48:                         final ModelFactory theModelFactory = (ModelFactory) EPackage.Registry.INSTANCE
49:                                 .getEFactory(ModelPackage.eNS_URI);
50:•                        if (theModelFactory != null) {
51:                                 return theModelFactory;
52:                         }
53:                 } catch (final Exception exception) {
54:                         EcorePlugin.INSTANCE.log(exception);
55:                 }
56:                 return new ModelFactoryImpl();
57:         }
58:
59:         /**
60:          * Creates an instance of the factory.
61:          * <!-- begin-user-doc -->
62:          * <!-- end-user-doc -->
63:          *
64:          * @generated
65:          */
66:         public ModelFactoryImpl() {
67:                 super();
68:         }
69:
70:         /**
71:          * <!-- begin-user-doc -->
72:          * <!-- end-user-doc -->
73:          *
74:          * @generated
75:          */
76:         @Override
77:         public EObject create(EClass eClass) {
78:•                switch (eClass.getClassifierID()) {
79:                 case ModelPackage.DYNAMIC_CONTAINMENT_TREE:
80:                         return createDynamicContainmentTree();
81:                 case ModelPackage.DYNAMIC_CONTAINMENT_ITEM:
82:                         return createDynamicContainmentItem();
83:                 case ModelPackage.TEST_ELEMENT:
84:                         return createTestElement();
85:                 case ModelPackage.DOMAIN_ROOT:
86:                         return createDomainRoot();
87:                 case ModelPackage.DOMAIN_INTERMEDIATE:
88:                         return createDomainIntermediate();
89:                 case ModelPackage.TEST_ELEMENT_CONTAINER:
90:                         return createTestElementContainer();
91:                 case ModelPackage.DYNAMIC_CONTAINMENT_TREE_DOMAIN_MODEL_REFERENCE:
92:                         return createDynamicContainmentTreeDomainModelReference();
93:                 default:
94:                         throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
95:                 }
96:         }
97:
98:         /**
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @generated
103:          */
104:         @Override
105:         public DynamicContainmentTree createDynamicContainmentTree() {
106:                 final DynamicContainmentTreeImpl dynamicContainmentTree = new DynamicContainmentTreeImpl();
107:                 return dynamicContainmentTree;
108:         }
109:
110:         /**
111:          * <!-- begin-user-doc -->
112:          * <!-- end-user-doc -->
113:          *
114:          * @generated
115:          */
116:         @Override
117:         public DynamicContainmentItem createDynamicContainmentItem() {
118:                 final DynamicContainmentItemImpl dynamicContainmentItem = new DynamicContainmentItemImpl();
119:                 return dynamicContainmentItem;
120:         }
121:
122:         /**
123:          * <!-- begin-user-doc -->
124:          * <!-- end-user-doc -->
125:          *
126:          * @generated
127:          */
128:         @Override
129:         public TestElement createTestElement() {
130:                 final TestElementImpl testElement = new TestElementImpl();
131:                 return testElement;
132:         }
133:
134:         /**
135:          * <!-- begin-user-doc -->
136:          * <!-- end-user-doc -->
137:          *
138:          * @generated
139:          */
140:         @Override
141:         public DomainRoot createDomainRoot() {
142:                 final DomainRootImpl domainRoot = new DomainRootImpl();
143:                 return domainRoot;
144:         }
145:
146:         /**
147:          * <!-- begin-user-doc -->
148:          * <!-- end-user-doc -->
149:          *
150:          * @generated
151:          */
152:         @Override
153:         public DomainIntermediate createDomainIntermediate() {
154:                 final DomainIntermediateImpl domainIntermediate = new DomainIntermediateImpl();
155:                 return domainIntermediate;
156:         }
157:
158:         /**
159:          * <!-- begin-user-doc -->
160:          * <!-- end-user-doc -->
161:          *
162:          * @generated
163:          */
164:         @Override
165:         public TestElementContainer createTestElementContainer() {
166:                 final TestElementContainerImpl testElementContainer = new TestElementContainerImpl();
167:                 return testElementContainer;
168:         }
169:
170:         /**
171:          * <!-- begin-user-doc -->
172:          * <!-- end-user-doc -->
173:          *
174:          * @generated
175:          */
176:         @Override
177:         public DynamicContainmentTreeDomainModelReference createDynamicContainmentTreeDomainModelReference() {
178:                 final DynamicContainmentTreeDomainModelReferenceImpl dynamicContainmentTreeDomainModelReference = new DynamicContainmentTreeDomainModelReferenceImpl();
179:                 return dynamicContainmentTreeDomainModelReference;
180:         }
181:
182:         /**
183:          * <!-- begin-user-doc -->
184:          * <!-- end-user-doc -->
185:          *
186:          * @generated
187:          */
188:         @Override
189:         public ModelPackage getModelPackage() {
190:                 return (ModelPackage) getEPackage();
191:         }
192:
193:         /**
194:          * <!-- begin-user-doc -->
195:          * <!-- end-user-doc -->
196:          *
197:          * @deprecated
198:          * @generated
199:          */
200:         @Deprecated
201:         public static ModelPackage getPackage() {
202:                 return ModelPackage.eINSTANCE;
203:         }
204:
205: } // ModelFactoryImpl