Skip to content

Package: CarFactoryImpl

CarFactoryImpl

nameinstructionbranchcomplexitylinemethod
CarFactoryImpl()
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: 26 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
createCar()
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%
createDriver()
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%
createPerson()
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%
getCarPackage()
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: */
3: package car.impl;
4:
5: import org.eclipse.emf.ecore.EClass;
6: import org.eclipse.emf.ecore.EObject;
7: import org.eclipse.emf.ecore.EPackage;
8: import org.eclipse.emf.ecore.impl.EFactoryImpl;
9: import org.eclipse.emf.ecore.plugin.EcorePlugin;
10:
11: import car.Car;
12: import car.CarFactory;
13: import car.CarPackage;
14: import car.Driver;
15: import car.Person;
16:
17: /**
18: * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!--
19: * end-user-doc -->
20: *
21: * @generated
22: */
23: public class CarFactoryImpl extends EFactoryImpl implements CarFactory {
24:         /**
25:          * Creates the default factory implementation. <!-- begin-user-doc --> <!--
26:          * end-user-doc -->
27:          *
28:          * @generated
29:          */
30:         public static CarFactory init() {
31:                 try {
32:                         CarFactory theCarFactory = (CarFactory) EPackage.Registry.INSTANCE
33:                                 .getEFactory(CarPackage.eNS_URI);
34:•                        if (theCarFactory != null) {
35:                                 return theCarFactory;
36:                         }
37:                 } catch (Exception exception) {
38:                         EcorePlugin.INSTANCE.log(exception);
39:                 }
40:                 return new CarFactoryImpl();
41:         }
42:
43:         /**
44:          * Creates an instance of the factory. <!-- begin-user-doc --> <!--
45:          * end-user-doc -->
46:          *
47:          * @generated
48:          */
49:         public CarFactoryImpl() {
50:                 super();
51:         }
52:
53:         /**
54:          * <!-- begin-user-doc --> <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         @Override
59:         public EObject create(EClass eClass) {
60:•                switch (eClass.getClassifierID()) {
61:                 case CarPackage.PERSON:
62:                         return createPerson();
63:                 case CarPackage.DRIVER:
64:                         return createDriver();
65:                 case CarPackage.CAR:
66:                         return createCar();
67:                 default:
68:                         throw new IllegalArgumentException("The class '" + eClass.getName()
69:                                 + "' is not a valid classifier");
70:                 }
71:         }
72:
73:         /**
74:          * <!-- begin-user-doc --> <!-- end-user-doc -->
75:          *
76:          * @generated
77:          */
78:         @Override
79:         public Person createPerson() {
80:                 PersonImpl person = new PersonImpl();
81:                 return person;
82:         }
83:
84:         /**
85:          * <!-- begin-user-doc --> <!-- end-user-doc -->
86:          *
87:          * @generated
88:          */
89:         @Override
90:         public Driver createDriver() {
91:                 DriverImpl driver = new DriverImpl();
92:                 return driver;
93:         }
94:
95:         /**
96:          * <!-- begin-user-doc --> <!-- end-user-doc -->
97:          *
98:          * @generated
99:          */
100:         @Override
101:         public Car createCar() {
102:                 CarImpl car = new CarImpl();
103:                 return car;
104:         }
105:
106:         /**
107:          * <!-- begin-user-doc --> <!-- end-user-doc -->
108:          *
109:          * @generated
110:          */
111:         @Override
112:         public CarPackage getCarPackage() {
113:                 return (CarPackage) getEPackage();
114:         }
115:
116:         /**
117:          * <!-- begin-user-doc --> <!-- end-user-doc -->
118:          *
119:          * @deprecated
120:          * @generated
121:          */
122:         @Deprecated
123:         public static CarPackage getPackage() {
124:                 return CarPackage.eINSTANCE;
125:         }
126:
127: } // CarFactoryImpl