1
2
3
4
5 package org.andromda.cartridges.spring.metafacades;
6
7 import java.util.Collection;
8 import org.andromda.core.common.Introspector;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.MetafacadeFactory;
11 import org.andromda.core.metafacade.ModelValidationMessage;
12 import org.andromda.metafacades.uml.ClassifierFacade;
13 import org.andromda.metafacades.uml.ConstraintFacade;
14 import org.andromda.metafacades.uml.DependencyFacade;
15 import org.andromda.metafacades.uml.ModelElementFacade;
16 import org.andromda.metafacades.uml.ModelFacade;
17 import org.andromda.metafacades.uml.OperationFacade;
18 import org.andromda.metafacades.uml.PackageFacade;
19 import org.andromda.metafacades.uml.ParameterFacade;
20 import org.andromda.metafacades.uml.StateMachineFacade;
21 import org.andromda.metafacades.uml.StereotypeFacade;
22 import org.andromda.metafacades.uml.TaggedValueFacade;
23 import org.andromda.metafacades.uml.TemplateParameterFacade;
24 import org.andromda.metafacades.uml.TypeMappings;
25
26
27
28
29
30
31
32 public abstract class SpringEntityOperationLogic
33 extends MetafacadeBase
34 implements SpringEntityOperation
35 {
36
37
38
39
40 protected Object metaObject;
41
42
43
44
45
46 protected SpringEntityOperationLogic(Object metaObjectIn, String context)
47 {
48 super(metaObjectIn, getContext(context));
49 this.superOperationFacade =
50 (OperationFacade)
51 MetafacadeFactory.getInstance().createFacadeImpl(
52 "org.andromda.metafacades.uml.OperationFacade",
53 metaObjectIn,
54 getContext(context));
55 this.metaObject = metaObjectIn;
56 }
57
58
59
60
61
62
63 private static String getContext(String context)
64 {
65 if (context == null)
66 {
67 context = "org.andromda.cartridges.spring.metafacades.SpringEntityOperation";
68 }
69 return context;
70 }
71
72 private OperationFacade superOperationFacade;
73 private boolean superOperationFacadeInitialized = false;
74
75
76
77
78
79 private OperationFacade getSuperOperationFacade()
80 {
81 if (!this.superOperationFacadeInitialized)
82 {
83 ((MetafacadeBase)this.superOperationFacade).setMetafacadeContext(this.getMetafacadeContext());
84 this.superOperationFacadeInitialized = true;
85 }
86 return this.superOperationFacade;
87 }
88
89
90
91
92
93 @Override
94 public void resetMetafacadeContext(String context)
95 {
96 if (!this.contextRoot)
97 {
98 context = getContext(context);
99 setMetafacadeContext (context);
100 if (this.superOperationFacadeInitialized)
101 {
102 ((MetafacadeBase)this.superOperationFacade).resetMetafacadeContext(context);
103 }
104 }
105 }
106
107
108
109
110
111 public boolean isSpringEntityOperationMetaType()
112 {
113 return true;
114 }
115
116
117
118
119
120
121
122 protected abstract String handleGetImplementationName();
123
124 private String __implementationName1a;
125 private boolean __implementationName1aSet = false;
126
127
128
129
130
131 public final String getImplementationName()
132 {
133 String implementationName1a = this.__implementationName1a;
134 if (!this.__implementationName1aSet)
135 {
136
137 implementationName1a = handleGetImplementationName();
138
139 this.__implementationName1a = implementationName1a;
140 if (isMetafacadePropertyCachingEnabled())
141 {
142 this.__implementationName1aSet = true;
143 }
144 }
145 return implementationName1a;
146 }
147
148
149
150
151
152 protected abstract String handleGetImplementationCall();
153
154 private String __implementationCall2a;
155 private boolean __implementationCall2aSet = false;
156
157
158
159
160
161 public final String getImplementationCall()
162 {
163 String implementationCall2a = this.__implementationCall2a;
164 if (!this.__implementationCall2aSet)
165 {
166
167 implementationCall2a = handleGetImplementationCall();
168
169 this.__implementationCall2a = implementationCall2a;
170 if (isMetafacadePropertyCachingEnabled())
171 {
172 this.__implementationCall2aSet = true;
173 }
174 }
175 return implementationCall2a;
176 }
177
178
179
180
181
182 protected abstract String handleGetImplementationSignature();
183
184 private String __implementationSignature3a;
185 private boolean __implementationSignature3aSet = false;
186
187
188
189
190
191 public final String getImplementationSignature()
192 {
193 String implementationSignature3a = this.__implementationSignature3a;
194 if (!this.__implementationSignature3aSet)
195 {
196
197 implementationSignature3a = handleGetImplementationSignature();
198
199 this.__implementationSignature3a = implementationSignature3a;
200 if (isMetafacadePropertyCachingEnabled())
201 {
202 this.__implementationSignature3aSet = true;
203 }
204 }
205 return implementationSignature3a;
206 }
207
208
209
210
211
212 protected abstract boolean handleIsPrePersist();
213
214 private boolean __prePersist4a;
215 private boolean __prePersist4aSet = false;
216
217
218
219
220
221
222
223 public final boolean isPrePersist()
224 {
225 boolean prePersist4a = this.__prePersist4a;
226 if (!this.__prePersist4aSet)
227 {
228
229 prePersist4a = handleIsPrePersist();
230
231 this.__prePersist4a = prePersist4a;
232 if (isMetafacadePropertyCachingEnabled())
233 {
234 this.__prePersist4aSet = true;
235 }
236 }
237 return prePersist4a;
238 }
239
240
241
242
243
244 protected abstract boolean handleIsPostPersist();
245
246 private boolean __postPersist5a;
247 private boolean __postPersist5aSet = false;
248
249
250
251
252
253
254 public final boolean isPostPersist()
255 {
256 boolean postPersist5a = this.__postPersist5a;
257 if (!this.__postPersist5aSet)
258 {
259
260 postPersist5a = handleIsPostPersist();
261
262 this.__postPersist5a = postPersist5a;
263 if (isMetafacadePropertyCachingEnabled())
264 {
265 this.__postPersist5aSet = true;
266 }
267 }
268 return postPersist5a;
269 }
270
271
272
273
274
275 protected abstract boolean handleIsPreRemove();
276
277 private boolean __preRemove6a;
278 private boolean __preRemove6aSet = false;
279
280
281
282
283
284
285 public final boolean isPreRemove()
286 {
287 boolean preRemove6a = this.__preRemove6a;
288 if (!this.__preRemove6aSet)
289 {
290
291 preRemove6a = handleIsPreRemove();
292
293 this.__preRemove6a = preRemove6a;
294 if (isMetafacadePropertyCachingEnabled())
295 {
296 this.__preRemove6aSet = true;
297 }
298 }
299 return preRemove6a;
300 }
301
302
303
304
305
306 protected abstract boolean handleIsPostRemove();
307
308 private boolean __postRemove7a;
309 private boolean __postRemove7aSet = false;
310
311
312
313
314
315
316 public final boolean isPostRemove()
317 {
318 boolean postRemove7a = this.__postRemove7a;
319 if (!this.__postRemove7aSet)
320 {
321
322 postRemove7a = handleIsPostRemove();
323
324 this.__postRemove7a = postRemove7a;
325 if (isMetafacadePropertyCachingEnabled())
326 {
327 this.__postRemove7aSet = true;
328 }
329 }
330 return postRemove7a;
331 }
332
333
334
335
336
337 protected abstract boolean handleIsPreUpdate();
338
339 private boolean __preUpdate8a;
340 private boolean __preUpdate8aSet = false;
341
342
343
344
345
346
347 public final boolean isPreUpdate()
348 {
349 boolean preUpdate8a = this.__preUpdate8a;
350 if (!this.__preUpdate8aSet)
351 {
352
353 preUpdate8a = handleIsPreUpdate();
354
355 this.__preUpdate8a = preUpdate8a;
356 if (isMetafacadePropertyCachingEnabled())
357 {
358 this.__preUpdate8aSet = true;
359 }
360 }
361 return preUpdate8a;
362 }
363
364
365
366
367
368 protected abstract boolean handleIsPostUpdate();
369
370 private boolean __postUpdate9a;
371 private boolean __postUpdate9aSet = false;
372
373
374
375
376
377
378 public final boolean isPostUpdate()
379 {
380 boolean postUpdate9a = this.__postUpdate9a;
381 if (!this.__postUpdate9aSet)
382 {
383
384 postUpdate9a = handleIsPostUpdate();
385
386 this.__postUpdate9a = postUpdate9a;
387 if (isMetafacadePropertyCachingEnabled())
388 {
389 this.__postUpdate9aSet = true;
390 }
391 }
392 return postUpdate9a;
393 }
394
395
396
397
398
399
400
401 public boolean isOperationFacadeMetaType()
402 {
403 return true;
404 }
405
406
407
408
409
410 public boolean isModelElementFacadeMetaType()
411 {
412 return true;
413 }
414
415
416
417
418
419
420 public void copyTaggedValues(ModelElementFacade element)
421 {
422 this.getSuperOperationFacade().copyTaggedValues(element);
423 }
424
425
426
427
428
429
430 public Object findTaggedValue(String tagName)
431 {
432 return this.getSuperOperationFacade().findTaggedValue(tagName);
433 }
434
435
436
437
438
439
440 public Collection<Object> findTaggedValues(String tagName)
441 {
442 return this.getSuperOperationFacade().findTaggedValues(tagName);
443 }
444
445
446
447
448
449
450
451 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
452 {
453 return this.getSuperOperationFacade().getBindedFullyQualifiedName(bindedElement);
454 }
455
456
457
458
459
460 public Collection<ConstraintFacade> getConstraints()
461 {
462 return this.getSuperOperationFacade().getConstraints();
463 }
464
465
466
467
468
469
470 public Collection<ConstraintFacade> getConstraints(String kind)
471 {
472 return this.getSuperOperationFacade().getConstraints(kind);
473 }
474
475
476
477
478
479
480
481 public String getDocumentation(String indent)
482 {
483 return this.getSuperOperationFacade().getDocumentation(indent);
484 }
485
486
487
488
489
490
491
492
493 public String getDocumentation(String indent, int lineLength)
494 {
495 return this.getSuperOperationFacade().getDocumentation(indent, lineLength);
496 }
497
498
499
500
501
502
503
504 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
505 {
506 return this.getSuperOperationFacade().getDocumentation(indent, lineLength, htmlStyle);
507 }
508
509
510
511
512
513 public String getFullyQualifiedName()
514 {
515 return this.getSuperOperationFacade().getFullyQualifiedName();
516 }
517
518
519
520
521
522
523
524
525 public String getFullyQualifiedName(boolean modelName)
526 {
527 return this.getSuperOperationFacade().getFullyQualifiedName(modelName);
528 }
529
530
531
532
533
534
535 public String getFullyQualifiedNamePath()
536 {
537 return this.getSuperOperationFacade().getFullyQualifiedNamePath();
538 }
539
540
541
542
543
544 public String getId()
545 {
546 return this.getSuperOperationFacade().getId();
547 }
548
549
550
551
552
553
554
555
556
557 public Collection<String> getKeywords()
558 {
559 return this.getSuperOperationFacade().getKeywords();
560 }
561
562
563
564
565
566 public String getLabel()
567 {
568 return this.getSuperOperationFacade().getLabel();
569 }
570
571
572
573
574
575 public TypeMappings getLanguageMappings()
576 {
577 return this.getSuperOperationFacade().getLanguageMappings();
578 }
579
580
581
582
583
584
585 public ModelFacade getModel()
586 {
587 return this.getSuperOperationFacade().getModel();
588 }
589
590
591
592
593
594 public String getName()
595 {
596 return this.getSuperOperationFacade().getName();
597 }
598
599
600
601
602
603 public ModelElementFacade getPackage()
604 {
605 return this.getSuperOperationFacade().getPackage();
606 }
607
608
609
610
611
612 public String getPackageName()
613 {
614 return this.getSuperOperationFacade().getPackageName();
615 }
616
617
618
619
620
621
622 public String getPackageName(boolean modelName)
623 {
624 return this.getSuperOperationFacade().getPackageName(modelName);
625 }
626
627
628
629
630
631 public String getPackagePath()
632 {
633 return this.getSuperOperationFacade().getPackagePath();
634 }
635
636
637
638
639
640
641
642
643 public String getQualifiedName()
644 {
645 return this.getSuperOperationFacade().getQualifiedName();
646 }
647
648
649
650
651
652 public PackageFacade getRootPackage()
653 {
654 return this.getSuperOperationFacade().getRootPackage();
655 }
656
657
658
659
660
661 public Collection<DependencyFacade> getSourceDependencies()
662 {
663 return this.getSuperOperationFacade().getSourceDependencies();
664 }
665
666
667
668
669
670
671 public StateMachineFacade getStateMachineContext()
672 {
673 return this.getSuperOperationFacade().getStateMachineContext();
674 }
675
676
677
678
679
680 public Collection<String> getStereotypeNames()
681 {
682 return this.getSuperOperationFacade().getStereotypeNames();
683 }
684
685
686
687
688
689 public Collection<StereotypeFacade> getStereotypes()
690 {
691 return this.getSuperOperationFacade().getStereotypes();
692 }
693
694
695
696
697
698 public Collection<TaggedValueFacade> getTaggedValues()
699 {
700 return this.getSuperOperationFacade().getTaggedValues();
701 }
702
703
704
705
706
707 public Collection<DependencyFacade> getTargetDependencies()
708 {
709 return this.getSuperOperationFacade().getTargetDependencies();
710 }
711
712
713
714
715
716 public Object getTemplateParameter(String parameterName)
717 {
718 return this.getSuperOperationFacade().getTemplateParameter(parameterName);
719 }
720
721
722
723
724
725 public Collection<TemplateParameterFacade> getTemplateParameters()
726 {
727 return this.getSuperOperationFacade().getTemplateParameters();
728 }
729
730
731
732
733
734
735 public String getVisibility()
736 {
737 return this.getSuperOperationFacade().getVisibility();
738 }
739
740
741
742
743
744
745 public boolean hasExactStereotype(String stereotypeName)
746 {
747 return this.getSuperOperationFacade().hasExactStereotype(stereotypeName);
748 }
749
750
751
752
753
754
755 public boolean hasKeyword(String keywordName)
756 {
757 return this.getSuperOperationFacade().hasKeyword(keywordName);
758 }
759
760
761
762
763
764
765
766
767
768
769
770
771
772 public boolean hasStereotype(String stereotypeName)
773 {
774 return this.getSuperOperationFacade().hasStereotype(stereotypeName);
775 }
776
777
778
779
780
781
782 public boolean isBindingDependenciesPresent()
783 {
784 return this.getSuperOperationFacade().isBindingDependenciesPresent();
785 }
786
787
788
789
790
791 public boolean isConstraintsPresent()
792 {
793 return this.getSuperOperationFacade().isConstraintsPresent();
794 }
795
796
797
798
799
800 public boolean isDocumentationPresent()
801 {
802 return this.getSuperOperationFacade().isDocumentationPresent();
803 }
804
805
806
807
808
809 public boolean isReservedWord()
810 {
811 return this.getSuperOperationFacade().isReservedWord();
812 }
813
814
815
816
817
818
819 public boolean isTemplateParametersPresent()
820 {
821 return this.getSuperOperationFacade().isTemplateParametersPresent();
822 }
823
824
825
826
827
828
829
830 public boolean isValidIdentifierName()
831 {
832 return this.getSuperOperationFacade().isValidIdentifierName();
833 }
834
835
836
837
838
839
840
841 public String translateConstraint(String name, String translation)
842 {
843 return this.getSuperOperationFacade().translateConstraint(name, translation);
844 }
845
846
847
848
849
850 public String[] translateConstraints(String translation)
851 {
852 return this.getSuperOperationFacade().translateConstraints(translation);
853 }
854
855
856
857
858
859 public String[] translateConstraints(String kind, String translation)
860 {
861 return this.getSuperOperationFacade().translateConstraints(kind, translation);
862 }
863
864
865
866
867
868
869 public ParameterFacade findParameter(String name)
870 {
871 return this.getSuperOperationFacade().findParameter(name);
872 }
873
874
875
876
877
878
879
880 public Object findTaggedValue(String name, boolean follow)
881 {
882 return this.getSuperOperationFacade().findTaggedValue(name, follow);
883 }
884
885
886
887
888
889 public String getArgumentNames()
890 {
891 return this.getSuperOperationFacade().getArgumentNames();
892 }
893
894
895
896
897
898 public String getArgumentTypeNames()
899 {
900 return this.getSuperOperationFacade().getArgumentTypeNames();
901 }
902
903
904
905
906
907
908
909
910
911 public Collection<ParameterFacade> getArguments()
912 {
913 return this.getSuperOperationFacade().getArguments();
914 }
915
916
917
918
919
920 public String getCall()
921 {
922 return this.getSuperOperationFacade().getCall();
923 }
924
925
926
927
928
929
930
931 public String getConcurrency()
932 {
933 return this.getSuperOperationFacade().getConcurrency();
934 }
935
936
937
938
939
940
941 public String getExceptionList()
942 {
943 return this.getSuperOperationFacade().getExceptionList();
944 }
945
946
947
948
949
950
951 public String getExceptionList(String initialExceptions)
952 {
953 return this.getSuperOperationFacade().getExceptionList(initialExceptions);
954 }
955
956
957
958
959
960 public Collection<ModelElementFacade> getExceptions()
961 {
962 return this.getSuperOperationFacade().getExceptions();
963 }
964
965
966
967
968
969 public String getGetterSetterReturnTypeName()
970 {
971 return this.getSuperOperationFacade().getGetterSetterReturnTypeName();
972 }
973
974
975
976
977
978
979 public int getLower()
980 {
981 return this.getSuperOperationFacade().getLower();
982 }
983
984
985
986
987
988 public String getMethodBody()
989 {
990 return this.getSuperOperationFacade().getMethodBody();
991 }
992
993
994
995
996
997 public OperationFacade getOverriddenOperation()
998 {
999 return this.getSuperOperationFacade().getOverriddenOperation();
1000 }
1001
1002
1003
1004
1005
1006 public ClassifierFacade getOwner()
1007 {
1008 return this.getSuperOperationFacade().getOwner();
1009 }
1010
1011
1012
1013
1014
1015 public Collection<ParameterFacade> getParameters()
1016 {
1017 return this.getSuperOperationFacade().getParameters();
1018 }
1019
1020
1021
1022
1023
1024 public String getPostconditionName()
1025 {
1026 return this.getSuperOperationFacade().getPostconditionName();
1027 }
1028
1029
1030
1031
1032
1033 public Collection<ConstraintFacade> getPostconditions()
1034 {
1035 return this.getSuperOperationFacade().getPostconditions();
1036 }
1037
1038
1039
1040
1041
1042 public String getPreconditionCall()
1043 {
1044 return this.getSuperOperationFacade().getPreconditionCall();
1045 }
1046
1047
1048
1049
1050
1051 public String getPreconditionName()
1052 {
1053 return this.getSuperOperationFacade().getPreconditionName();
1054 }
1055
1056
1057
1058
1059
1060 public String getPreconditionSignature()
1061 {
1062 return this.getSuperOperationFacade().getPreconditionSignature();
1063 }
1064
1065
1066
1067
1068
1069 public Collection<ConstraintFacade> getPreconditions()
1070 {
1071 return this.getSuperOperationFacade().getPreconditions();
1072 }
1073
1074
1075
1076
1077
1078 public ParameterFacade getReturnParameter()
1079 {
1080 return this.getSuperOperationFacade().getReturnParameter();
1081 }
1082
1083
1084
1085
1086
1087 public ClassifierFacade getReturnType()
1088 {
1089 return this.getSuperOperationFacade().getReturnType();
1090 }
1091
1092
1093
1094
1095
1096
1097 public String getSignature()
1098 {
1099 return this.getSuperOperationFacade().getSignature();
1100 }
1101
1102
1103
1104
1105
1106
1107
1108 public String getSignature(boolean withArgumentNames)
1109 {
1110 return this.getSuperOperationFacade().getSignature(withArgumentNames);
1111 }
1112
1113
1114
1115
1116
1117
1118 public String getSignature(String argumentModifier)
1119 {
1120 return this.getSuperOperationFacade().getSignature(argumentModifier);
1121 }
1122
1123
1124
1125
1126
1127 public String getTypedArgumentList()
1128 {
1129 return this.getSuperOperationFacade().getTypedArgumentList();
1130 }
1131
1132
1133
1134
1135
1136
1137 public String getTypedArgumentList(String modifier)
1138 {
1139 return this.getSuperOperationFacade().getTypedArgumentList(modifier);
1140 }
1141
1142
1143
1144
1145
1146
1147 public int getUpper()
1148 {
1149 return this.getSuperOperationFacade().getUpper();
1150 }
1151
1152
1153
1154
1155
1156 public boolean isAbstract()
1157 {
1158 return this.getSuperOperationFacade().isAbstract();
1159 }
1160
1161
1162
1163
1164
1165 public boolean isExceptionsPresent()
1166 {
1167 return this.getSuperOperationFacade().isExceptionsPresent();
1168 }
1169
1170
1171
1172
1173
1174
1175 public boolean isLeaf()
1176 {
1177 return this.getSuperOperationFacade().isLeaf();
1178 }
1179
1180
1181
1182
1183
1184
1185 public boolean isMany()
1186 {
1187 return this.getSuperOperationFacade().isMany();
1188 }
1189
1190
1191
1192
1193
1194
1195 public boolean isOrdered()
1196 {
1197 return this.getSuperOperationFacade().isOrdered();
1198 }
1199
1200
1201
1202
1203
1204
1205
1206 public boolean isOverriding()
1207 {
1208 return this.getSuperOperationFacade().isOverriding();
1209 }
1210
1211
1212
1213
1214
1215 public boolean isPostconditionsPresent()
1216 {
1217 return this.getSuperOperationFacade().isPostconditionsPresent();
1218 }
1219
1220
1221
1222
1223
1224 public boolean isPreconditionsPresent()
1225 {
1226 return this.getSuperOperationFacade().isPreconditionsPresent();
1227 }
1228
1229
1230
1231
1232
1233 public boolean isQuery()
1234 {
1235 return this.getSuperOperationFacade().isQuery();
1236 }
1237
1238
1239
1240
1241
1242
1243 public boolean isReturnTypePresent()
1244 {
1245 return this.getSuperOperationFacade().isReturnTypePresent();
1246 }
1247
1248
1249
1250
1251
1252 public boolean isStatic()
1253 {
1254 return this.getSuperOperationFacade().isStatic();
1255 }
1256
1257
1258
1259
1260
1261
1262 public boolean isUnique()
1263 {
1264 return this.getSuperOperationFacade().isUnique();
1265 }
1266
1267
1268
1269
1270 @Override
1271 public void initialize()
1272 {
1273 this.getSuperOperationFacade().initialize();
1274 }
1275
1276
1277
1278
1279
1280 @Override
1281 public Object getValidationOwner()
1282 {
1283 Object owner = this.getSuperOperationFacade().getValidationOwner();
1284 return owner;
1285 }
1286
1287
1288
1289
1290
1291 @Override
1292 public String getValidationName()
1293 {
1294 String name = this.getSuperOperationFacade().getValidationName();
1295 return name;
1296 }
1297
1298
1299
1300
1301
1302 @Override
1303 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1304 {
1305 this.getSuperOperationFacade().validateInvariants(validationMessages);
1306 }
1307
1308
1309
1310
1311 private static final String NAME_PROPERTY = "name";
1312 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1313
1314
1315
1316
1317 @Override
1318 public String toString()
1319 {
1320 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1321 toString.append("[");
1322 try
1323 {
1324 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1325 }
1326 catch (final Throwable tryAgain)
1327 {
1328 try
1329 {
1330 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1331 }
1332 catch (final Throwable ignore)
1333 {
1334
1335 }
1336 }
1337 toString.append("]");
1338 return toString.toString();
1339 }
1340 }