1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package EssentialOCL.impl; |
8 | |
9 | import EssentialOCL.*; |
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 EssentialOCLFactoryImpl extends EFactoryImpl implements EssentialOCLFactory { |
27 | /** |
28 | * Creates the default factory implementation. |
29 | * <!-- begin-user-doc --> |
30 | * <!-- end-user-doc --> |
31 | * @generated |
32 | */ |
33 | public static EssentialOCLFactory init() { |
34 | try { |
35 | EssentialOCLFactory theEssentialOCLFactory = (EssentialOCLFactory)EPackage.Registry.INSTANCE.getEFactory("http://schema.omg.org/spec/QVT/1.0/essentialocl.xml"); |
36 | if (theEssentialOCLFactory != null) { |
37 | return theEssentialOCLFactory; |
38 | } |
39 | } |
40 | catch (Exception exception) { |
41 | EcorePlugin.INSTANCE.log(exception); |
42 | } |
43 | return new EssentialOCLFactoryImpl(); |
44 | } |
45 | |
46 | /** |
47 | * Creates an instance of the factory. |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @generated |
51 | */ |
52 | public EssentialOCLFactoryImpl() { |
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 EssentialOCLPackage.ANY_TYPE: return createAnyType(); |
65 | case EssentialOCLPackage.BAG_TYPE: return createBagType(); |
66 | case EssentialOCLPackage.BOOLEAN_LITERAL_EXP: return createBooleanLiteralExp(); |
67 | case EssentialOCLPackage.COLLECTION_ITEM: return createCollectionItem(); |
68 | case EssentialOCLPackage.COLLECTION_LITERAL_EXP: return createCollectionLiteralExp(); |
69 | case EssentialOCLPackage.COLLECTION_RANGE: return createCollectionRange(); |
70 | case EssentialOCLPackage.COLLECTION_TYPE: return createCollectionType(); |
71 | case EssentialOCLPackage.ENUM_LITERAL_EXP: return createEnumLiteralExp(); |
72 | case EssentialOCLPackage.EXPRESSION_IN_OCL: return createExpressionInOcl(); |
73 | case EssentialOCLPackage.IF_EXP: return createIfExp(); |
74 | case EssentialOCLPackage.INTEGER_LITERAL_EXP: return createIntegerLiteralExp(); |
75 | case EssentialOCLPackage.INVALID_LITERAL_EXP: return createInvalidLiteralExp(); |
76 | case EssentialOCLPackage.INVALID_TYPE: return createInvalidType(); |
77 | case EssentialOCLPackage.ITERATE_EXP: return createIterateExp(); |
78 | case EssentialOCLPackage.ITERATOR_EXP: return createIteratorExp(); |
79 | case EssentialOCLPackage.LET_EXP: return createLetExp(); |
80 | case EssentialOCLPackage.NAVIGATION_CALL_EXP: return createNavigationCallExp(); |
81 | case EssentialOCLPackage.NULL_LITERAL_EXP: return createNullLiteralExp(); |
82 | case EssentialOCLPackage.OPERATION_CALL_EXP: return createOperationCallExp(); |
83 | case EssentialOCLPackage.ORDERED_SET_TYPE: return createOrderedSetType(); |
84 | case EssentialOCLPackage.PROPERTY_CALL_EXP: return createPropertyCallExp(); |
85 | case EssentialOCLPackage.REAL_LITERAL_EXP: return createRealLiteralExp(); |
86 | case EssentialOCLPackage.SEQUENCE_TYPE: return createSequenceType(); |
87 | case EssentialOCLPackage.SET_TYPE: return createSetType(); |
88 | case EssentialOCLPackage.STRING_LITERAL_EXP: return createStringLiteralExp(); |
89 | case EssentialOCLPackage.TUPLE_LITERAL_EXP: return createTupleLiteralExp(); |
90 | case EssentialOCLPackage.TUPLE_LITERAL_PART: return createTupleLiteralPart(); |
91 | case EssentialOCLPackage.TUPLE_TYPE: return createTupleType(); |
92 | case EssentialOCLPackage.TYPE_EXP: return createTypeExp(); |
93 | case EssentialOCLPackage.TYPE_TYPE: return createTypeType(); |
94 | case EssentialOCLPackage.UNLIMITED_NATURAL_EXP: return createUnlimitedNaturalExp(); |
95 | case EssentialOCLPackage.VARIABLE: return createVariable(); |
96 | case EssentialOCLPackage.VARIABLE_EXP: return createVariableExp(); |
97 | case EssentialOCLPackage.VOID_TYPE: return createVoidType(); |
98 | default: |
99 | throw new IllegalArgumentException("The class '" + eClass.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 Object createFromString(EDataType eDataType, String initialValue) { |
110 | switch (eDataType.getClassifierID()) { |
111 | case EssentialOCLPackage.COLLECTION_KIND: |
112 | return createCollectionKindFromString(eDataType, initialValue); |
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 | @Override |
124 | public String convertToString(EDataType eDataType, Object instanceValue) { |
125 | switch (eDataType.getClassifierID()) { |
126 | case EssentialOCLPackage.COLLECTION_KIND: |
127 | return convertCollectionKindToString(eDataType, instanceValue); |
128 | default: |
129 | throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
130 | } |
131 | } |
132 | |
133 | /** |
134 | * <!-- begin-user-doc --> |
135 | * <!-- end-user-doc --> |
136 | * @generated |
137 | */ |
138 | public AnyType createAnyType() { |
139 | AnyTypeImpl anyType = new AnyTypeImpl(); |
140 | return anyType; |
141 | } |
142 | |
143 | /** |
144 | * <!-- begin-user-doc --> |
145 | * <!-- end-user-doc --> |
146 | * @generated |
147 | */ |
148 | public BagType createBagType() { |
149 | BagTypeImpl bagType = new BagTypeImpl(); |
150 | return bagType; |
151 | } |
152 | |
153 | /** |
154 | * <!-- begin-user-doc --> |
155 | * <!-- end-user-doc --> |
156 | * @generated |
157 | */ |
158 | public BooleanLiteralExp createBooleanLiteralExp() { |
159 | BooleanLiteralExpImpl booleanLiteralExp = new BooleanLiteralExpImpl(); |
160 | return booleanLiteralExp; |
161 | } |
162 | |
163 | /** |
164 | * <!-- begin-user-doc --> |
165 | * <!-- end-user-doc --> |
166 | * @generated |
167 | */ |
168 | public CollectionItem createCollectionItem() { |
169 | CollectionItemImpl collectionItem = new CollectionItemImpl(); |
170 | return collectionItem; |
171 | } |
172 | |
173 | /** |
174 | * <!-- begin-user-doc --> |
175 | * <!-- end-user-doc --> |
176 | * @generated |
177 | */ |
178 | public CollectionLiteralExp createCollectionLiteralExp() { |
179 | CollectionLiteralExpImpl collectionLiteralExp = new CollectionLiteralExpImpl(); |
180 | return collectionLiteralExp; |
181 | } |
182 | |
183 | /** |
184 | * <!-- begin-user-doc --> |
185 | * <!-- end-user-doc --> |
186 | * @generated |
187 | */ |
188 | public CollectionRange createCollectionRange() { |
189 | CollectionRangeImpl collectionRange = new CollectionRangeImpl(); |
190 | return collectionRange; |
191 | } |
192 | |
193 | /** |
194 | * <!-- begin-user-doc --> |
195 | * <!-- end-user-doc --> |
196 | * @generated |
197 | */ |
198 | public CollectionType createCollectionType() { |
199 | CollectionTypeImpl collectionType = new CollectionTypeImpl(); |
200 | return collectionType; |
201 | } |
202 | |
203 | /** |
204 | * <!-- begin-user-doc --> |
205 | * <!-- end-user-doc --> |
206 | * @generated |
207 | */ |
208 | public EnumLiteralExp createEnumLiteralExp() { |
209 | EnumLiteralExpImpl enumLiteralExp = new EnumLiteralExpImpl(); |
210 | return enumLiteralExp; |
211 | } |
212 | |
213 | /** |
214 | * <!-- begin-user-doc --> |
215 | * <!-- end-user-doc --> |
216 | * @generated |
217 | */ |
218 | public ExpressionInOcl createExpressionInOcl() { |
219 | ExpressionInOclImpl expressionInOcl = new ExpressionInOclImpl(); |
220 | return expressionInOcl; |
221 | } |
222 | |
223 | /** |
224 | * <!-- begin-user-doc --> |
225 | * <!-- end-user-doc --> |
226 | * @generated |
227 | */ |
228 | public IfExp createIfExp() { |
229 | IfExpImpl ifExp = new IfExpImpl(); |
230 | return ifExp; |
231 | } |
232 | |
233 | /** |
234 | * <!-- begin-user-doc --> |
235 | * <!-- end-user-doc --> |
236 | * @generated |
237 | */ |
238 | public IntegerLiteralExp createIntegerLiteralExp() { |
239 | IntegerLiteralExpImpl integerLiteralExp = new IntegerLiteralExpImpl(); |
240 | return integerLiteralExp; |
241 | } |
242 | |
243 | /** |
244 | * <!-- begin-user-doc --> |
245 | * <!-- end-user-doc --> |
246 | * @generated |
247 | */ |
248 | public InvalidLiteralExp createInvalidLiteralExp() { |
249 | InvalidLiteralExpImpl invalidLiteralExp = new InvalidLiteralExpImpl(); |
250 | return invalidLiteralExp; |
251 | } |
252 | |
253 | /** |
254 | * <!-- begin-user-doc --> |
255 | * <!-- end-user-doc --> |
256 | * @generated |
257 | */ |
258 | public InvalidType createInvalidType() { |
259 | InvalidTypeImpl invalidType = new InvalidTypeImpl(); |
260 | return invalidType; |
261 | } |
262 | |
263 | /** |
264 | * <!-- begin-user-doc --> |
265 | * <!-- end-user-doc --> |
266 | * @generated |
267 | */ |
268 | public IterateExp createIterateExp() { |
269 | IterateExpImpl iterateExp = new IterateExpImpl(); |
270 | return iterateExp; |
271 | } |
272 | |
273 | /** |
274 | * <!-- begin-user-doc --> |
275 | * <!-- end-user-doc --> |
276 | * @generated |
277 | */ |
278 | public IteratorExp createIteratorExp() { |
279 | IteratorExpImpl iteratorExp = new IteratorExpImpl(); |
280 | return iteratorExp; |
281 | } |
282 | |
283 | /** |
284 | * <!-- begin-user-doc --> |
285 | * <!-- end-user-doc --> |
286 | * @generated |
287 | */ |
288 | public LetExp createLetExp() { |
289 | LetExpImpl letExp = new LetExpImpl(); |
290 | return letExp; |
291 | } |
292 | |
293 | /** |
294 | * <!-- begin-user-doc --> |
295 | * <!-- end-user-doc --> |
296 | * @generated |
297 | */ |
298 | public NavigationCallExp createNavigationCallExp() { |
299 | NavigationCallExpImpl navigationCallExp = new NavigationCallExpImpl(); |
300 | return navigationCallExp; |
301 | } |
302 | |
303 | /** |
304 | * <!-- begin-user-doc --> |
305 | * <!-- end-user-doc --> |
306 | * @generated |
307 | */ |
308 | public NullLiteralExp createNullLiteralExp() { |
309 | NullLiteralExpImpl nullLiteralExp = new NullLiteralExpImpl(); |
310 | return nullLiteralExp; |
311 | } |
312 | |
313 | /** |
314 | * <!-- begin-user-doc --> |
315 | * <!-- end-user-doc --> |
316 | * @generated |
317 | */ |
318 | public OperationCallExp createOperationCallExp() { |
319 | OperationCallExpImpl operationCallExp = new OperationCallExpImpl(); |
320 | return operationCallExp; |
321 | } |
322 | |
323 | /** |
324 | * <!-- begin-user-doc --> |
325 | * <!-- end-user-doc --> |
326 | * @generated |
327 | */ |
328 | public OrderedSetType createOrderedSetType() { |
329 | OrderedSetTypeImpl orderedSetType = new OrderedSetTypeImpl(); |
330 | return orderedSetType; |
331 | } |
332 | |
333 | /** |
334 | * <!-- begin-user-doc --> |
335 | * <!-- end-user-doc --> |
336 | * @generated |
337 | */ |
338 | public PropertyCallExp createPropertyCallExp() { |
339 | PropertyCallExpImpl propertyCallExp = new PropertyCallExpImpl(); |
340 | return propertyCallExp; |
341 | } |
342 | |
343 | /** |
344 | * <!-- begin-user-doc --> |
345 | * <!-- end-user-doc --> |
346 | * @generated |
347 | */ |
348 | public RealLiteralExp createRealLiteralExp() { |
349 | RealLiteralExpImpl realLiteralExp = new RealLiteralExpImpl(); |
350 | return realLiteralExp; |
351 | } |
352 | |
353 | /** |
354 | * <!-- begin-user-doc --> |
355 | * <!-- end-user-doc --> |
356 | * @generated |
357 | */ |
358 | public SequenceType createSequenceType() { |
359 | SequenceTypeImpl sequenceType = new SequenceTypeImpl(); |
360 | return sequenceType; |
361 | } |
362 | |
363 | /** |
364 | * <!-- begin-user-doc --> |
365 | * <!-- end-user-doc --> |
366 | * @generated |
367 | */ |
368 | public SetType createSetType() { |
369 | SetTypeImpl setType = new SetTypeImpl(); |
370 | return setType; |
371 | } |
372 | |
373 | /** |
374 | * <!-- begin-user-doc --> |
375 | * <!-- end-user-doc --> |
376 | * @generated |
377 | */ |
378 | public StringLiteralExp createStringLiteralExp() { |
379 | StringLiteralExpImpl stringLiteralExp = new StringLiteralExpImpl(); |
380 | return stringLiteralExp; |
381 | } |
382 | |
383 | /** |
384 | * <!-- begin-user-doc --> |
385 | * <!-- end-user-doc --> |
386 | * @generated |
387 | */ |
388 | public TupleLiteralExp createTupleLiteralExp() { |
389 | TupleLiteralExpImpl tupleLiteralExp = new TupleLiteralExpImpl(); |
390 | return tupleLiteralExp; |
391 | } |
392 | |
393 | /** |
394 | * <!-- begin-user-doc --> |
395 | * <!-- end-user-doc --> |
396 | * @generated |
397 | */ |
398 | public TupleLiteralPart createTupleLiteralPart() { |
399 | TupleLiteralPartImpl tupleLiteralPart = new TupleLiteralPartImpl(); |
400 | return tupleLiteralPart; |
401 | } |
402 | |
403 | /** |
404 | * <!-- begin-user-doc --> |
405 | * <!-- end-user-doc --> |
406 | * @generated |
407 | */ |
408 | public TupleType createTupleType() { |
409 | TupleTypeImpl tupleType = new TupleTypeImpl(); |
410 | return tupleType; |
411 | } |
412 | |
413 | /** |
414 | * <!-- begin-user-doc --> |
415 | * <!-- end-user-doc --> |
416 | * @generated |
417 | */ |
418 | public TypeExp createTypeExp() { |
419 | TypeExpImpl typeExp = new TypeExpImpl(); |
420 | return typeExp; |
421 | } |
422 | |
423 | /** |
424 | * <!-- begin-user-doc --> |
425 | * <!-- end-user-doc --> |
426 | * @generated |
427 | */ |
428 | public TypeType createTypeType() { |
429 | TypeTypeImpl typeType = new TypeTypeImpl(); |
430 | return typeType; |
431 | } |
432 | |
433 | /** |
434 | * <!-- begin-user-doc --> |
435 | * <!-- end-user-doc --> |
436 | * @generated |
437 | */ |
438 | public UnlimitedNaturalExp createUnlimitedNaturalExp() { |
439 | UnlimitedNaturalExpImpl unlimitedNaturalExp = new UnlimitedNaturalExpImpl(); |
440 | return unlimitedNaturalExp; |
441 | } |
442 | |
443 | /** |
444 | * <!-- begin-user-doc --> |
445 | * <!-- end-user-doc --> |
446 | * @generated |
447 | */ |
448 | public Variable createVariable() { |
449 | VariableImpl variable = new VariableImpl(); |
450 | return variable; |
451 | } |
452 | |
453 | /** |
454 | * <!-- begin-user-doc --> |
455 | * <!-- end-user-doc --> |
456 | * @generated |
457 | */ |
458 | public VariableExp createVariableExp() { |
459 | VariableExpImpl variableExp = new VariableExpImpl(); |
460 | return variableExp; |
461 | } |
462 | |
463 | /** |
464 | * <!-- begin-user-doc --> |
465 | * <!-- end-user-doc --> |
466 | * @generated |
467 | */ |
468 | public VoidType createVoidType() { |
469 | VoidTypeImpl voidType = new VoidTypeImpl(); |
470 | return voidType; |
471 | } |
472 | |
473 | /** |
474 | * <!-- begin-user-doc --> |
475 | * <!-- end-user-doc --> |
476 | * @generated |
477 | */ |
478 | public CollectionKind createCollectionKindFromString(EDataType eDataType, String initialValue) { |
479 | CollectionKind result = CollectionKind.get(initialValue); |
480 | if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); |
481 | return result; |
482 | } |
483 | |
484 | /** |
485 | * <!-- begin-user-doc --> |
486 | * <!-- end-user-doc --> |
487 | * @generated |
488 | */ |
489 | public String convertCollectionKindToString(EDataType eDataType, Object instanceValue) { |
490 | return instanceValue == null ? null : instanceValue.toString(); |
491 | } |
492 | |
493 | /** |
494 | * <!-- begin-user-doc --> |
495 | * <!-- end-user-doc --> |
496 | * @generated |
497 | */ |
498 | public EssentialOCLPackage getEssentialOCLPackage() { |
499 | return (EssentialOCLPackage)getEPackage(); |
500 | } |
501 | |
502 | /** |
503 | * <!-- begin-user-doc --> |
504 | * <!-- end-user-doc --> |
505 | * @deprecated |
506 | * @generated |
507 | */ |
508 | @Deprecated |
509 | public static EssentialOCLPackage getPackage() { |
510 | return EssentialOCLPackage.eINSTANCE; |
511 | } |
512 | |
513 | } //EssentialOCLFactoryImpl |