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