Skip to content

Package: VTUnsettableFactoryImpl

VTUnsettableFactoryImpl

nameinstructionbranchcomplexitylinemethod
VTUnsettableFactoryImpl()
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%
convertButtonAlignmentTypeToString(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%
convertButtonPlacementTypeToString(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: 27 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 4 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%
createButtonAlignmentTypeFromString(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%
createButtonPlacementTypeFromString(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%
createFromString(EDataType, String)
M: 27 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
createUnsettableStyleProperty()
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%
getUnsettablePackage()
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-2017 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.unsettable.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.unsettable.model.ButtonAlignmentType;
23: import org.eclipse.emf.ecp.view.template.style.unsettable.model.ButtonPlacementType;
24: import org.eclipse.emf.ecp.view.template.style.unsettable.model.VTUnsettableFactory;
25: import org.eclipse.emf.ecp.view.template.style.unsettable.model.VTUnsettablePackage;
26: import org.eclipse.emf.ecp.view.template.style.unsettable.model.VTUnsettableStyleProperty;
27:
28: /**
29: * <!-- begin-user-doc -->
30: * An implementation of the model <b>Factory</b>.
31: * <!-- end-user-doc -->
32: *
33: * @generated
34: */
35: public class VTUnsettableFactoryImpl extends EFactoryImpl implements VTUnsettableFactory {
36:         /**
37:          * Creates the default factory implementation.
38:          * <!-- begin-user-doc -->
39:          * <!-- end-user-doc -->
40:          *
41:          * @generated
42:          */
43:         public static VTUnsettableFactory init() {
44:                 try {
45:                         final VTUnsettableFactory theUnsettableFactory = (VTUnsettableFactory) EPackage.Registry.INSTANCE
46:                                 .getEFactory(VTUnsettablePackage.eNS_URI);
47:•                        if (theUnsettableFactory != null) {
48:                                 return theUnsettableFactory;
49:                         }
50:                 } catch (final Exception exception) {
51:                         EcorePlugin.INSTANCE.log(exception);
52:                 }
53:                 return new VTUnsettableFactoryImpl();
54:         }
55:
56:         /**
57:          * Creates an instance of the factory.
58:          * <!-- begin-user-doc -->
59:          * <!-- end-user-doc -->
60:          *
61:          * @generated
62:          */
63:         public VTUnsettableFactoryImpl() {
64:                 super();
65:         }
66:
67:         /**
68:          * <!-- begin-user-doc -->
69:          * <!-- end-user-doc -->
70:          *
71:          * @generated
72:          */
73:         @Override
74:         public EObject create(EClass eClass) {
75:•                switch (eClass.getClassifierID()) {
76:                 case VTUnsettablePackage.UNSETTABLE_STYLE_PROPERTY:
77:                         return createUnsettableStyleProperty();
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 Object createFromString(EDataType eDataType, String initialValue) {
91:•                switch (eDataType.getClassifierID()) {
92:                 case VTUnsettablePackage.BUTTON_ALIGNMENT_TYPE:
93:                         return createButtonAlignmentTypeFromString(eDataType, initialValue);
94:                 case VTUnsettablePackage.BUTTON_PLACEMENT_TYPE:
95:                         return createButtonPlacementTypeFromString(eDataType, initialValue);
96:                 default:
97:                         throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
98:                 }
99:         }
100:
101:         /**
102:          * <!-- begin-user-doc -->
103:          * <!-- end-user-doc -->
104:          *
105:          * @generated
106:          */
107:         @Override
108:         public String convertToString(EDataType eDataType, Object instanceValue) {
109:•                switch (eDataType.getClassifierID()) {
110:                 case VTUnsettablePackage.BUTTON_ALIGNMENT_TYPE:
111:                         return convertButtonAlignmentTypeToString(eDataType, instanceValue);
112:                 case VTUnsettablePackage.BUTTON_PLACEMENT_TYPE:
113:                         return convertButtonPlacementTypeToString(eDataType, instanceValue);
114:                 default:
115:                         throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
116:                 }
117:         }
118:
119:         /**
120:          * <!-- begin-user-doc -->
121:          * <!-- end-user-doc -->
122:          *
123:          * @generated
124:          */
125:         @Override
126:         public VTUnsettableStyleProperty createUnsettableStyleProperty() {
127:                 final VTUnsettableStylePropertyImpl unsettableStyleProperty = new VTUnsettableStylePropertyImpl();
128:                 return unsettableStyleProperty;
129:         }
130:
131:         /**
132:          * <!-- begin-user-doc -->
133:          * <!-- end-user-doc -->
134:          *
135:          * @generated
136:          */
137:         public ButtonAlignmentType createButtonAlignmentTypeFromString(EDataType eDataType, String initialValue) {
138:                 final ButtonAlignmentType result = ButtonAlignmentType.get(initialValue);
139:•                if (result == null) {
140:                         throw new IllegalArgumentException(
141:                                 "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
142:                 }
143:                 return result;
144:         }
145:
146:         /**
147:          * <!-- begin-user-doc -->
148:          * <!-- end-user-doc -->
149:          *
150:          * @generated
151:          */
152:         public String convertButtonAlignmentTypeToString(EDataType eDataType, Object instanceValue) {
153:•                return instanceValue == null ? null : instanceValue.toString();
154:         }
155:
156:         /**
157:          * <!-- begin-user-doc -->
158:          * <!-- end-user-doc -->
159:          *
160:          * @generated
161:          */
162:         public ButtonPlacementType createButtonPlacementTypeFromString(EDataType eDataType, String initialValue) {
163:                 final ButtonPlacementType result = ButtonPlacementType.get(initialValue);
164:•                if (result == null) {
165:                         throw new IllegalArgumentException(
166:                                 "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
167:                 }
168:                 return result;
169:         }
170:
171:         /**
172:          * <!-- begin-user-doc -->
173:          * <!-- end-user-doc -->
174:          *
175:          * @generated
176:          */
177:         public String convertButtonPlacementTypeToString(EDataType eDataType, Object instanceValue) {
178:•                return instanceValue == null ? null : instanceValue.toString();
179:         }
180:
181:         /**
182:          * <!-- begin-user-doc -->
183:          * <!-- end-user-doc -->
184:          *
185:          * @generated
186:          */
187:         @Override
188:         public VTUnsettablePackage getUnsettablePackage() {
189:                 return (VTUnsettablePackage) getEPackage();
190:         }
191:
192:         /**
193:          * <!-- begin-user-doc -->
194:          * <!-- end-user-doc -->
195:          *
196:          * @deprecated
197:          * @generated
198:          */
199:         @Deprecated
200:         public static VTUnsettablePackage getPackage() {
201:                 return VTUnsettablePackage.eINSTANCE;
202:         }
203:
204: } // VTUnsettableFactoryImpl