Skip to content

Package: VTTableStylePropertyFactoryImpl

VTTableStylePropertyFactoryImpl

nameinstructionbranchcomplexitylinemethod
VTTableStylePropertyFactoryImpl()
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%
convertRenderModeToString(EDataType, Object)
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
convertToString(EDataType, Object)
M: 22 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
create(EClass)
M: 14 C: 6
30%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
createFromString(EDataType, String)
M: 22 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
createRenderModeFromString(EDataType, String)
M: 25 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
createTableStyleProperty()
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%
getTableStylePropertyPackage()
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-2016 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.template.style.tableStyleProperty.model.impl;
15:
16: import org.eclipse.emf.ecore.EClass;
17: import org.eclipse.emf.ecore.EDataType;
18: import org.eclipse.emf.ecore.EObject;
19: import org.eclipse.emf.ecore.EPackage;
20: import org.eclipse.emf.ecore.impl.EFactoryImpl;
21: import org.eclipse.emf.ecore.plugin.EcorePlugin;
22: import org.eclipse.emf.ecp.view.template.style.tableStyleProperty.model.RenderMode;
23: import org.eclipse.emf.ecp.view.template.style.tableStyleProperty.model.VTTableStyleProperty;
24: import org.eclipse.emf.ecp.view.template.style.tableStyleProperty.model.VTTableStylePropertyFactory;
25: import org.eclipse.emf.ecp.view.template.style.tableStyleProperty.model.VTTableStylePropertyPackage;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * An implementation of the model <b>Factory</b>.
30: * <!-- end-user-doc -->
31: *
32: * @generated
33: */
34: public class VTTableStylePropertyFactoryImpl extends EFactoryImpl implements VTTableStylePropertyFactory {
35:         /**
36:          * Creates the default factory implementation.
37:          * <!-- begin-user-doc -->
38:          * <!-- end-user-doc -->
39:          *
40:          * @generated
41:          */
42:         public static VTTableStylePropertyFactory init() {
43:                 try {
44:                         final VTTableStylePropertyFactory theTableStylePropertyFactory = (VTTableStylePropertyFactory) EPackage.Registry.INSTANCE
45:                                 .getEFactory(VTTableStylePropertyPackage.eNS_URI);
46:•                        if (theTableStylePropertyFactory != null) {
47:                                 return theTableStylePropertyFactory;
48:                         }
49:                 } catch (final Exception exception) {
50:                         EcorePlugin.INSTANCE.log(exception);
51:                 }
52:                 return new VTTableStylePropertyFactoryImpl();
53:         }
54:
55:         /**
56:          * Creates an instance of the factory.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @generated
61:          */
62:         public VTTableStylePropertyFactoryImpl() {
63:                 super();
64:         }
65:
66:         /**
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @generated
71:          */
72:         @Override
73:         public EObject create(EClass eClass) {
74:•                switch (eClass.getClassifierID()) {
75:                 case VTTableStylePropertyPackage.TABLE_STYLE_PROPERTY:
76:                         return createTableStyleProperty();
77:                 default:
78:                         throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
79:                 }
80:         }
81:
82:         /**
83:          * <!-- begin-user-doc -->
84:          * <!-- end-user-doc -->
85:          *
86:          * @generated
87:          */
88:         @Override
89:         public Object createFromString(EDataType eDataType, String initialValue) {
90:•                switch (eDataType.getClassifierID()) {
91:                 case VTTableStylePropertyPackage.RENDER_MODE:
92:                         return createRenderModeFromString(eDataType, initialValue);
93:                 default:
94:                         throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
95:                 }
96:         }
97:
98:         /**
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @generated
103:          */
104:         @Override
105:         public String convertToString(EDataType eDataType, Object instanceValue) {
106:•                switch (eDataType.getClassifierID()) {
107:                 case VTTableStylePropertyPackage.RENDER_MODE:
108:                         return convertRenderModeToString(eDataType, instanceValue);
109:                 default:
110:                         throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
111:                 }
112:         }
113:
114:         /**
115:          * <!-- begin-user-doc -->
116:          * <!-- end-user-doc -->
117:          *
118:          * @generated
119:          */
120:         @Override
121:         public VTTableStyleProperty createTableStyleProperty() {
122:                 final VTTableStylePropertyImpl tableStyleProperty = new VTTableStylePropertyImpl();
123:                 return tableStyleProperty;
124:         }
125:
126:         /**
127:          * <!-- begin-user-doc -->
128:          * <!-- end-user-doc -->
129:          *
130:          * @generated
131:          */
132:         public RenderMode createRenderModeFromString(EDataType eDataType, String initialValue) {
133:                 final RenderMode result = RenderMode.get(initialValue);
134:•                if (result == null) {
135:                         throw new IllegalArgumentException(
136:                                 "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
137:                 }
138:                 return result;
139:         }
140:
141:         /**
142:          * <!-- begin-user-doc -->
143:          * <!-- end-user-doc -->
144:          *
145:          * @generated
146:          */
147:         public String convertRenderModeToString(EDataType eDataType, Object instanceValue) {
148:•                return instanceValue == null ? null : instanceValue.toString();
149:         }
150:
151:         /**
152:          * <!-- begin-user-doc -->
153:          * <!-- end-user-doc -->
154:          *
155:          * @generated
156:          */
157:         @Override
158:         public VTTableStylePropertyPackage getTableStylePropertyPackage() {
159:                 return (VTTableStylePropertyPackage) getEPackage();
160:         }
161:
162:         /**
163:          * <!-- begin-user-doc -->
164:          * <!-- end-user-doc -->
165:          *
166:          * @deprecated
167:          * @generated
168:          */
169:         @Deprecated
170:         public static VTTableStylePropertyPackage getPackage() {
171:                 return VTTableStylePropertyPackage.eINSTANCE;
172:         }
173:
174: } // VTTableStylePropertyFactoryImpl