1
2
3
4
5
6
7 package org.mod4j.dsl.service.mm.ServiceDsl.impl;
8
9 import org.eclipse.emf.ecore.EAttribute;
10 import org.eclipse.emf.ecore.EClass;
11 import org.eclipse.emf.ecore.EEnum;
12 import org.eclipse.emf.ecore.EPackage;
13 import org.eclipse.emf.ecore.EReference;
14
15 import org.eclipse.emf.ecore.impl.EPackageImpl;
16
17 import org.mod4j.dsl.service.mm.ServiceDsl.AssociationMethod;
18 import org.mod4j.dsl.service.mm.ServiceDsl.CollectionType;
19 import org.mod4j.dsl.service.mm.ServiceDsl.CrudService;
20 import org.mod4j.dsl.service.mm.ServiceDsl.CustomMethod;
21 import org.mod4j.dsl.service.mm.ServiceDsl.DtoReference;
22 import org.mod4j.dsl.service.mm.ServiceDsl.MethodType;
23 import org.mod4j.dsl.service.mm.ServiceDsl.ModelElement;
24 import org.mod4j.dsl.service.mm.ServiceDsl.Parameter;
25 import org.mod4j.dsl.service.mm.ServiceDsl.ServiceDslFactory;
26 import org.mod4j.dsl.service.mm.ServiceDsl.ServiceDslPackage;
27 import org.mod4j.dsl.service.mm.ServiceDsl.ServiceMethod;
28 import org.mod4j.dsl.service.mm.ServiceDsl.ServiceModel;
29 import org.mod4j.dsl.service.mm.ServiceDsl.SpecialMethod;
30
31
32
33
34
35
36
37 public class ServiceDslPackageImpl extends EPackageImpl implements ServiceDslPackage {
38
39
40
41
42
43 private EClass serviceModelEClass = null;
44
45
46
47
48
49
50 private EClass modelElementEClass = null;
51
52
53
54
55
56
57 private EClass dtoReferenceEClass = null;
58
59
60
61
62
63
64 private EClass customMethodEClass = null;
65
66
67
68
69
70
71 private EClass crudServiceEClass = null;
72
73
74
75
76
77
78 private EClass specialMethodEClass = null;
79
80
81
82
83
84
85 private EClass serviceMethodEClass = null;
86
87
88
89
90
91
92 private EClass parameterEClass = null;
93
94
95
96
97
98
99 private EClass associationMethodEClass = null;
100
101
102
103
104
105
106 private EEnum methodTypeEEnum = null;
107
108
109
110
111
112
113 private EEnum collectionTypeEEnum = null;
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 private ServiceDslPackageImpl() {
131 super(eNS_URI, ServiceDslFactory.eINSTANCE);
132 }
133
134
135
136
137
138
139 private static boolean isInited = false;
140
141
142
143
144
145
146
147
148
149
150
151
152
153 public static ServiceDslPackage init() {
154 if (isInited) return (ServiceDslPackage)EPackage.Registry.INSTANCE.getEPackage(ServiceDslPackage.eNS_URI);
155
156
157 ServiceDslPackageImpl theServiceDslPackage = (ServiceDslPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ServiceDslPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ServiceDslPackageImpl());
158
159 isInited = true;
160
161
162 theServiceDslPackage.createPackageContents();
163
164
165 theServiceDslPackage.initializePackageContents();
166
167
168 theServiceDslPackage.freeze();
169
170
171
172 EPackage.Registry.INSTANCE.put(ServiceDslPackage.eNS_URI, theServiceDslPackage);
173 return theServiceDslPackage;
174 }
175
176
177
178
179
180
181 public EClass getServiceModel() {
182 return serviceModelEClass;
183 }
184
185
186
187
188
189
190 public EReference getServiceModel_Methods() {
191 return (EReference)serviceModelEClass.getEStructuralFeatures().get(0);
192 }
193
194
195
196
197
198
199 public EReference getServiceModel_DtoReferences() {
200 return (EReference)serviceModelEClass.getEStructuralFeatures().get(1);
201 }
202
203
204
205
206
207
208 public EReference getServiceModel_CrudServices() {
209 return (EReference)serviceModelEClass.getEStructuralFeatures().get(2);
210 }
211
212
213
214
215
216
217 public EClass getModelElement() {
218 return modelElementEClass;
219 }
220
221
222
223
224
225
226 public EAttribute getModelElement_Name() {
227 return (EAttribute)modelElementEClass.getEStructuralFeatures().get(0);
228 }
229
230
231
232
233
234
235 public EAttribute getModelElement_Description() {
236 return (EAttribute)modelElementEClass.getEStructuralFeatures().get(1);
237 }
238
239
240
241
242
243
244 public EClass getDtoReference() {
245 return dtoReferenceEClass;
246 }
247
248
249
250
251
252
253 public EAttribute getDtoReference_Modelname() {
254 return (EAttribute)dtoReferenceEClass.getEStructuralFeatures().get(0);
255 }
256
257
258
259
260
261
262 public EReference getDtoReference_Model() {
263 return (EReference)dtoReferenceEClass.getEStructuralFeatures().get(1);
264 }
265
266
267
268
269
270
271 public EClass getCustomMethod() {
272 return customMethodEClass;
273 }
274
275
276
277
278
279
280 public EReference getCustomMethod_OutParameter() {
281 return (EReference)customMethodEClass.getEStructuralFeatures().get(0);
282 }
283
284
285
286
287
288
289 public EReference getCustomMethod_InParameters() {
290 return (EReference)customMethodEClass.getEStructuralFeatures().get(1);
291 }
292
293
294
295
296
297
298 public EClass getCrudService() {
299 return crudServiceEClass;
300 }
301
302
303
304
305
306
307 public EReference getCrudService_Dto() {
308 return (EReference)crudServiceEClass.getEStructuralFeatures().get(0);
309 }
310
311
312
313
314
315
316 public EReference getCrudService_Model() {
317 return (EReference)crudServiceEClass.getEStructuralFeatures().get(1);
318 }
319
320
321
322
323
324
325 public EClass getSpecialMethod() {
326 return specialMethodEClass;
327 }
328
329
330
331
332
333
334 public EReference getSpecialMethod_Dto() {
335 return (EReference)specialMethodEClass.getEStructuralFeatures().get(0);
336 }
337
338
339
340
341
342
343 public EClass getServiceMethod() {
344 return serviceMethodEClass;
345 }
346
347
348
349
350
351
352 public EAttribute getServiceMethod_Type() {
353 return (EAttribute)serviceMethodEClass.getEStructuralFeatures().get(0);
354 }
355
356
357
358
359
360
361 public EReference getServiceMethod_Model() {
362 return (EReference)serviceMethodEClass.getEStructuralFeatures().get(1);
363 }
364
365
366
367
368
369
370 public EClass getParameter() {
371 return parameterEClass;
372 }
373
374
375
376
377
378
379 public EReference getParameter_Type() {
380 return (EReference)parameterEClass.getEStructuralFeatures().get(0);
381 }
382
383
384
385
386
387
388 public EReference getParameter_Method() {
389 return (EReference)parameterEClass.getEStructuralFeatures().get(1);
390 }
391
392
393
394
395
396
397 public EAttribute getParameter_Collection() {
398 return (EAttribute)parameterEClass.getEStructuralFeatures().get(2);
399 }
400
401
402
403
404
405
406 public EClass getAssociationMethod() {
407 return associationMethodEClass;
408 }
409
410
411
412
413
414
415 public EReference getAssociationMethod_Main() {
416 return (EReference)associationMethodEClass.getEStructuralFeatures().get(0);
417 }
418
419
420
421
422
423
424 public EReference getAssociationMethod_Part() {
425 return (EReference)associationMethodEClass.getEStructuralFeatures().get(1);
426 }
427
428
429
430
431
432
433 public EAttribute getAssociationMethod_Rolename() {
434 return (EAttribute)associationMethodEClass.getEStructuralFeatures().get(2);
435 }
436
437
438
439
440
441
442 public EEnum getMethodType() {
443 return methodTypeEEnum;
444 }
445
446
447
448
449
450
451 public EEnum getCollectionType() {
452 return collectionTypeEEnum;
453 }
454
455
456
457
458
459
460 public ServiceDslFactory getServiceDslFactory() {
461 return (ServiceDslFactory)getEFactoryInstance();
462 }
463
464
465
466
467
468
469 private boolean isCreated = false;
470
471
472
473
474
475
476
477
478 public void createPackageContents() {
479 if (isCreated) return;
480 isCreated = true;
481
482
483 serviceModelEClass = createEClass(SERVICE_MODEL);
484 createEReference(serviceModelEClass, SERVICE_MODEL__METHODS);
485 createEReference(serviceModelEClass, SERVICE_MODEL__DTO_REFERENCES);
486 createEReference(serviceModelEClass, SERVICE_MODEL__CRUD_SERVICES);
487
488 modelElementEClass = createEClass(MODEL_ELEMENT);
489 createEAttribute(modelElementEClass, MODEL_ELEMENT__NAME);
490 createEAttribute(modelElementEClass, MODEL_ELEMENT__DESCRIPTION);
491
492 dtoReferenceEClass = createEClass(DTO_REFERENCE);
493 createEAttribute(dtoReferenceEClass, DTO_REFERENCE__MODELNAME);
494 createEReference(dtoReferenceEClass, DTO_REFERENCE__MODEL);
495
496 customMethodEClass = createEClass(CUSTOM_METHOD);
497 createEReference(customMethodEClass, CUSTOM_METHOD__OUT_PARAMETER);
498 createEReference(customMethodEClass, CUSTOM_METHOD__IN_PARAMETERS);
499
500 crudServiceEClass = createEClass(CRUD_SERVICE);
501 createEReference(crudServiceEClass, CRUD_SERVICE__DTO);
502 createEReference(crudServiceEClass, CRUD_SERVICE__MODEL);
503
504 specialMethodEClass = createEClass(SPECIAL_METHOD);
505 createEReference(specialMethodEClass, SPECIAL_METHOD__DTO);
506
507 serviceMethodEClass = createEClass(SERVICE_METHOD);
508 createEAttribute(serviceMethodEClass, SERVICE_METHOD__TYPE);
509 createEReference(serviceMethodEClass, SERVICE_METHOD__MODEL);
510
511 parameterEClass = createEClass(PARAMETER);
512 createEReference(parameterEClass, PARAMETER__TYPE);
513 createEReference(parameterEClass, PARAMETER__METHOD);
514 createEAttribute(parameterEClass, PARAMETER__COLLECTION);
515
516 associationMethodEClass = createEClass(ASSOCIATION_METHOD);
517 createEReference(associationMethodEClass, ASSOCIATION_METHOD__MAIN);
518 createEReference(associationMethodEClass, ASSOCIATION_METHOD__PART);
519 createEAttribute(associationMethodEClass, ASSOCIATION_METHOD__ROLENAME);
520
521
522 methodTypeEEnum = createEEnum(METHOD_TYPE);
523 collectionTypeEEnum = createEEnum(COLLECTION_TYPE);
524 }
525
526
527
528
529
530
531 private boolean isInitialized = false;
532
533
534
535
536
537
538
539
540 public void initializePackageContents() {
541 if (isInitialized) return;
542 isInitialized = true;
543
544
545 setName(eNAME);
546 setNsPrefix(eNS_PREFIX);
547 setNsURI(eNS_URI);
548
549
550
551
552
553
554 serviceModelEClass.getESuperTypes().add(this.getModelElement());
555 dtoReferenceEClass.getESuperTypes().add(this.getModelElement());
556 customMethodEClass.getESuperTypes().add(this.getServiceMethod());
557 crudServiceEClass.getESuperTypes().add(this.getModelElement());
558 specialMethodEClass.getESuperTypes().add(this.getServiceMethod());
559 serviceMethodEClass.getESuperTypes().add(this.getModelElement());
560 parameterEClass.getESuperTypes().add(this.getModelElement());
561 associationMethodEClass.getESuperTypes().add(this.getServiceMethod());
562
563
564 initEClass(serviceModelEClass, ServiceModel.class, "ServiceModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
565 initEReference(getServiceModel_Methods(), this.getServiceMethod(), this.getServiceMethod_Model(), "methods", null, 0, -1, ServiceModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
566 initEReference(getServiceModel_DtoReferences(), this.getDtoReference(), this.getDtoReference_Model(), "dtoReferences", null, 0, -1, ServiceModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
567 initEReference(getServiceModel_CrudServices(), this.getCrudService(), this.getCrudService_Model(), "crudServices", null, 0, -1, ServiceModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
568
569 initEClass(modelElementEClass, ModelElement.class, "ModelElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
570 initEAttribute(getModelElement_Name(), ecorePackage.getEString(), "name", null, 0, 1, ModelElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
571 initEAttribute(getModelElement_Description(), ecorePackage.getEString(), "description", null, 0, 1, ModelElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
572
573 initEClass(dtoReferenceEClass, DtoReference.class, "DtoReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
574 initEAttribute(getDtoReference_Modelname(), ecorePackage.getEString(), "modelname", null, 0, 1, DtoReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
575 initEReference(getDtoReference_Model(), this.getServiceModel(), this.getServiceModel_DtoReferences(), "model", null, 0, 1, DtoReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
576
577 initEClass(customMethodEClass, CustomMethod.class, "CustomMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
578 initEReference(getCustomMethod_OutParameter(), this.getParameter(), null, "outParameter", null, 0, 1, CustomMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
579 initEReference(getCustomMethod_InParameters(), this.getParameter(), this.getParameter_Method(), "inParameters", null, 0, -1, CustomMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
580
581 initEClass(crudServiceEClass, CrudService.class, "CrudService", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
582 initEReference(getCrudService_Dto(), this.getDtoReference(), null, "dto", null, 0, 1, CrudService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
583 initEReference(getCrudService_Model(), this.getServiceModel(), this.getServiceModel_CrudServices(), "model", null, 0, 1, CrudService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
584
585 initEClass(specialMethodEClass, SpecialMethod.class, "SpecialMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
586 initEReference(getSpecialMethod_Dto(), this.getDtoReference(), null, "dto", null, 0, 1, SpecialMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
587
588 initEClass(serviceMethodEClass, ServiceMethod.class, "ServiceMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
589 initEAttribute(getServiceMethod_Type(), this.getMethodType(), "type", "Custom", 0, 1, ServiceMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
590 initEReference(getServiceMethod_Model(), this.getServiceModel(), this.getServiceModel_Methods(), "model", null, 0, 1, ServiceMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
591
592 initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
593 initEReference(getParameter_Type(), this.getDtoReference(), null, "type", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
594 initEReference(getParameter_Method(), this.getCustomMethod(), this.getCustomMethod_InParameters(), "method", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
595 initEAttribute(getParameter_Collection(), this.getCollectionType(), "collection", "SINGLE", 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
596
597 initEClass(associationMethodEClass, AssociationMethod.class, "AssociationMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
598 initEReference(getAssociationMethod_Main(), this.getDtoReference(), null, "main", null, 0, 1, AssociationMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
599 initEReference(getAssociationMethod_Part(), this.getDtoReference(), null, "part", null, 0, 1, AssociationMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
600 initEAttribute(getAssociationMethod_Rolename(), ecorePackage.getEString(), "rolename", null, 0, 1, AssociationMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
601
602
603 initEEnum(methodTypeEEnum, MethodType.class, "MethodType");
604 addEEnumLiteral(methodTypeEEnum, MethodType.CREATE);
605 addEEnumLiteral(methodTypeEEnum, MethodType.READ);
606 addEEnumLiteral(methodTypeEEnum, MethodType.UPDATE);
607 addEEnumLiteral(methodTypeEEnum, MethodType.DELETE);
608 addEEnumLiteral(methodTypeEEnum, MethodType.FIND);
609 addEEnumLiteral(methodTypeEEnum, MethodType.CUSTOM);
610 addEEnumLiteral(methodTypeEEnum, MethodType.ADDTO);
611 addEEnumLiteral(methodTypeEEnum, MethodType.REMOVEFROM);
612 addEEnumLiteral(methodTypeEEnum, MethodType.GETFROM);
613 addEEnumLiteral(methodTypeEEnum, MethodType.LISTALL);
614
615 initEEnum(collectionTypeEEnum, CollectionType.class, "CollectionType");
616 addEEnumLiteral(collectionTypeEEnum, CollectionType.SINGLE);
617 addEEnumLiteral(collectionTypeEEnum, CollectionType.LIST);
618
619
620 createResource(eNS_URI);
621 }
622
623 }