1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.fzi.se.quality.qualityannotation.impl; |
8 | |
9 | import de.fzi.se.quality.qualityannotation.*; |
10 | |
11 | import org.eclipse.emf.ecore.EClass; |
12 | import org.eclipse.emf.ecore.EDataType; |
13 | import org.eclipse.emf.ecore.EObject; |
14 | import org.eclipse.emf.ecore.EPackage; |
15 | |
16 | import org.eclipse.emf.ecore.impl.EFactoryImpl; |
17 | |
18 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
19 | |
20 | /** |
21 | * <!-- begin-user-doc --> |
22 | * An implementation of the model <b>Factory</b>. |
23 | * <!-- end-user-doc --> |
24 | * @generated |
25 | */ |
26 | public class QualityAnnotationFactoryImpl extends EFactoryImpl implements QualityAnnotationFactory { |
27 | /** |
28 | * Creates the default factory implementation. |
29 | * <!-- begin-user-doc --> |
30 | * <!-- end-user-doc --> |
31 | * @generated |
32 | */ |
33 | public static QualityAnnotationFactory init() { |
34 | try { |
35 | QualityAnnotationFactory theQualityAnnotationFactory = (QualityAnnotationFactory)EPackage.Registry.INSTANCE.getEFactory("http://fzi.de/PalladioComponentModel/Quality/QualityAnnotation/0.2"); |
36 | if (theQualityAnnotationFactory != null) { |
37 | return theQualityAnnotationFactory; |
38 | } |
39 | } |
40 | catch (Exception exception) { |
41 | EcorePlugin.INSTANCE.log(exception); |
42 | } |
43 | return new QualityAnnotationFactoryImpl(); |
44 | } |
45 | |
46 | /** |
47 | * Creates an instance of the factory. |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @generated |
51 | */ |
52 | public QualityAnnotationFactoryImpl() { |
53 | super(); |
54 | } |
55 | |
56 | /** |
57 | * <!-- begin-user-doc --> |
58 | * <!-- end-user-doc --> |
59 | * @generated |
60 | */ |
61 | @Override |
62 | public EObject create(EClass eClass) { |
63 | switch (eClass.getClassifierID()) { |
64 | case QualityAnnotationPackage.CALL_PARAMETER_DEVIATION: return createCallParameterDeviation(); |
65 | case QualityAnnotationPackage.QUALITY_ANNOTATION: return createQualityAnnotation(); |
66 | case QualityAnnotationPackage.REQUIRED_ELEMENT: return createRequiredElement(); |
67 | case QualityAnnotationPackage.NUMBER_OF_CALLS_DEVIATION: return createNumberOfCallsDeviation(); |
68 | case QualityAnnotationPackage.INTERNAL_STATE_INFLUENCE_ANALYSIS_AGGREGATION: return createInternalStateInfluenceAnalysisAggregation(); |
69 | case QualityAnnotationPackage.RE_PRECISION: return createREPrecision(); |
70 | case QualityAnnotationPackage.PCM_PARAMETER_PARTITION: return createPCMParameterPartition(); |
71 | case QualityAnnotationPackage.CHARACTERISED_PCM_PARAMETER_PARTITION_INTERVAL: return createCharacterisedPCMParameterPartitionInterval(); |
72 | case QualityAnnotationPackage.CHARACTERISED_PCM_PARAMETER_PARTITION_RANGE: return createCharacterisedPCMParameterPartitionRange(); |
73 | case QualityAnnotationPackage.EXACTLY_AS_SPECIFIED_PRECISION: return createExactlyAsSpecifiedPrecision(); |
74 | case QualityAnnotationPackage.LIMITED_DEVIATION_PRECISION: return createLimitedDeviationPrecision(); |
75 | case QualityAnnotationPackage.NO_PRECISION: return createNoPrecision(); |
76 | case QualityAnnotationPackage.PCMRE_CATEGORY: return createPCMRECategory(); |
77 | case QualityAnnotationPackage.PCMRE_INTERFACE: return createPCMREInterface(); |
78 | case QualityAnnotationPackage.PCMRE_ROLE: return createPCMRERole(); |
79 | case QualityAnnotationPackage.PCMRE_SIGNATURE: return createPCMRESignature(); |
80 | case QualityAnnotationPackage.PCM_SERVICE_SPECIFICATION: return createPCMServiceSpecification(); |
81 | case QualityAnnotationPackage.PCMRE_RESOURCE_INTERFACE: return createPCMREResourceInterface(); |
82 | case QualityAnnotationPackage.PCMRE_RESOURCE_SIGNATURE: return createPCMREResourceSignature(); |
83 | default: |
84 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
85 | } |
86 | } |
87 | |
88 | /** |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | @Override |
94 | public Object createFromString(EDataType eDataType, String initialValue) { |
95 | switch (eDataType.getClassifierID()) { |
96 | case QualityAnnotationPackage.PCMRE_REQUEST_CATEGORY: |
97 | return createPCMRERequestCategoryFromString(eDataType, initialValue); |
98 | default: |
99 | throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
100 | } |
101 | } |
102 | |
103 | /** |
104 | * <!-- begin-user-doc --> |
105 | * <!-- end-user-doc --> |
106 | * @generated |
107 | */ |
108 | @Override |
109 | public String convertToString(EDataType eDataType, Object instanceValue) { |
110 | switch (eDataType.getClassifierID()) { |
111 | case QualityAnnotationPackage.PCMRE_REQUEST_CATEGORY: |
112 | return convertPCMRERequestCategoryToString(eDataType, instanceValue); |
113 | default: |
114 | throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
115 | } |
116 | } |
117 | |
118 | /** |
119 | * <!-- begin-user-doc --> |
120 | * <!-- end-user-doc --> |
121 | * @generated |
122 | */ |
123 | public CallParameterDeviation createCallParameterDeviation() { |
124 | CallParameterDeviationImpl callParameterDeviation = new CallParameterDeviationImpl(); |
125 | return callParameterDeviation; |
126 | } |
127 | |
128 | /** |
129 | * <!-- begin-user-doc --> |
130 | * <!-- end-user-doc --> |
131 | * @generated |
132 | */ |
133 | public QualityAnnotation createQualityAnnotation() { |
134 | QualityAnnotationImpl qualityAnnotation = new QualityAnnotationImpl(); |
135 | return qualityAnnotation; |
136 | } |
137 | |
138 | /** |
139 | * <!-- begin-user-doc --> |
140 | * <!-- end-user-doc --> |
141 | * @generated |
142 | */ |
143 | public RequiredElement createRequiredElement() { |
144 | RequiredElementImpl requiredElement = new RequiredElementImpl(); |
145 | return requiredElement; |
146 | } |
147 | |
148 | /** |
149 | * <!-- begin-user-doc --> |
150 | * <!-- end-user-doc --> |
151 | * @generated |
152 | */ |
153 | public NumberOfCallsDeviation createNumberOfCallsDeviation() { |
154 | NumberOfCallsDeviationImpl numberOfCallsDeviation = new NumberOfCallsDeviationImpl(); |
155 | return numberOfCallsDeviation; |
156 | } |
157 | |
158 | /** |
159 | * <!-- begin-user-doc --> |
160 | * <!-- end-user-doc --> |
161 | * @generated |
162 | */ |
163 | public InternalStateInfluenceAnalysisAggregation createInternalStateInfluenceAnalysisAggregation() { |
164 | InternalStateInfluenceAnalysisAggregationImpl internalStateInfluenceAnalysisAggregation = new InternalStateInfluenceAnalysisAggregationImpl(); |
165 | return internalStateInfluenceAnalysisAggregation; |
166 | } |
167 | |
168 | /** |
169 | * <!-- begin-user-doc --> |
170 | * <!-- end-user-doc --> |
171 | * @generated |
172 | */ |
173 | public REPrecision createREPrecision() { |
174 | REPrecisionImpl rePrecision = new REPrecisionImpl(); |
175 | return rePrecision; |
176 | } |
177 | |
178 | /** |
179 | * <!-- begin-user-doc --> |
180 | * <!-- end-user-doc --> |
181 | * @generated |
182 | */ |
183 | public PCMParameterPartition createPCMParameterPartition() { |
184 | PCMParameterPartitionImpl pcmParameterPartition = new PCMParameterPartitionImpl(); |
185 | return pcmParameterPartition; |
186 | } |
187 | |
188 | /** |
189 | * <!-- begin-user-doc --> |
190 | * <!-- end-user-doc --> |
191 | * @generated |
192 | */ |
193 | public CharacterisedPCMParameterPartitionInterval createCharacterisedPCMParameterPartitionInterval() { |
194 | CharacterisedPCMParameterPartitionIntervalImpl characterisedPCMParameterPartitionInterval = new CharacterisedPCMParameterPartitionIntervalImpl(); |
195 | return characterisedPCMParameterPartitionInterval; |
196 | } |
197 | |
198 | /** |
199 | * <!-- begin-user-doc --> |
200 | * <!-- end-user-doc --> |
201 | * @generated |
202 | */ |
203 | public CharacterisedPCMParameterPartitionRange createCharacterisedPCMParameterPartitionRange() { |
204 | CharacterisedPCMParameterPartitionRangeImpl characterisedPCMParameterPartitionRange = new CharacterisedPCMParameterPartitionRangeImpl(); |
205 | return characterisedPCMParameterPartitionRange; |
206 | } |
207 | |
208 | /** |
209 | * <!-- begin-user-doc --> |
210 | * <!-- end-user-doc --> |
211 | * @generated |
212 | */ |
213 | public ExactlyAsSpecifiedPrecision createExactlyAsSpecifiedPrecision() { |
214 | ExactlyAsSpecifiedPrecisionImpl exactlyAsSpecifiedPrecision = new ExactlyAsSpecifiedPrecisionImpl(); |
215 | return exactlyAsSpecifiedPrecision; |
216 | } |
217 | |
218 | /** |
219 | * <!-- begin-user-doc --> |
220 | * <!-- end-user-doc --> |
221 | * @generated |
222 | */ |
223 | public LimitedDeviationPrecision createLimitedDeviationPrecision() { |
224 | LimitedDeviationPrecisionImpl limitedDeviationPrecision = new LimitedDeviationPrecisionImpl(); |
225 | return limitedDeviationPrecision; |
226 | } |
227 | |
228 | /** |
229 | * <!-- begin-user-doc --> |
230 | * <!-- end-user-doc --> |
231 | * @generated |
232 | */ |
233 | public NoPrecision createNoPrecision() { |
234 | NoPrecisionImpl noPrecision = new NoPrecisionImpl(); |
235 | return noPrecision; |
236 | } |
237 | |
238 | /** |
239 | * <!-- begin-user-doc --> |
240 | * <!-- end-user-doc --> |
241 | * @generated |
242 | */ |
243 | public PCMRECategory createPCMRECategory() { |
244 | PCMRECategoryImpl pcmreCategory = new PCMRECategoryImpl(); |
245 | return pcmreCategory; |
246 | } |
247 | |
248 | /** |
249 | * <!-- begin-user-doc --> |
250 | * <!-- end-user-doc --> |
251 | * @generated |
252 | */ |
253 | public PCMREInterface createPCMREInterface() { |
254 | PCMREInterfaceImpl pcmreInterface = new PCMREInterfaceImpl(); |
255 | return pcmreInterface; |
256 | } |
257 | |
258 | /** |
259 | * <!-- begin-user-doc --> |
260 | * <!-- end-user-doc --> |
261 | * @generated |
262 | */ |
263 | public PCMRERole createPCMRERole() { |
264 | PCMRERoleImpl pcmreRole = new PCMRERoleImpl(); |
265 | return pcmreRole; |
266 | } |
267 | |
268 | /** |
269 | * <!-- begin-user-doc --> |
270 | * <!-- end-user-doc --> |
271 | * @generated |
272 | */ |
273 | public PCMRESignature createPCMRESignature() { |
274 | PCMRESignatureImpl pcmreSignature = new PCMRESignatureImpl(); |
275 | return pcmreSignature; |
276 | } |
277 | |
278 | /** |
279 | * <!-- begin-user-doc --> |
280 | * <!-- end-user-doc --> |
281 | * @generated |
282 | */ |
283 | public PCMServiceSpecification createPCMServiceSpecification() { |
284 | PCMServiceSpecificationImpl pcmServiceSpecification = new PCMServiceSpecificationImpl(); |
285 | return pcmServiceSpecification; |
286 | } |
287 | |
288 | /** |
289 | * <!-- begin-user-doc --> |
290 | * <!-- end-user-doc --> |
291 | * @generated |
292 | */ |
293 | public PCMREResourceInterface createPCMREResourceInterface() { |
294 | PCMREResourceInterfaceImpl pcmreResourceInterface = new PCMREResourceInterfaceImpl(); |
295 | return pcmreResourceInterface; |
296 | } |
297 | |
298 | /** |
299 | * <!-- begin-user-doc --> |
300 | * <!-- end-user-doc --> |
301 | * @generated |
302 | */ |
303 | public PCMREResourceSignature createPCMREResourceSignature() { |
304 | PCMREResourceSignatureImpl pcmreResourceSignature = new PCMREResourceSignatureImpl(); |
305 | return pcmreResourceSignature; |
306 | } |
307 | |
308 | /** |
309 | * <!-- begin-user-doc --> |
310 | * <!-- end-user-doc --> |
311 | * @generated |
312 | */ |
313 | public PCMRERequestCategory createPCMRERequestCategoryFromString(EDataType eDataType, String initialValue) { |
314 | PCMRERequestCategory result = PCMRERequestCategory.get(initialValue); |
315 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
316 | return result; |
317 | } |
318 | |
319 | /** |
320 | * <!-- begin-user-doc --> |
321 | * <!-- end-user-doc --> |
322 | * @generated |
323 | */ |
324 | public String convertPCMRERequestCategoryToString(EDataType eDataType, Object instanceValue) { |
325 | return instanceValue == null ? null : instanceValue.toString(); |
326 | } |
327 | |
328 | /** |
329 | * <!-- begin-user-doc --> |
330 | * <!-- end-user-doc --> |
331 | * @generated |
332 | */ |
333 | public QualityAnnotationPackage getQualityAnnotationPackage() { |
334 | return (QualityAnnotationPackage)getEPackage(); |
335 | } |
336 | |
337 | /** |
338 | * <!-- begin-user-doc --> |
339 | * <!-- end-user-doc --> |
340 | * @deprecated |
341 | * @generated |
342 | */ |
343 | @Deprecated |
344 | public static QualityAnnotationPackage getPackage() { |
345 | return QualityAnnotationPackage.eINSTANCE; |
346 | } |
347 | |
348 | } //QualityAnnotationFactoryImpl |