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