-
Notifications
You must be signed in to change notification settings - Fork 85
/
Factory.java
1644 lines (1612 loc) · 85.3 KB
/
Factory.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//Generated with EGF 1.6.4.202309111303
package org.polarsys.capella.core.model;
import org.eclipse.egf.emf.pattern.base.*;
import org.eclipse.emf.codegen.ecore.genmodel.util.GenModelUtil;
import org.eclipse.emf.codegen.ecore.genmodel.*;
import org.eclipse.emf.codegen.ecore.genmodel.impl.*;
import org.eclipse.emf.codegen.ecore.genmodel.generator.*;
import org.eclipse.emf.codegen.util.*;
import org.eclipse.emf.ecore.util.*;
import org.eclipse.emf.common.util.*;
import org.eclipse.egf.common.helper.*;
import java.util.*;
import org.eclipse.emf.ecore.*;
import org.eclipse.egf.model.pattern.*;
import org.eclipse.egf.pattern.execution.*;
import org.eclipse.egf.pattern.query.*;
public class Factory extends org.eclipse.egf.emf.pattern.model.FactoryInterface {
protected static String nl;
public static synchronized Factory create(String lineSeparator) {
nl = lineSeparator;
Factory result = new Factory();
nl = null;
return result;
}
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
protected final String TEXT_1 = "";
protected final String TEXT_2 = NL + "package ";
protected final String TEXT_3 = ";";
protected final String TEXT_4 = NL;
protected final String TEXT_5 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL
+ " * The <b>Factory</b> for the model." + NL
+ " * It provides a create method for each non-abstract class of the model." + NL + " * <!-- end-user-doc -->";
protected final String TEXT_6 = NL + " * @see ";
protected final String TEXT_7 = NL + " * ";
protected final String TEXT_8 = NL + " * @generated" + NL + " */";
protected final String TEXT_9 = NL + "/**" + NL + " * <!-- begin-user-doc -->" + NL
+ " * An implementation of the model <b>Factory</b>." + NL + " * <!-- end-user-doc -->";
protected final String TEXT_10 = NL + "@Deprecated";
protected final String TEXT_11 = NL + "@SuppressWarnings(\"deprecation\")";
protected final String TEXT_12 = NL + "public class ";
protected final String TEXT_13 = " extends ";
protected final String TEXT_14 = " implements ";
protected final String TEXT_15 = NL + "public interface ";
protected final String TEXT_16 = NL + "{";
protected final String TEXT_17 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL
+ "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
protected final String TEXT_18 = " copyright = ";
protected final String TEXT_19 = NL + "\t/**" + NL + "\t * The singleton instance of the factory." + NL
+ "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL
+ "\t";
protected final String TEXT_20 = " eINSTANCE = init();" + NL;
protected final String TEXT_21 = " INSTANCE = ";
protected final String TEXT_22 = ".eINSTANCE;" + NL;
protected final String TEXT_23 = " eINSTANCE = ";
protected final String TEXT_24 = ".init();" + NL;
protected final String TEXT_25 = NL + "\t/**" + NL + "\t * Creates the default factory implementation." + NL
+ "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
protected final String TEXT_26 = NL + "\tpublic static ";
protected final String TEXT_27 = " init()" + NL + "\t{" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\t";
protected final String TEXT_28 = " the";
protected final String TEXT_29 = " = (";
protected final String TEXT_30 = ")";
protected final String TEXT_31 = ".Registry.INSTANCE.getEFactory(";
protected final String TEXT_32 = ".eNS_URI);" + NL + "\t\t\tif (the";
protected final String TEXT_33 = " != null)" + NL + "\t\t\t{" + NL + "\t\t\t\treturn the";
protected final String TEXT_34 = ";" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (Exception exception)" + NL
+ "\t\t{" + NL + "\t\t\t";
protected final String TEXT_35 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t\treturn new ";
protected final String TEXT_36 = "();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL
+ "\t * Creates an instance of the factory." + NL + "\t * <!-- begin-user-doc -->" + NL
+ "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
protected final String TEXT_37 = "()" + NL + "\t{" + NL + "\t\tsuper();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL
+ "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
protected final String TEXT_38 = NL + "\t@Override";
protected final String TEXT_39 = NL + "\tpublic EObject create(EClass eClass)" + NL + "\t{" + NL
+ "\t\tswitch (eClass.getClassifierID())" + NL + "\t\t{";
protected final String TEXT_40 = NL + "\t\t\tcase ";
protected final String TEXT_41 = ".";
protected final String TEXT_42 = ": return ";
protected final String TEXT_43 = "create";
protected final String TEXT_44 = "();";
protected final String TEXT_45 = NL + "\t\t\tdefault:" + NL
+ "\t\t\t\tthrow new IllegalArgumentException(\"The class '\" + eClass.getName() + \"' is not a valid classifier\");";
protected final String TEXT_46 = NL + "\t\t}" + NL + "\t}" + NL;
protected final String TEXT_47 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL
+ "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
protected final String TEXT_48 = NL + "\tpublic Object createFromString(";
protected final String TEXT_49 = " eDataType, String initialValue)" + NL + "\t{" + NL
+ "\t\tswitch (eDataType.getClassifierID())" + NL + "\t\t{";
protected final String TEXT_50 = ":" + NL + "\t\t\t\treturn create";
protected final String TEXT_51 = "FromString(eDataType, initialValue);";
protected final String TEXT_52 = NL + "\t\t\tdefault:" + NL
+ "\t\t\t\tthrow new IllegalArgumentException(\"The datatype '\" + eDataType.getName() + \"' is not a valid classifier\");";
protected final String TEXT_53 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL
+ "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */";
protected final String TEXT_54 = NL + "\tpublic String convertToString(";
protected final String TEXT_55 = " eDataType, Object instanceValue)" + NL + "\t{" + NL
+ "\t\tswitch (eDataType.getClassifierID())" + NL + "\t\t{";
protected final String TEXT_56 = ":" + NL + "\t\t\t\treturn convert";
protected final String TEXT_57 = "ToString(eDataType, instanceValue);";
protected final String TEXT_58 = NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL
+ "\t * <!-- end-user-doc -->";
protected final String TEXT_59 = NL + "\t * ";
protected final String TEXT_60 = NL + "\t * @generated" + NL + "\t */";
protected final String TEXT_61 = NL + "\t@Deprecated";
protected final String TEXT_62 = NL + "\tpublic ";
protected final String TEXT_63 = " create";
protected final String TEXT_64 = "()" + NL + "\t{";
protected final String TEXT_65 = NL + "\t\t";
protected final String TEXT_66 = " ";
protected final String TEXT_67 = " = ";
protected final String TEXT_68 = "super.create(";
protected final String TEXT_69 = ");";
protected final String TEXT_70 = " = new ";
protected final String TEXT_71 = "()";
protected final String TEXT_72 = "{}";
protected final String TEXT_73 = NL + "\t\treturn ";
protected final String TEXT_74 = ";" + NL + "\t}" + NL;
protected final String TEXT_75 = NL + "\t@SuppressWarnings(\"unchecked\")";
protected final String TEXT_76 = "(";
protected final String TEXT_77 = "final ";
protected final String TEXT_78 = "String ";
protected final String TEXT_79 = "it";
protected final String TEXT_80 = "literal";
protected final String TEXT_81 = ")" + NL + "\t{";
protected final String TEXT_82 = " result = ";
protected final String TEXT_83 = ".get(literal);" + NL
+ "\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + literal + \"' is not a valid enumerator of '\" + ";
protected final String TEXT_84 = ".getName() + \"'\");";
protected final String TEXT_85 = NL + "\t\treturn result;";
protected final String TEXT_86 = NL + "\t\treturn new ";
protected final String TEXT_87 = "(create";
protected final String TEXT_88 = "(literal));";
protected final String TEXT_89 = NL + "\t\treturn create";
protected final String TEXT_90 = "(literal);";
protected final String TEXT_91 = ".create";
protected final String TEXT_92 = ".createFromString(";
protected final String TEXT_93 = ", literal);";
protected final String TEXT_94 = NL + "\t\tif (literal == null) return null;" + NL + "\t\t";
protected final String TEXT_95 = " result = new ";
protected final String TEXT_96 = "<";
protected final String TEXT_97 = ">";
protected final String TEXT_98 = NL + "\t\tfor (";
protected final String TEXT_99 = " stringTokenizer = new ";
protected final String TEXT_100 = "(literal); stringTokenizer.hasMoreTokens(); )";
protected final String TEXT_101 = NL + "\t\tfor (String item : split(literal))";
protected final String TEXT_102 = NL + "\t\t{";
protected final String TEXT_103 = NL + "\t\t\tString item = stringTokenizer.nextToken();";
protected final String TEXT_104 = NL + "\t\t\tresult.add(create";
protected final String TEXT_105 = "(item));";
protected final String TEXT_106 = "FromString(";
protected final String TEXT_107 = ", item));";
protected final String TEXT_108 = NL + "\t\t\tresult.add(";
protected final String TEXT_109 = NL + "\t\t}" + NL + "\t\treturn result;";
protected final String TEXT_110 = NL + "\t\tif (literal == null) return ";
protected final String TEXT_111 = ";" + NL + "\t\t";
protected final String TEXT_112 = ";" + NL + "\t\tRuntimeException exception = null;";
protected final String TEXT_113 = NL + "\t\ttry" + NL + "\t\t{";
protected final String TEXT_114 = NL + "\t\t\tresult = create";
protected final String TEXT_115 = NL + "\t\t\tresult = (";
protected final String TEXT_116 = ")create";
protected final String TEXT_117 = NL + "\t\t\tresult = ";
protected final String TEXT_118 = NL + "\t\t\tif (";
protected final String TEXT_119 = "result != null && ";
protected final String TEXT_120 = ".INSTANCE.validate(";
protected final String TEXT_121 = ", ";
protected final String TEXT_122 = "new ";
protected final String TEXT_123 = "(result)";
protected final String TEXT_124 = "result";
protected final String TEXT_125 = ", null, null))" + NL + "\t\t\t{" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}"
+ NL + "\t\t}" + NL + "\t\tcatch (RuntimeException e)" + NL + "\t\t{" + NL + "\t\t\texception = e;" + NL
+ "\t\t}";
protected final String TEXT_126 = NL + "\t\tif (";
protected final String TEXT_127 = "result != null || ";
protected final String TEXT_128 = "exception == null) return result;" + NL + " " + NL + "\t\tthrow exception;";
protected final String TEXT_129 = NL + "\t\treturn (";
protected final String TEXT_130 = ")super.createFromString(literal);";
protected final String TEXT_131 = NL + "\t\t// TODO: implement this method" + NL
+ "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\tthrow new ";
protected final String TEXT_132 = NL + "\t\treturn ((";
protected final String TEXT_133 = ")super.createFromString(";
protected final String TEXT_134 = ", literal)).";
protected final String TEXT_135 = "super.createFromString(";
protected final String TEXT_136 = NL + "\t}" + NL;
protected final String TEXT_137 = " eDataType, String initialValue)" + NL + "\t{";
protected final String TEXT_138 = "(initialValue);";
protected final String TEXT_139 = ".get(initialValue);" + NL
+ "\t\tif (result == null) throw new IllegalArgumentException(\"The value '\" + initialValue + \"' is not a valid enumerator of '\" + eDataType.getName() + \"'\");";
protected final String TEXT_140 = ", initialValue);";
protected final String TEXT_141 = NL + "\t\tif (initialValue == null) return null;" + NL + "\t\t";
protected final String TEXT_142 = "(initialValue); stringTokenizer.hasMoreTokens(); )";
protected final String TEXT_143 = NL + "\t\tfor (String item : split(initialValue))";
protected final String TEXT_144 = "(initialValue));";
protected final String TEXT_145 = " result = null;" + NL + "\t\tRuntimeException exception = null;";
protected final String TEXT_146 = NL + "\t\t\tif (result != null && ";
protected final String TEXT_147 = ".INSTANCE.validate(eDataType, result, null, null))" + NL + "\t\t\t{" + NL
+ "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (RuntimeException e)" + NL + "\t\t{"
+ NL + "\t\t\texception = e;" + NL + "\t\t}";
protected final String TEXT_148 = NL + "\t\tif (result != null || exception == null) return result;" + NL + " "
+ NL + "\t\tthrow exception;";
protected final String TEXT_149 = "super.createFromString(initialValue);";
protected final String TEXT_150 = "super.createFromString(eDataType, initialValue);";
protected final String TEXT_151 = NL + "\tpublic String convert";
protected final String TEXT_152 = "instanceValue";
protected final String TEXT_153 = NL + "\t\treturn instanceValue == null ? null : instanceValue.toString();";
protected final String TEXT_154 = NL + "\t\treturn instanceValue == null ? null : convert";
protected final String TEXT_155 = "(instanceValue";
protected final String TEXT_156 = NL + "\t\treturn convert";
protected final String TEXT_157 = "(instanceValue);";
protected final String TEXT_158 = ".convert";
protected final String TEXT_159 = ".convertToString(";
protected final String TEXT_160 = ", instanceValue);";
protected final String TEXT_161 = NL + "\t\tif (instanceValue == null) return null;" + NL
+ "\t\tif (instanceValue.isEmpty()) return \"\";" + NL + "\t\t";
protected final String TEXT_162 = " i = instanceValue.iterator(); i.hasNext(); )";
protected final String TEXT_163 = " item : instanceValue)";
protected final String TEXT_164 = NL + "\t\t\tresult.append(convert";
protected final String TEXT_165 = "((";
protected final String TEXT_166 = "));";
protected final String TEXT_167 = "ToString(";
protected final String TEXT_168 = NL + "\t\t\tresult.append(";
protected final String TEXT_169 = NL + "\t\t\tresult.append(' ');" + NL + "\t\t}" + NL
+ "\t\treturn result.substring(0, result.length() - 1);";
protected final String TEXT_170 = NL + "\t\tif (instanceValue == null) return null;";
protected final String TEXT_171 = ".isInstance(instanceValue))" + NL + "\t\t{" + NL + "\t\t\ttry" + NL + "\t\t\t{";
protected final String TEXT_172 = NL + "\t\t\t\tString value = convert";
protected final String TEXT_173 = "(((";
protected final String TEXT_174 = ")instanceValue).";
protected final String TEXT_175 = "());";
protected final String TEXT_176 = ")instanceValue);";
protected final String TEXT_177 = NL + "\t\t\t\tString value = ";
protected final String TEXT_178 = NL + "\t\t\t\tif (value != null) return value;" + NL + "\t\t\t}" + NL
+ "\t\t\tcatch (Exception e)" + NL + "\t\t\t{" + NL
+ "\t\t\t\t// Keep trying other member types until all have failed." + NL + "\t\t\t}" + NL + "\t\t}";
protected final String TEXT_179 = NL + "\t\t\tString value = convert";
protected final String TEXT_180 = "(instanceValue)";
protected final String TEXT_181 = NL + "\t\t\tString value = ";
protected final String TEXT_182 = NL + "\t\t\tif (value != null) return value;" + NL + "\t\t}" + NL
+ "\t\tcatch (Exception e)" + NL + "\t\t{" + NL + "\t\t\t// Keep trying other member types until all have failed."
+ NL + "\t\t}";
protected final String TEXT_183 = NL
+ "\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :\"+";
protected final String TEXT_184 = ".getName());";
protected final String TEXT_185 = NL + "\t\treturn super.convertToString(instanceValue);";
protected final String TEXT_186 = NL + "\t\treturn super.convertToString(";
protected final String TEXT_187 = ", new ";
protected final String TEXT_188 = "(instanceValue));";
protected final String TEXT_189 = " eDataType, Object instanceValue)" + NL + "\t{";
protected final String TEXT_190 = NL + "\t\tif (instanceValue == null) return null;" + NL + "\t\t";
protected final String TEXT_191 = " list = (";
protected final String TEXT_192 = ")instanceValue;" + NL + "\t\tif (list.isEmpty()) return \"\";" + NL + "\t\t";
protected final String TEXT_193 = " i = list.iterator(); i.hasNext(); )";
protected final String TEXT_194 = " item : list)";
protected final String TEXT_195 = ")instanceValue)";
protected final String TEXT_196 = NL
+ "\t\tthrow new IllegalArgumentException(\"Invalid value: '\"+instanceValue+\"' for datatype :\"+eDataType.getName());";
protected final String TEXT_197 = ")instanceValue";
protected final String TEXT_198 = ").";
protected final String TEXT_199 = NL + "\t\treturn super.convertToString(eDataType, instanceValue);";
protected final String TEXT_200 = NL + "\t/**" + NL + "\t * Returns a new object of class '<em>";
protected final String TEXT_201 = "</em>'." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->"
+ NL + "\t * @return a new object of class '<em>";
protected final String TEXT_202 = "</em>'.";
protected final String TEXT_203 = NL + "\t";
protected final String TEXT_204 = "();" + NL;
protected final String TEXT_205 = NL + "\t/**" + NL + "\t * Returns an instance of data type '<em>";
protected final String TEXT_206 = "</em>' corresponding the given literal." + NL + "\t * <!-- begin-user-doc -->" + NL
+ "\t * <!-- end-user-doc -->" + NL + "\t * @param literal a literal of the data type." + NL
+ "\t * @return a new instance value of the data type.";
protected final String TEXT_207 = "(String literal);" + NL + "" + NL + "\t/**" + NL
+ "\t * Returns a literal representation of an instance of data type '<em>";
protected final String TEXT_208 = "</em>'." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->"
+ NL + "\t * @param instanceValue an instance value of the data type." + NL
+ "\t * @return a literal representation of the instance value.";
protected final String TEXT_209 = NL + "\tString convert";
protected final String TEXT_210 = " instanceValue);" + NL;
protected final String TEXT_211 = NL + "\t/**" + NL + "\t * Returns the package supported by this factory." + NL
+ "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL
+ "\t * @return the package supported by this factory." + NL + "\t * @generated" + NL + "\t */" + NL + "\t";
protected final String TEXT_212 = " get";
protected final String TEXT_213 = "()" + NL + "\t{" + NL + "\t\treturn (";
protected final String TEXT_214 = ")getEPackage();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL
+ "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @deprecated" + NL
+ "\t * @generated" + NL + "\t */";
protected final String TEXT_215 = " getPackage()" + NL + "\t{" + NL + "\t\treturn ";
protected final String TEXT_216 = ".eINSTANCE;" + NL + "\t}" + NL;
protected final String TEXT_217 = NL + "\t//begin-capella-code" + NL + "\t";
protected final String TEXT_218 = NL + "\t//end-capella-code" + NL + "} //";
public Factory() {
//Here is the constructor
StringBuffer stringBuffer = new StringBuffer();
// add initialisation of the pattern variables (declaration has been already done).
}
public String generate(Object argument) throws Exception {
final StringBuffer stringBuffer = new StringBuffer();
InternalPatternContext ctx = (InternalPatternContext) argument;
Map<String, String> queryCtx = null;
IQuery.ParameterDescription paramDesc = null;
Node.Container currentNode = ctx.getNode();
List<Object> parameterList = null;
//this pattern can only be called by another (i.e. it's not an entry point in execution)
for (Object parameterParameter : parameterList) {
this.parameter = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) parameterParameter;
if (preCondition(ctx)) {
ctx.setNode(new Node.Container(currentNode, getClass()));
orchestration(ctx);
}
}
ctx.setNode(currentNode);
if (ctx.useReporter()) {
ctx.getReporter().executionFinished(OutputManager.computeExecutionOutput(ctx), ctx);
}
stringBuffer.append(TEXT_4);
stringBuffer.append(TEXT_4);
return stringBuffer.toString();
}
public String orchestration(PatternContext ctx) throws Exception {
InternalPatternContext ictx = (InternalPatternContext) ctx;
super.orchestration(new SuperOrchestrationContext(ictx));
if (ictx.useReporter()) {
Map<String, Object> parameterValues = new HashMap<String, Object>();
parameterValues.put("parameter", this.parameter);
String outputWithCallBack = OutputManager.computeLoopOutput(ictx);
String loop = OutputManager.computeLoopOutputWithoutCallback(ictx);
ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx, parameterValues);
}
return null;
}
public Map<String, Object> getParameters() {
final Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("parameter", this.parameter);
return parameters;
}
protected void method_doGenerate(final StringBuffer stringBuffer, final PatternContext ctx) throws Exception {
/**
* Copyright (c) 2002-2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* IBM - Initial API and implementation
*/
GenPackage genPackage = (GenPackage) ((Object[]) argument)[0];
GenModel genModel = genPackage.getGenModel();
/* Trick to import java.util.* without warnings */Iterator.class.getName();
final boolean isJDK50 = genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50;
boolean isInterface = Boolean.TRUE.equals(((Object[]) argument)[1]);
boolean isImplementation = Boolean.TRUE.equals(((Object[]) argument)[2]);
boolean useInterfaceOverrideAnnotation = genModel.useInterfaceOverrideAnnotation()
&& !(isInterface && isImplementation);
String publicStaticFinalFlag = isImplementation ? "public static final " : "";
stringBuffer.append(TEXT_1);
{
//<%@ egf:patternCall patternId="platform:/plugin/org.eclipse.egf.emf.pattern.base/egf/EMF_Pattern_Base.fcore#LogicalName=org.eclipse.egf.emf.pattern.base.HeaderJava" args="parameter:argument"%>
InternalPatternContext ictx = (InternalPatternContext) ctx;
new Node.DataLeaf(ictx.getNode(), getClass(), null, stringBuffer.toString());
stringBuffer.setLength(0);
final Map<String, Object> callParameters = new HashMap<String, Object>();
callParameters.put("argument", parameter);
CallHelper.executeWithParameterInjection(
"platform:/plugin/org.eclipse.egf.emf.pattern.base/egf/EMF_Pattern_Base.fcore#_XHLrsCwtEd-jc5T-XaRJlg",
new ExecutionContext((InternalPatternContext) ctx), callParameters);
stringBuffer.setLength(0);
}
if (isInterface || genModel.isSuppressInterfaces()) {
stringBuffer.append(TEXT_2);
stringBuffer.append(genPackage.getReflectionPackageName());
stringBuffer.append(TEXT_3);
} else {
stringBuffer.append(TEXT_2);
stringBuffer.append(genPackage.getClassPackageName());
stringBuffer.append(TEXT_3);
}
stringBuffer.append(TEXT_4);
if (isImplementation) {
genModel.addPseudoImport("org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container");
genModel.addPseudoImport("org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container.Dynamic");
genModel.addImport("org.eclipse.emf.ecore.EClass");
genModel.addImport("org.eclipse.emf.ecore.EObject");
if (!genPackage.hasJavaLangConflict() && !genPackage.hasInterfaceImplConflict()
&& !genPackage.getClassPackageName().equals(genPackage.getInterfacePackageName()))
genModel.addImport(genPackage.getInterfacePackageName() + ".*");
}
genModel.markImportLocation(stringBuffer);
stringBuffer.append(TEXT_4);
if (isInterface) {
stringBuffer.append(TEXT_5);
if (!genModel.isSuppressEMFMetaData()) {
stringBuffer.append(TEXT_6);
stringBuffer.append(genPackage.getQualifiedPackageInterfaceName());
}
if (genPackage.hasAPITags()) {
stringBuffer.append(TEXT_7);
stringBuffer.append(genPackage.getAPITags(genModel.getIndentation(stringBuffer)));
}
stringBuffer.append(TEXT_8);
} else {
stringBuffer.append(TEXT_9);
if (genPackage.hasAPITags()) {
stringBuffer.append(TEXT_7);
stringBuffer.append(genPackage.getAPITags(genModel.getIndentation(stringBuffer)));
}
stringBuffer.append(TEXT_8);
}
if (isJDK50 && genPackage.hasAPIDeprecatedTag()) {
stringBuffer.append(TEXT_10);
}
if (isImplementation) {
if (isJDK50 && !genPackage.hasAPIDeprecatedTag()) {
List<GenClassifier> genClassifiers = new ArrayList<GenClassifier>(genPackage.getGenClassifiers());
for (Iterator<GenClassifier> i = genClassifiers.iterator(); i.hasNext();) {
GenClassifier genClassifier = i.next();
if (genClassifier instanceof GenClass && ((GenClass) genClassifier).isAbstract())
i.remove();
}
if (GenModelUtil.hasAPIDeprecatedTag(genClassifiers)) {
stringBuffer.append(TEXT_11);
}
}
stringBuffer.append(TEXT_12);
stringBuffer.append(genPackage.getFactoryClassName());
stringBuffer.append(TEXT_13);
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.impl.EFactoryImpl"));
if (!genModel.isSuppressInterfaces()) {
stringBuffer.append(TEXT_14);
stringBuffer.append(genPackage.getImportedFactoryInterfaceName());
}
} else {
stringBuffer.append(TEXT_15);
stringBuffer.append(genPackage.getFactoryInterfaceName());
if (!genModel.isSuppressEMFMetaData()) {
stringBuffer.append(TEXT_13);
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EFactory"));
}
}
stringBuffer.append(TEXT_16);
if (genModel.hasCopyrightField()) {
stringBuffer.append(TEXT_17);
stringBuffer.append(publicStaticFinalFlag);
stringBuffer.append(genModel.getImportedName("java.lang.String"));
stringBuffer.append(TEXT_18);
stringBuffer.append(genModel.getCopyrightFieldLiteral());
stringBuffer.append(TEXT_3);
stringBuffer.append(genModel.getNonNLS());
stringBuffer.append(TEXT_4);
}
if (isImplementation && (genModel.isSuppressEMFMetaData() || genModel.isSuppressInterfaces())) {
stringBuffer.append(TEXT_19);
stringBuffer.append(publicStaticFinalFlag);
stringBuffer.append(genPackage.getFactoryClassName());
stringBuffer.append(TEXT_20);
}
if (isInterface && genModel.isSuppressEMFMetaData()) {
stringBuffer.append(TEXT_19);
stringBuffer.append(publicStaticFinalFlag);
stringBuffer.append(genPackage.getFactoryInterfaceName());
stringBuffer.append(TEXT_21);
stringBuffer.append(genPackage.getQualifiedFactoryClassName());
stringBuffer.append(TEXT_22);
} else if (isInterface && !genModel.isSuppressInterfaces()) {
stringBuffer.append(TEXT_19);
stringBuffer.append(publicStaticFinalFlag);
stringBuffer.append(genPackage.getFactoryInterfaceName());
stringBuffer.append(TEXT_23);
stringBuffer.append(genPackage.getQualifiedFactoryClassName());
stringBuffer.append(TEXT_24);
}
if (isImplementation) {
stringBuffer.append(TEXT_25);
String factoryType = genModel.isSuppressEMFMetaData() ? genPackage.getFactoryClassName()
: genPackage.getImportedFactoryInterfaceName();
stringBuffer.append(TEXT_26);
stringBuffer.append(factoryType);
stringBuffer.append(TEXT_27);
stringBuffer.append(factoryType);
stringBuffer.append(TEXT_28);
stringBuffer.append(genPackage.getFactoryName());
stringBuffer.append(TEXT_29);
stringBuffer.append(factoryType);
stringBuffer.append(TEXT_30);
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EPackage"));
stringBuffer.append(TEXT_31);
stringBuffer.append(genPackage.getPackageInterfaceName());
stringBuffer.append(TEXT_32);
stringBuffer.append(genPackage.getFactoryName());
stringBuffer.append(TEXT_33);
stringBuffer.append(genPackage.getFactoryName());
stringBuffer.append(TEXT_34);
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.plugin.EcorePlugin"));
stringBuffer.append(TEXT_35);
stringBuffer.append(genPackage.getImportedFactoryClassName());
stringBuffer.append(TEXT_36);
stringBuffer.append(genPackage.getFactoryClassName());
stringBuffer.append(TEXT_37);
if (genModel.useClassOverrideAnnotation()) {
stringBuffer.append(TEXT_38);
}
stringBuffer.append(TEXT_39);
for (GenClass genClass : genPackage.getGenClasses()) {
if (!genClass.isAbstract()) {
stringBuffer.append(TEXT_40);
stringBuffer.append(genPackage.getImportedPackageInterfaceName());
stringBuffer.append(TEXT_41);
stringBuffer.append(genClass.getClassifierID());
stringBuffer.append(TEXT_42);
stringBuffer.append(!genClass.isEObjectExtension() ? "(EObject)" : "");
stringBuffer.append(TEXT_43);
stringBuffer.append(genClass.getName());
stringBuffer.append(TEXT_44);
}
}
stringBuffer.append(TEXT_45);
stringBuffer.append(genModel.getNonNLS());
stringBuffer.append(genModel.getNonNLS(2));
stringBuffer.append(TEXT_46);
if (!genPackage.getAllGenDataTypes().isEmpty()) {
stringBuffer.append(TEXT_47);
if (genModel.useClassOverrideAnnotation()) {
stringBuffer.append(TEXT_38);
}
stringBuffer.append(TEXT_48);
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EDataType"));
stringBuffer.append(TEXT_49);
for (GenDataType genDataType : genPackage.getAllGenDataTypes()) {
if (genDataType.isSerializable()) {
stringBuffer.append(TEXT_40);
stringBuffer.append(genPackage.getImportedPackageInterfaceName());
stringBuffer.append(TEXT_41);
stringBuffer.append(genDataType.getClassifierID());
stringBuffer.append(TEXT_50);
stringBuffer.append(genDataType.getName());
stringBuffer.append(TEXT_51);
}
}
stringBuffer.append(TEXT_52);
stringBuffer.append(genModel.getNonNLS());
stringBuffer.append(genModel.getNonNLS(2));
stringBuffer.append(TEXT_53);
if (genModel.useClassOverrideAnnotation()) {
stringBuffer.append(TEXT_38);
}
stringBuffer.append(TEXT_54);
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EDataType"));
stringBuffer.append(TEXT_55);
for (GenDataType genDataType : genPackage.getAllGenDataTypes()) {
if (genDataType.isSerializable()) {
stringBuffer.append(TEXT_40);
stringBuffer.append(genPackage.getImportedPackageInterfaceName());
stringBuffer.append(TEXT_41);
stringBuffer.append(genDataType.getClassifierID());
stringBuffer.append(TEXT_56);
stringBuffer.append(genDataType.getName());
stringBuffer.append(TEXT_57);
}
}
stringBuffer.append(TEXT_52);
stringBuffer.append(genModel.getNonNLS());
stringBuffer.append(genModel.getNonNLS(2));
stringBuffer.append(TEXT_46);
}
for (GenClass genClass : genPackage.getGenClasses()) {
if (!genClass.isAbstract()) {
stringBuffer.append(TEXT_58);
if (genClass.hasAPITags()) {
stringBuffer.append(TEXT_59);
stringBuffer.append(genClass.getAPITags(genModel.getIndentation(stringBuffer)));
}
stringBuffer.append(TEXT_60);
if (isJDK50 && genClass.hasAPIDeprecatedTag()) {
stringBuffer.append(TEXT_61);
}
if (useInterfaceOverrideAnnotation && !genClass.isMapEntry()) {
stringBuffer.append(TEXT_38);
}
stringBuffer.append(TEXT_62);
stringBuffer.append(genClass.getTypeParameters());
stringBuffer.append(genClass.getImportedInterfaceName());
stringBuffer.append(genClass.getInterfaceTypeArguments());
stringBuffer.append(TEXT_63);
stringBuffer.append(genClass.getName());
stringBuffer.append(TEXT_64);
if (genClass.isDynamic()) {
stringBuffer.append(TEXT_65);
stringBuffer.append(genClass.getImportedInterfaceName());
stringBuffer.append(genClass.getInterfaceTypeArguments());
stringBuffer.append(TEXT_66);
stringBuffer.append(genClass.getSafeUncapName());
stringBuffer.append(TEXT_67);
stringBuffer.append(genClass.getCastFromEObject());
stringBuffer.append(TEXT_68);
stringBuffer.append(genClass.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_69);
} else {
stringBuffer.append(TEXT_65);
stringBuffer.append(genClass.getImportedClassName());
stringBuffer.append(genClass.getClassTypeArguments());
stringBuffer.append(TEXT_66);
stringBuffer.append(genClass.getSafeUncapName());
stringBuffer.append(TEXT_70);
stringBuffer.append(genClass.getImportedClassName());
stringBuffer.append(genClass.getClassTypeArguments());
stringBuffer.append(TEXT_71);
if (genModel.isSuppressInterfaces()
&& !genPackage.getReflectionPackageName().equals(genPackage.getInterfacePackageName())) {
stringBuffer.append(TEXT_72);
}
stringBuffer.append(TEXT_3);
}
stringBuffer.append(TEXT_73);
stringBuffer.append(genClass.getSafeUncapName());
stringBuffer.append(TEXT_74);
}
}
for (GenDataType genDataType : genPackage.getAllGenDataTypes()) {
if (genDataType.isSerializable()) {
if (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) {
String eDataType = genDataType.getQualifiedClassifierAccessor();
stringBuffer.append(TEXT_58);
if (genDataType.hasAPITags()) {
stringBuffer.append(TEXT_59);
stringBuffer.append(genDataType.getAPITags(genModel.getIndentation(stringBuffer)));
}
stringBuffer.append(TEXT_60);
if (genModel.useGenerics() && genDataType.isUncheckedCast() && !genDataType.hasCreatorBody()) {
stringBuffer.append(TEXT_75);
}
if (isJDK50 && genDataType.hasAPIDeprecatedTag()) {
stringBuffer.append(TEXT_61);
}
if (genPackage.isDataTypeConverters() && useInterfaceOverrideAnnotation) {
stringBuffer.append(TEXT_38);
}
stringBuffer.append(TEXT_62);
stringBuffer.append(genDataType.getImportedParameterizedInstanceClassName());
stringBuffer.append(TEXT_63);
stringBuffer.append(genDataType.getName());
stringBuffer.append(TEXT_76);
if (genDataType.hasCreatorBody()) {
stringBuffer.append(TEXT_77);
}
stringBuffer.append(TEXT_78);
if (genDataType.hasCreatorBody()) {
stringBuffer.append(TEXT_79);
} else {
stringBuffer.append(TEXT_80);
}
stringBuffer.append(TEXT_81);
if (genDataType.hasCreatorBody()) {
stringBuffer.append(TEXT_65);
stringBuffer.append(genDataType.getCreatorBody(genModel.getIndentation(stringBuffer)));
} else if (genDataType instanceof GenEnum) {
stringBuffer.append(TEXT_65);
stringBuffer.append(genDataType.getImportedInstanceClassName());
stringBuffer.append(TEXT_82);
stringBuffer.append(genDataType.getImportedInstanceClassName());
stringBuffer.append(TEXT_83);
stringBuffer.append(eDataType);
stringBuffer.append(TEXT_84);
stringBuffer.append(genModel.getNonNLS());
stringBuffer.append(genModel.getNonNLS(2));
stringBuffer.append(genModel.getNonNLS(3));
stringBuffer.append(TEXT_85);
} else if (genDataType.getBaseType() != null) {
GenDataType genBaseType = genDataType.getBaseType();
boolean isPrimitiveConversion = !genDataType.isPrimitiveType() && genBaseType.isPrimitiveType();
if (genBaseType.getGenPackage() == genPackage) {
if (isPrimitiveConversion && !isJDK50) {
stringBuffer.append(TEXT_86);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_87);
stringBuffer.append(genBaseType.getName());
stringBuffer.append(TEXT_88);
} else {
stringBuffer.append(TEXT_89);
stringBuffer.append(genBaseType.getName());
stringBuffer.append(TEXT_90);
}
} else if (genBaseType.getGenPackage().isDataTypeConverters()) {
if (isPrimitiveConversion && !isJDK50) {
stringBuffer.append(TEXT_86);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_76);
stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_91);
stringBuffer.append(genBaseType.getName());
stringBuffer.append(TEXT_88);
} else {
stringBuffer.append(TEXT_73);
stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_91);
stringBuffer.append(genBaseType.getName());
stringBuffer.append(TEXT_90);
}
} else {
stringBuffer.append(TEXT_73);
if (!genDataType.isObjectType()) {
stringBuffer.append(TEXT_76);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_30);
}
stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_92);
stringBuffer.append(genBaseType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_93);
}
} else if (genDataType.getItemType() != null) {
GenDataType genItemType = genDataType.getItemType();
stringBuffer.append(TEXT_94);
stringBuffer.append(genDataType.getImportedParameterizedInstanceClassName());
stringBuffer.append(TEXT_95);
stringBuffer.append(genModel.getImportedName("java.util.ArrayList"));
if (genModel.useGenerics()) {
stringBuffer.append(TEXT_96);
stringBuffer.append(genItemType.getObjectType().getImportedParameterizedInstanceClassName());
stringBuffer.append(TEXT_97);
}
stringBuffer.append(TEXT_44);
if (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {
stringBuffer.append(TEXT_98);
stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
stringBuffer.append(TEXT_99);
stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
stringBuffer.append(TEXT_100);
} else {
stringBuffer.append(TEXT_101);
}
stringBuffer.append(TEXT_102);
if (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {
stringBuffer.append(TEXT_103);
}
if (genItemType.getGenPackage() == genPackage) {
if (genPackage.isDataTypeConverters()) {
genItemType = genItemType.getObjectType();
stringBuffer.append(TEXT_104);
stringBuffer.append(genItemType.getName());
stringBuffer.append(TEXT_105);
} else {
stringBuffer.append(TEXT_104);
stringBuffer.append(genItemType.getName());
stringBuffer.append(TEXT_106);
stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_107);
}
} else {
if (genItemType.getGenPackage().isDataTypeConverters()) {
genItemType = genItemType.getObjectType();
stringBuffer.append(TEXT_108);
stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_91);
stringBuffer.append(genItemType.getName());
stringBuffer.append(TEXT_105);
} else {
stringBuffer.append(TEXT_108);
stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_92);
stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_107);
}
}
stringBuffer.append(TEXT_109);
} else if (!genDataType.getMemberTypes().isEmpty()) {
stringBuffer.append(TEXT_110);
stringBuffer.append(genDataType.getStaticValue(null));
stringBuffer.append(TEXT_111);
stringBuffer.append(genDataType.getImportedInstanceClassName());
stringBuffer.append(TEXT_82);
stringBuffer.append(genDataType.getStaticValue(null));
stringBuffer.append(TEXT_112);
for (GenDataType genMemberType : genDataType.getMemberTypes()) {
stringBuffer.append(TEXT_113);
if (genMemberType.getGenPackage() == genPackage) {
if (genPackage.isDataTypeConverters()) {
if (!genDataType.isPrimitiveType())
genMemberType = genMemberType.getObjectType();
stringBuffer.append(TEXT_114);
stringBuffer.append(genMemberType.getName());
stringBuffer.append(TEXT_90);
} else {
stringBuffer.append(TEXT_115);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_116);
stringBuffer.append(genMemberType.getName());
stringBuffer.append(TEXT_106);
stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_93);
}
} else {
if (genPackage.isDataTypeConverters()) {
if (!genDataType.isPrimitiveType())
genMemberType = genMemberType.getObjectType();
stringBuffer.append(TEXT_117);
stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_91);
stringBuffer.append(genMemberType.getName());
stringBuffer.append(TEXT_90);
} else {
stringBuffer.append(TEXT_115);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_30);
stringBuffer.append(genMemberType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_92);
stringBuffer.append(genMemberType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_93);
}
}
stringBuffer.append(TEXT_118);
if (!genDataType.isPrimitiveType()) {
stringBuffer.append(TEXT_119);
}
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.util.Diagnostician"));
stringBuffer.append(TEXT_120);
stringBuffer.append(eDataType);
stringBuffer.append(TEXT_121);
if (genDataType.isPrimitiveType() && !isJDK50) {
stringBuffer.append(TEXT_122);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_123);
} else {
stringBuffer.append(TEXT_124);
}
stringBuffer.append(TEXT_125);
}
stringBuffer.append(TEXT_126);
if (!genDataType.isPrimitiveType()) {
stringBuffer.append(TEXT_127);
}
stringBuffer.append(TEXT_128);
} else if (!genDataType.hasConversionDelegate() && genModel.useGenerics()
&& (genDataType.isArrayType() || !genDataType.getEcoreDataType().getETypeParameters().isEmpty()
|| genDataType.getEcoreDataType().getInstanceTypeName().contains("<"))) {
stringBuffer.append(TEXT_129);
stringBuffer.append(genDataType.getImportedParameterizedObjectInstanceClassName());
stringBuffer.append(TEXT_130);
} else if (!genDataType.hasConversionDelegate() && genDataType.isArrayType()) {
stringBuffer.append(TEXT_131);
stringBuffer.append(genModel.getImportedName("java.lang.UnsupportedOperationException"));
stringBuffer.append(TEXT_44);
} else if (genDataType.isPrimitiveType() && !isJDK50) {
stringBuffer.append(TEXT_132);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_133);
stringBuffer.append(eDataType);
stringBuffer.append(TEXT_134);
stringBuffer.append(genDataType.getPrimitiveValueFunction());
stringBuffer.append(TEXT_44);
} else {
stringBuffer.append(TEXT_73);
if (!genDataType.isObjectType()) {
stringBuffer.append(TEXT_76);
stringBuffer.append(genDataType.getImportedParameterizedObjectInstanceClassName());
stringBuffer.append(TEXT_30);
}
stringBuffer.append(TEXT_135);
stringBuffer.append(eDataType);
stringBuffer.append(TEXT_93);
}
stringBuffer.append(TEXT_136);
}
stringBuffer.append(TEXT_58);
if (genDataType.hasAPITags()) {
stringBuffer.append(TEXT_59);
stringBuffer.append(genDataType.getAPITags(genModel.getIndentation(stringBuffer)));
}
stringBuffer.append(TEXT_60);
if (!genPackage.isDataTypeConverters() && genModel.useGenerics() && genDataType.isUncheckedCast()
&& !genDataType.hasCreatorBody()) {
stringBuffer.append(TEXT_75);
}
if (isJDK50 && genDataType.hasAPIDeprecatedTag()) {
stringBuffer.append(TEXT_61);
}
stringBuffer.append(TEXT_62);
stringBuffer.append(genDataType.getImportedParameterizedObjectInstanceClassName());
stringBuffer.append(TEXT_63);
stringBuffer.append(genDataType.getName());
stringBuffer.append(TEXT_106);
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.ecore.EDataType"));
stringBuffer.append(TEXT_137);
if (genDataType instanceof GenEnum) {
if (genPackage.isDataTypeConverters() || genDataType.hasCreatorBody()) {
stringBuffer.append(TEXT_89);
stringBuffer.append(genDataType.getName());
stringBuffer.append(TEXT_138);
} else {
stringBuffer.append(TEXT_65);
stringBuffer.append(((GenEnum) genDataType).getImportedInstanceClassName());
stringBuffer.append(TEXT_82);
stringBuffer.append(((GenEnum) genDataType).getImportedInstanceClassName());
stringBuffer.append(TEXT_139);
stringBuffer.append(genModel.getNonNLS());
stringBuffer.append(genModel.getNonNLS(2));
stringBuffer.append(genModel.getNonNLS(3));
stringBuffer.append(TEXT_85);
}
} else if (genDataType.getBaseType() != null) {
GenDataType genBaseType = genDataType.getBaseType();
if (genBaseType.getGenPackage() == genPackage) {
stringBuffer.append(TEXT_73);
if (!genDataType.getObjectInstanceClassName().equals(genBaseType.getObjectInstanceClassName())) {
stringBuffer.append(TEXT_76);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_30);
}
stringBuffer.append(TEXT_43);
stringBuffer.append(genBaseType.getName());
stringBuffer.append(TEXT_106);
stringBuffer.append(genBaseType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_140);
} else {
stringBuffer.append(TEXT_73);
if (!genDataType.isObjectType()) {
stringBuffer.append(TEXT_76);
stringBuffer.append(genDataType.getObjectInstanceClassName());
stringBuffer.append(TEXT_30);
}
stringBuffer.append(genBaseType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_92);
stringBuffer.append(genBaseType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_140);
}
} else if (genDataType.getItemType() != null) {
GenDataType genItemType = genDataType.getItemType();
if (genPackage.isDataTypeConverters()) {
stringBuffer.append(TEXT_89);
stringBuffer.append(genDataType.getName());
stringBuffer.append(TEXT_138);
} else {
stringBuffer.append(TEXT_141);
stringBuffer.append(genDataType.getImportedParameterizedObjectInstanceClassName());
stringBuffer.append(TEXT_95);
stringBuffer.append(genModel.getImportedName("java.util.ArrayList"));
if (genModel.useGenerics()) {
stringBuffer.append(TEXT_96);
stringBuffer.append(genItemType.getObjectType().getImportedParameterizedInstanceClassName());
stringBuffer.append(TEXT_97);
}
stringBuffer.append(TEXT_44);
if (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {
stringBuffer.append(TEXT_98);
stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
stringBuffer.append(TEXT_99);
stringBuffer.append(genModel.getImportedName("java.util.StringTokenizer"));
stringBuffer.append(TEXT_142);
} else {
stringBuffer.append(TEXT_143);
}
stringBuffer.append(TEXT_102);
if (genModel.getRuntimeVersion().getValue() < GenRuntimeVersion.EMF26_VALUE) {
stringBuffer.append(TEXT_103);
}
if (genItemType.getGenPackage() == genPackage) {
stringBuffer.append(TEXT_104);
stringBuffer.append(genItemType.getName());
stringBuffer.append(TEXT_106);
stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_107);
} else {
stringBuffer.append(TEXT_108);
if (!genItemType.isObjectType()) {
stringBuffer.append(TEXT_76);
stringBuffer.append(genItemType.getObjectInstanceClassName());
stringBuffer.append(TEXT_30);
}
stringBuffer.append(genItemType.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor());
stringBuffer.append(TEXT_92);
stringBuffer.append(genItemType.getQualifiedClassifierAccessor());
stringBuffer.append(TEXT_107);
}
stringBuffer.append(TEXT_109);
}
} else if (!genDataType.getMemberTypes().isEmpty()) {
if (genPackage.isDataTypeConverters()) {
if (genDataType.isPrimitiveType() && !isJDK50) {