1
2
3
4
5 package org.andromda.cartridges.bpm4struts.metafacades;
6
7 import java.util.Collection;
8 import java.util.List;
9 import org.andromda.core.common.Introspector;
10 import org.andromda.core.metafacade.MetafacadeBase;
11 import org.andromda.core.metafacade.MetafacadeFactory;
12 import org.andromda.core.metafacade.ModelValidationMessage;
13 import org.andromda.metafacades.uml.AssociationEndFacade;
14 import org.andromda.metafacades.uml.AttributeFacade;
15 import org.andromda.metafacades.uml.ClassifierFacade;
16 import org.andromda.metafacades.uml.ConstraintFacade;
17 import org.andromda.metafacades.uml.DependencyFacade;
18 import org.andromda.metafacades.uml.FrontEndAction;
19 import org.andromda.metafacades.uml.FrontEndController;
20 import org.andromda.metafacades.uml.FrontEndUseCase;
21 import org.andromda.metafacades.uml.GeneralizableElementFacade;
22 import org.andromda.metafacades.uml.GeneralizationFacade;
23 import org.andromda.metafacades.uml.ModelElementFacade;
24 import org.andromda.metafacades.uml.ModelFacade;
25 import org.andromda.metafacades.uml.OperationFacade;
26 import org.andromda.metafacades.uml.PackageFacade;
27 import org.andromda.metafacades.uml.StateMachineFacade;
28 import org.andromda.metafacades.uml.StereotypeFacade;
29 import org.andromda.metafacades.uml.TaggedValueFacade;
30 import org.andromda.metafacades.uml.TemplateParameterFacade;
31 import org.andromda.metafacades.uml.TypeMappings;
32 import org.andromda.translation.ocl.validation.OCLCollections;
33 import org.andromda.translation.ocl.validation.OCLExpressions;
34 import org.andromda.translation.ocl.validation.OCLIntrospector;
35 import org.andromda.translation.ocl.validation.OCLResultEnsurer;
36 import org.apache.commons.collections.Transformer;
37 import org.apache.log4j.Logger;
38
39
40
41
42
43
44
45
46 public abstract class StrutsControllerLogic
47 extends MetafacadeBase
48 implements StrutsController
49 {
50
51
52
53
54 protected Object metaObject;
55
56
57
58
59
60 protected StrutsControllerLogic(Object metaObjectIn, String context)
61 {
62 super(metaObjectIn, getContext(context));
63 this.superFrontEndController =
64 (FrontEndController)
65 MetafacadeFactory.getInstance().createFacadeImpl(
66 "org.andromda.metafacades.uml.FrontEndController",
67 metaObjectIn,
68 getContext(context));
69 this.metaObject = metaObjectIn;
70 }
71
72
73
74
75 private static final Logger logger = Logger.getLogger(StrutsControllerLogic.class);
76
77
78
79
80
81
82 private static String getContext(String context)
83 {
84 if (context == null)
85 {
86 context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsController";
87 }
88 return context;
89 }
90
91 private FrontEndController superFrontEndController;
92 private boolean superFrontEndControllerInitialized = false;
93
94
95
96
97
98 private FrontEndController getSuperFrontEndController()
99 {
100 if (!this.superFrontEndControllerInitialized)
101 {
102 ((MetafacadeBase)this.superFrontEndController).setMetafacadeContext(this.getMetafacadeContext());
103 this.superFrontEndControllerInitialized = true;
104 }
105 return this.superFrontEndController;
106 }
107
108
109
110
111
112 @Override
113 public void resetMetafacadeContext(String context)
114 {
115 if (!this.contextRoot)
116 {
117 context = getContext(context);
118 setMetafacadeContext (context);
119 if (this.superFrontEndControllerInitialized)
120 {
121 ((MetafacadeBase)this.superFrontEndController).resetMetafacadeContext(context);
122 }
123 }
124 }
125
126
127
128
129
130 public boolean isStrutsControllerMetaType()
131 {
132 return true;
133 }
134
135
136
137
138
139
140
141 protected abstract String handleGetFullPath();
142
143
144
145
146
147
148 public final String getFullPath()
149 {
150 String fullPath1a = null;
151
152 fullPath1a = handleGetFullPath();
153
154 return fullPath1a;
155 }
156
157
158
159 private List<StrutsSessionObject> __getSessionObjects1r;
160 private boolean __getSessionObjects1rSet = false;
161
162
163
164
165
166
167
168 public final List<StrutsSessionObject> getSessionObjects()
169 {
170 List<StrutsSessionObject> getSessionObjects1r = this.__getSessionObjects1r;
171 if (!this.__getSessionObjects1rSet)
172 {
173
174 List result = handleGetSessionObjects();
175 List shieldedResult = this.shieldedElements(result);
176 try
177 {
178 getSessionObjects1r = (List<StrutsSessionObject>)shieldedResult;
179 }
180 catch (ClassCastException ex)
181 {
182
183 StrutsControllerLogic.logger.warn("incorrect metafacade cast for StrutsControllerLogic.getSessionObjects List<StrutsSessionObject> " + result + ": " + shieldedResult);
184 }
185
186 this.__getSessionObjects1r = getSessionObjects1r;
187 if (isMetafacadePropertyCachingEnabled())
188 {
189 this.__getSessionObjects1rSet = true;
190 }
191 }
192 return getSessionObjects1r;
193 }
194
195
196
197
198
199 protected abstract List handleGetSessionObjects();
200
201 private List<StrutsParameter> __getAllArguments2r;
202 private boolean __getAllArguments2rSet = false;
203
204
205
206
207
208
209
210 public final List<StrutsParameter> getAllArguments()
211 {
212 List<StrutsParameter> getAllArguments2r = this.__getAllArguments2r;
213 if (!this.__getAllArguments2rSet)
214 {
215
216 List result = handleGetAllArguments();
217 List shieldedResult = this.shieldedElements(result);
218 try
219 {
220 getAllArguments2r = (List<StrutsParameter>)shieldedResult;
221 }
222 catch (ClassCastException ex)
223 {
224
225 StrutsControllerLogic.logger.warn("incorrect metafacade cast for StrutsControllerLogic.getAllArguments List<StrutsParameter> " + result + ": " + shieldedResult);
226 }
227
228 this.__getAllArguments2r = getAllArguments2r;
229 if (isMetafacadePropertyCachingEnabled())
230 {
231 this.__getAllArguments2rSet = true;
232 }
233 }
234 return getAllArguments2r;
235 }
236
237
238
239
240
241 protected abstract List handleGetAllArguments();
242
243
244
245
246
247 public boolean isFrontEndControllerMetaType()
248 {
249 return true;
250 }
251
252
253
254
255
256 public boolean isClassifierFacadeMetaType()
257 {
258 return true;
259 }
260
261
262
263
264
265 public boolean isGeneralizableElementFacadeMetaType()
266 {
267 return true;
268 }
269
270
271
272
273
274 public boolean isModelElementFacadeMetaType()
275 {
276 return true;
277 }
278
279
280
281
282
283
284 public AttributeFacade findAttribute(String name)
285 {
286 return this.getSuperFrontEndController().findAttribute(name);
287 }
288
289
290
291
292
293 public Collection<ClassifierFacade> getAbstractions()
294 {
295 return this.getSuperFrontEndController().getAbstractions();
296 }
297
298
299
300
301
302
303 public Collection<ClassifierFacade> getAllAssociatedClasses()
304 {
305 return this.getSuperFrontEndController().getAllAssociatedClasses();
306 }
307
308
309
310
311
312
313 public Collection<ModelElementFacade> getAllProperties()
314 {
315 return this.getSuperFrontEndController().getAllProperties();
316 }
317
318
319
320
321
322
323 public Collection<ModelElementFacade> getAllRequiredConstructorParameters()
324 {
325 return this.getSuperFrontEndController().getAllRequiredConstructorParameters();
326 }
327
328
329
330
331
332
333 public ClassifierFacade getArray()
334 {
335 return this.getSuperFrontEndController().getArray();
336 }
337
338
339
340
341
342 public String getArrayName()
343 {
344 return this.getSuperFrontEndController().getArrayName();
345 }
346
347
348
349
350
351
352 public Collection<ClassifierFacade> getAssociatedClasses()
353 {
354 return this.getSuperFrontEndController().getAssociatedClasses();
355 }
356
357
358
359
360
361 public List<AssociationEndFacade> getAssociationEnds()
362 {
363 return this.getSuperFrontEndController().getAssociationEnds();
364 }
365
366
367
368
369
370 public List<AttributeFacade> getAttributes()
371 {
372 return this.getSuperFrontEndController().getAttributes();
373 }
374
375
376
377
378
379
380 public List<AttributeFacade> getAttributes(boolean follow)
381 {
382 return this.getSuperFrontEndController().getAttributes(follow);
383 }
384
385
386
387
388
389 public String getFullyQualifiedArrayName()
390 {
391 return this.getSuperFrontEndController().getFullyQualifiedArrayName();
392 }
393
394
395
396
397
398
399
400
401 public Collection<OperationFacade> getImplementationOperations()
402 {
403 return this.getSuperFrontEndController().getImplementationOperations();
404 }
405
406
407
408
409
410 public String getImplementedInterfaceList()
411 {
412 return this.getSuperFrontEndController().getImplementedInterfaceList();
413 }
414
415
416
417
418
419 public Collection<AttributeFacade> getInstanceAttributes()
420 {
421 return this.getSuperFrontEndController().getInstanceAttributes();
422 }
423
424
425
426
427
428 public List<OperationFacade> getInstanceOperations()
429 {
430 return this.getSuperFrontEndController().getInstanceOperations();
431 }
432
433
434
435
436
437
438 public Collection<ClassifierFacade> getInterfaceAbstractions()
439 {
440 return this.getSuperFrontEndController().getInterfaceAbstractions();
441 }
442
443
444
445
446
447
448 public String getJavaNewString()
449 {
450 return this.getSuperFrontEndController().getJavaNewString();
451 }
452
453
454
455
456
457
458 public String getJavaNullString()
459 {
460 return this.getSuperFrontEndController().getJavaNullString();
461 }
462
463
464
465
466
467 public Collection<AssociationEndFacade> getNavigableConnectingEnds()
468 {
469 return this.getSuperFrontEndController().getNavigableConnectingEnds();
470 }
471
472
473
474
475
476
477 public List<AssociationEndFacade> getNavigableConnectingEnds(boolean follow)
478 {
479 return this.getSuperFrontEndController().getNavigableConnectingEnds(follow);
480 }
481
482
483
484
485
486
487
488 public ClassifierFacade getNonArray()
489 {
490 return this.getSuperFrontEndController().getNonArray();
491 }
492
493
494
495
496
497
498
499 public String getOperationCallFromAttributes()
500 {
501 return this.getSuperFrontEndController().getOperationCallFromAttributes();
502 }
503
504
505
506
507
508 public List<OperationFacade> getOperations()
509 {
510 return this.getSuperFrontEndController().getOperations();
511 }
512
513
514
515
516
517
518 public List<ModelElementFacade> getProperties()
519 {
520 return this.getSuperFrontEndController().getProperties();
521 }
522
523
524
525
526
527
528
529 public List getProperties(boolean follow)
530 {
531 return this.getSuperFrontEndController().getProperties(follow);
532 }
533
534
535
536
537
538
539 public Collection<ModelElementFacade> getRequiredConstructorParameters()
540 {
541 return this.getSuperFrontEndController().getRequiredConstructorParameters();
542 }
543
544
545
546
547
548 public long getSerialVersionUID()
549 {
550 return this.getSuperFrontEndController().getSerialVersionUID();
551 }
552
553
554
555
556
557 public Collection<AttributeFacade> getStaticAttributes()
558 {
559 return this.getSuperFrontEndController().getStaticAttributes();
560 }
561
562
563
564
565
566 public List<OperationFacade> getStaticOperations()
567 {
568 return this.getSuperFrontEndController().getStaticOperations();
569 }
570
571
572
573
574
575
576 public ClassifierFacade getSuperClass()
577 {
578 return this.getSuperFrontEndController().getSuperClass();
579 }
580
581
582
583
584
585
586
587
588
589 public String getWrapperName()
590 {
591 return this.getSuperFrontEndController().getWrapperName();
592 }
593
594
595
596
597
598 public boolean isAbstract()
599 {
600 return this.getSuperFrontEndController().isAbstract();
601 }
602
603
604
605
606
607 public boolean isArrayType()
608 {
609 return this.getSuperFrontEndController().isArrayType();
610 }
611
612
613
614
615
616 public boolean isAssociationClass()
617 {
618 return this.getSuperFrontEndController().isAssociationClass();
619 }
620
621
622
623
624
625 public boolean isBlobType()
626 {
627 return this.getSuperFrontEndController().isBlobType();
628 }
629
630
631
632
633
634 public boolean isBooleanType()
635 {
636 return this.getSuperFrontEndController().isBooleanType();
637 }
638
639
640
641
642
643 public boolean isCharacterType()
644 {
645 return this.getSuperFrontEndController().isCharacterType();
646 }
647
648
649
650
651
652 public boolean isClobType()
653 {
654 return this.getSuperFrontEndController().isClobType();
655 }
656
657
658
659
660
661 public boolean isCollectionType()
662 {
663 return this.getSuperFrontEndController().isCollectionType();
664 }
665
666
667
668
669
670
671
672 public boolean isDataType()
673 {
674 return this.getSuperFrontEndController().isDataType();
675 }
676
677
678
679
680
681 public boolean isDateType()
682 {
683 return this.getSuperFrontEndController().isDateType();
684 }
685
686
687
688
689
690 public boolean isDoubleType()
691 {
692 return this.getSuperFrontEndController().isDoubleType();
693 }
694
695
696
697
698
699 public boolean isEmbeddedValue()
700 {
701 return this.getSuperFrontEndController().isEmbeddedValue();
702 }
703
704
705
706
707
708 public boolean isEnumeration()
709 {
710 return this.getSuperFrontEndController().isEnumeration();
711 }
712
713
714
715
716
717 public boolean isFileType()
718 {
719 return this.getSuperFrontEndController().isFileType();
720 }
721
722
723
724
725
726 public boolean isFloatType()
727 {
728 return this.getSuperFrontEndController().isFloatType();
729 }
730
731
732
733
734
735 public boolean isIntegerType()
736 {
737 return this.getSuperFrontEndController().isIntegerType();
738 }
739
740
741
742
743
744 public boolean isInterface()
745 {
746 return this.getSuperFrontEndController().isInterface();
747 }
748
749
750
751
752
753 public boolean isLeaf()
754 {
755 return this.getSuperFrontEndController().isLeaf();
756 }
757
758
759
760
761
762 public boolean isListType()
763 {
764 return this.getSuperFrontEndController().isListType();
765 }
766
767
768
769
770
771 public boolean isLongType()
772 {
773 return this.getSuperFrontEndController().isLongType();
774 }
775
776
777
778
779
780 public boolean isMapType()
781 {
782 return this.getSuperFrontEndController().isMapType();
783 }
784
785
786
787
788
789 public boolean isPrimitive()
790 {
791 return this.getSuperFrontEndController().isPrimitive();
792 }
793
794
795
796
797
798 public boolean isSetType()
799 {
800 return this.getSuperFrontEndController().isSetType();
801 }
802
803
804
805
806
807 public boolean isStringType()
808 {
809 return this.getSuperFrontEndController().isStringType();
810 }
811
812
813
814
815
816 public boolean isTimeType()
817 {
818 return this.getSuperFrontEndController().isTimeType();
819 }
820
821
822
823
824
825 public boolean isWrappedPrimitive()
826 {
827 return this.getSuperFrontEndController().isWrappedPrimitive();
828 }
829
830
831
832
833
834 public List<FrontEndAction> getDeferringActions()
835 {
836 return this.getSuperFrontEndController().getDeferringActions();
837 }
838
839
840
841
842
843 public List<DependencyFacade> getServiceReferences()
844 {
845 return this.getSuperFrontEndController().getServiceReferences();
846 }
847
848
849
850
851
852 public FrontEndUseCase getUseCase()
853 {
854 return this.getSuperFrontEndController().getUseCase();
855 }
856
857
858
859
860
861
862 public Object findTaggedValue(String tagName, boolean follow)
863 {
864 return this.getSuperFrontEndController().findTaggedValue(tagName, follow);
865 }
866
867
868
869
870
871 public Collection<GeneralizableElementFacade> getAllGeneralizations()
872 {
873 return this.getSuperFrontEndController().getAllGeneralizations();
874 }
875
876
877
878
879
880 public Collection<GeneralizableElementFacade> getAllSpecializations()
881 {
882 return this.getSuperFrontEndController().getAllSpecializations();
883 }
884
885
886
887
888
889 public GeneralizableElementFacade getGeneralization()
890 {
891 return this.getSuperFrontEndController().getGeneralization();
892 }
893
894
895
896
897
898
899 public Collection<GeneralizationFacade> getGeneralizationLinks()
900 {
901 return this.getSuperFrontEndController().getGeneralizationLinks();
902 }
903
904
905
906
907
908 public String getGeneralizationList()
909 {
910 return this.getSuperFrontEndController().getGeneralizationList();
911 }
912
913
914
915
916
917
918 public GeneralizableElementFacade getGeneralizationRoot()
919 {
920 return this.getSuperFrontEndController().getGeneralizationRoot();
921 }
922
923
924
925
926
927 public Collection<GeneralizableElementFacade> getGeneralizations()
928 {
929 return this.getSuperFrontEndController().getGeneralizations();
930 }
931
932
933
934
935
936 public Collection<GeneralizableElementFacade> getSpecializations()
937 {
938 return this.getSuperFrontEndController().getSpecializations();
939 }
940
941
942
943
944
945 public void copyTaggedValues(ModelElementFacade element)
946 {
947 this.getSuperFrontEndController().copyTaggedValues(element);
948 }
949
950
951
952
953
954
955 public Object findTaggedValue(String tagName)
956 {
957 return this.getSuperFrontEndController().findTaggedValue(tagName);
958 }
959
960
961
962
963
964
965 public Collection<Object> findTaggedValues(String tagName)
966 {
967 return this.getSuperFrontEndController().findTaggedValues(tagName);
968 }
969
970
971
972
973
974
975
976 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
977 {
978 return this.getSuperFrontEndController().getBindedFullyQualifiedName(bindedElement);
979 }
980
981
982
983
984
985 public Collection<ConstraintFacade> getConstraints()
986 {
987 return this.getSuperFrontEndController().getConstraints();
988 }
989
990
991
992
993
994
995 public Collection<ConstraintFacade> getConstraints(String kind)
996 {
997 return this.getSuperFrontEndController().getConstraints(kind);
998 }
999
1000
1001
1002
1003
1004
1005
1006 public String getDocumentation(String indent)
1007 {
1008 return this.getSuperFrontEndController().getDocumentation(indent);
1009 }
1010
1011
1012
1013
1014
1015
1016
1017
1018 public String getDocumentation(String indent, int lineLength)
1019 {
1020 return this.getSuperFrontEndController().getDocumentation(indent, lineLength);
1021 }
1022
1023
1024
1025
1026
1027
1028
1029 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
1030 {
1031 return this.getSuperFrontEndController().getDocumentation(indent, lineLength, htmlStyle);
1032 }
1033
1034
1035
1036
1037
1038 public String getFullyQualifiedName()
1039 {
1040 return this.getSuperFrontEndController().getFullyQualifiedName();
1041 }
1042
1043
1044
1045
1046
1047
1048
1049
1050 public String getFullyQualifiedName(boolean modelName)
1051 {
1052 return this.getSuperFrontEndController().getFullyQualifiedName(modelName);
1053 }
1054
1055
1056
1057
1058
1059
1060 public String getFullyQualifiedNamePath()
1061 {
1062 return this.getSuperFrontEndController().getFullyQualifiedNamePath();
1063 }
1064
1065
1066
1067
1068
1069 public String getId()
1070 {
1071 return this.getSuperFrontEndController().getId();
1072 }
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082 public Collection<String> getKeywords()
1083 {
1084 return this.getSuperFrontEndController().getKeywords();
1085 }
1086
1087
1088
1089
1090
1091 public String getLabel()
1092 {
1093 return this.getSuperFrontEndController().getLabel();
1094 }
1095
1096
1097
1098
1099
1100 public TypeMappings getLanguageMappings()
1101 {
1102 return this.getSuperFrontEndController().getLanguageMappings();
1103 }
1104
1105
1106
1107
1108
1109
1110 public ModelFacade getModel()
1111 {
1112 return this.getSuperFrontEndController().getModel();
1113 }
1114
1115
1116
1117
1118
1119 public String getName()
1120 {
1121 return this.getSuperFrontEndController().getName();
1122 }
1123
1124
1125
1126
1127
1128 public ModelElementFacade getPackage()
1129 {
1130 return this.getSuperFrontEndController().getPackage();
1131 }
1132
1133
1134
1135
1136
1137 public String getPackageName()
1138 {
1139 return this.getSuperFrontEndController().getPackageName();
1140 }
1141
1142
1143
1144
1145
1146
1147 public String getPackageName(boolean modelName)
1148 {
1149 return this.getSuperFrontEndController().getPackageName(modelName);
1150 }
1151
1152
1153
1154
1155
1156 public String getPackagePath()
1157 {
1158 return this.getSuperFrontEndController().getPackagePath();
1159 }
1160
1161
1162
1163
1164
1165
1166
1167
1168 public String getQualifiedName()
1169 {
1170 return this.getSuperFrontEndController().getQualifiedName();
1171 }
1172
1173
1174
1175
1176
1177 public PackageFacade getRootPackage()
1178 {
1179 return this.getSuperFrontEndController().getRootPackage();
1180 }
1181
1182
1183
1184
1185
1186 public Collection<DependencyFacade> getSourceDependencies()
1187 {
1188 return this.getSuperFrontEndController().getSourceDependencies();
1189 }
1190
1191
1192
1193
1194
1195
1196 public StateMachineFacade getStateMachineContext()
1197 {
1198 return this.getSuperFrontEndController().getStateMachineContext();
1199 }
1200
1201
1202
1203
1204
1205 public Collection<String> getStereotypeNames()
1206 {
1207 return this.getSuperFrontEndController().getStereotypeNames();
1208 }
1209
1210
1211
1212
1213
1214 public Collection<StereotypeFacade> getStereotypes()
1215 {
1216 return this.getSuperFrontEndController().getStereotypes();
1217 }
1218
1219
1220
1221
1222
1223 public Collection<TaggedValueFacade> getTaggedValues()
1224 {
1225 return this.getSuperFrontEndController().getTaggedValues();
1226 }
1227
1228
1229
1230
1231
1232 public Collection<DependencyFacade> getTargetDependencies()
1233 {
1234 return this.getSuperFrontEndController().getTargetDependencies();
1235 }
1236
1237
1238
1239
1240
1241 public Object getTemplateParameter(String parameterName)
1242 {
1243 return this.getSuperFrontEndController().getTemplateParameter(parameterName);
1244 }
1245
1246
1247
1248
1249
1250 public Collection<TemplateParameterFacade> getTemplateParameters()
1251 {
1252 return this.getSuperFrontEndController().getTemplateParameters();
1253 }
1254
1255
1256
1257
1258
1259
1260 public String getVisibility()
1261 {
1262 return this.getSuperFrontEndController().getVisibility();
1263 }
1264
1265
1266
1267
1268
1269
1270 public boolean hasExactStereotype(String stereotypeName)
1271 {
1272 return this.getSuperFrontEndController().hasExactStereotype(stereotypeName);
1273 }
1274
1275
1276
1277
1278
1279
1280 public boolean hasKeyword(String keywordName)
1281 {
1282 return this.getSuperFrontEndController().hasKeyword(keywordName);
1283 }
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297 public boolean hasStereotype(String stereotypeName)
1298 {
1299 return this.getSuperFrontEndController().hasStereotype(stereotypeName);
1300 }
1301
1302
1303
1304
1305
1306
1307 public boolean isBindingDependenciesPresent()
1308 {
1309 return this.getSuperFrontEndController().isBindingDependenciesPresent();
1310 }
1311
1312
1313
1314
1315
1316 public boolean isConstraintsPresent()
1317 {
1318 return this.getSuperFrontEndController().isConstraintsPresent();
1319 }
1320
1321
1322
1323
1324
1325 public boolean isDocumentationPresent()
1326 {
1327 return this.getSuperFrontEndController().isDocumentationPresent();
1328 }
1329
1330
1331
1332
1333
1334 public boolean isReservedWord()
1335 {
1336 return this.getSuperFrontEndController().isReservedWord();
1337 }
1338
1339
1340
1341
1342
1343
1344 public boolean isTemplateParametersPresent()
1345 {
1346 return this.getSuperFrontEndController().isTemplateParametersPresent();
1347 }
1348
1349
1350
1351
1352
1353
1354
1355 public boolean isValidIdentifierName()
1356 {
1357 return this.getSuperFrontEndController().isValidIdentifierName();
1358 }
1359
1360
1361
1362
1363
1364
1365
1366 public String translateConstraint(String name, String translation)
1367 {
1368 return this.getSuperFrontEndController().translateConstraint(name, translation);
1369 }
1370
1371
1372
1373
1374
1375 public String[] translateConstraints(String translation)
1376 {
1377 return this.getSuperFrontEndController().translateConstraints(translation);
1378 }
1379
1380
1381
1382
1383
1384 public String[] translateConstraints(String kind, String translation)
1385 {
1386 return this.getSuperFrontEndController().translateConstraints(kind, translation);
1387 }
1388
1389
1390
1391
1392 @Override
1393 public void initialize()
1394 {
1395 this.getSuperFrontEndController().initialize();
1396 }
1397
1398
1399
1400
1401
1402 @Override
1403 public Object getValidationOwner()
1404 {
1405 Object owner = this.getSuperFrontEndController().getValidationOwner();
1406 return owner;
1407 }
1408
1409
1410
1411
1412
1413 @Override
1414 public String getValidationName()
1415 {
1416 String name = this.getSuperFrontEndController().getValidationName();
1417 return name;
1418 }
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433 @Override
1434 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1435 {
1436 this.getSuperFrontEndController().validateInvariants(validationMessages);
1437 try
1438 {
1439 final Object contextElement = this.THIS();
1440 boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")));
1441 if (!constraintValid)
1442 {
1443 validationMessages.add(
1444 new ModelValidationMessage(
1445 (MetafacadeBase)contextElement ,
1446 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller must have a name",
1447 "Each controller must have a name, it cannot be empty."));
1448 }
1449 }
1450 catch (Throwable th)
1451 {
1452 Throwable cause = th.getCause();
1453 int depth = 0;
1454 while (cause != null && depth < 7)
1455 {
1456 th = cause;
1457 depth++;
1458 }
1459 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller must have a name' ON "
1460 + this.THIS().toString() + ": " + th.getMessage(), th);
1461 }
1462 try
1463 {
1464 final Object contextElement = this.THIS();
1465 boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.isUnique(OCLIntrospector.invoke(contextElement,"operations"),new Transformer(){public Object transform(Object object){return OCLIntrospector.invoke(object,"name");}}));
1466 if (!constraintValid)
1467 {
1468 validationMessages.add(
1469 new ModelValidationMessage(
1470 (MetafacadeBase)contextElement ,
1471 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::unique operation names",
1472 "A controller cannot have different operations with the same name, even if they have a different signature."));
1473 }
1474 }
1475 catch (Throwable th)
1476 {
1477 Throwable cause = th.getCause();
1478 int depth = 0;
1479 while (cause != null && depth < 7)
1480 {
1481 th = cause;
1482 depth++;
1483 }
1484 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsController::unique operation names' ON "
1485 + this.THIS().toString() + ": " + th.getMessage(), th);
1486 }
1487 try
1488 {
1489 final Object contextElement = this.THIS();
1490 boolean constraintValid = OCLResultEnsurer.ensure(OCLExpressions.notEqual(OCLIntrospector.invoke(contextElement,"name"),OCLIntrospector.invoke(contextElement,"useCase.activityGraph.firstAction.actionClassName")));
1491 if (!constraintValid)
1492 {
1493 validationMessages.add(
1494 new ModelValidationMessage(
1495 (MetafacadeBase)contextElement ,
1496 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller name should not resemble the usecase name",
1497 "The name of this front-end controller resembles the name of the use-case it is associated with. You'll have to rename it in order to avoid naming collisions (generated files will overwrite eachother)."));
1498 }
1499 }
1500 catch (Throwable th)
1501 {
1502 Throwable cause = th.getCause();
1503 int depth = 0;
1504 while (cause != null && depth < 7)
1505 {
1506 th = cause;
1507 depth++;
1508 }
1509 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller name should not resemble the usecase name' ON "
1510 + this.THIS().toString() + ": " + th.getMessage(), th);
1511 }
1512 }
1513
1514
1515
1516
1517 private static final String NAME_PROPERTY = "name";
1518 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1519
1520
1521
1522
1523 @Override
1524 public String toString()
1525 {
1526 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1527 toString.append("[");
1528 try
1529 {
1530 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1531 }
1532 catch (final Throwable tryAgain)
1533 {
1534 try
1535 {
1536 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1537 }
1538 catch (final Throwable ignore)
1539 {
1540
1541 }
1542 }
1543 toString.append("]");
1544 return toString.toString();
1545 }
1546 }