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