1
2
3
4
5 package org.andromda.cartridges.meta.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.OCLIntrospector;
31 import org.andromda.translation.ocl.validation.OCLResultEnsurer;
32 import org.apache.commons.collections.Predicate;
33 import org.apache.log4j.Logger;
34
35
36
37
38
39
40
41
42 public abstract class MetafacadeLogic
43 extends MetafacadeBase
44 implements Metafacade
45 {
46
47
48
49
50 protected Object metaObject;
51
52
53
54
55
56 protected MetafacadeLogic(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(MetafacadeLogic.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.meta.metafacades.Metafacade";
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 isMetafacadeMetaType()
127 {
128 return true;
129 }
130
131
132
133
134
135
136
137 protected abstract String handleGetLogicName();
138
139 private String __logicName1a;
140 private boolean __logicName1aSet = false;
141
142
143
144
145
146 public final String getLogicName()
147 {
148 String logicName1a = this.__logicName1a;
149 if (!this.__logicName1aSet)
150 {
151
152 logicName1a = handleGetLogicName();
153
154 this.__logicName1a = logicName1a;
155 if (isMetafacadePropertyCachingEnabled())
156 {
157 this.__logicName1aSet = true;
158 }
159 }
160 return logicName1a;
161 }
162
163
164
165
166
167 protected abstract String handleGetLogicImplName();
168
169 private String __logicImplName2a;
170 private boolean __logicImplName2aSet = false;
171
172
173
174
175
176 public final String getLogicImplName()
177 {
178 String logicImplName2a = this.__logicImplName2a;
179 if (!this.__logicImplName2aSet)
180 {
181
182 logicImplName2a = handleGetLogicImplName();
183
184 this.__logicImplName2a = logicImplName2a;
185 if (isMetafacadePropertyCachingEnabled())
186 {
187 this.__logicImplName2aSet = true;
188 }
189 }
190 return logicImplName2a;
191 }
192
193
194
195
196
197 protected abstract boolean handleIsMetaclassDirectDependency();
198
199 private boolean __metaclassDirectDependency3a;
200 private boolean __metaclassDirectDependency3aSet = false;
201
202
203
204
205
206
207 public final boolean isMetaclassDirectDependency()
208 {
209 boolean metaclassDirectDependency3a = this.__metaclassDirectDependency3a;
210 if (!this.__metaclassDirectDependency3aSet)
211 {
212
213 metaclassDirectDependency3a = handleIsMetaclassDirectDependency();
214
215 this.__metaclassDirectDependency3a = metaclassDirectDependency3a;
216 if (isMetafacadePropertyCachingEnabled())
217 {
218 this.__metaclassDirectDependency3aSet = true;
219 }
220 }
221 return metaclassDirectDependency3a;
222 }
223
224
225
226
227
228 protected abstract String handleGetFullyQualifiedLogicImplName();
229
230 private String __fullyQualifiedLogicImplName4a;
231 private boolean __fullyQualifiedLogicImplName4aSet = false;
232
233
234
235
236
237 public final String getFullyQualifiedLogicImplName()
238 {
239 String fullyQualifiedLogicImplName4a = this.__fullyQualifiedLogicImplName4a;
240 if (!this.__fullyQualifiedLogicImplName4aSet)
241 {
242
243 fullyQualifiedLogicImplName4a = handleGetFullyQualifiedLogicImplName();
244
245 this.__fullyQualifiedLogicImplName4a = fullyQualifiedLogicImplName4a;
246 if (isMetafacadePropertyCachingEnabled())
247 {
248 this.__fullyQualifiedLogicImplName4aSet = true;
249 }
250 }
251 return fullyQualifiedLogicImplName4a;
252 }
253
254
255
256
257
258 protected abstract String handleGetFullyQualifiedLogicName();
259
260 private String __fullyQualifiedLogicName5a;
261 private boolean __fullyQualifiedLogicName5aSet = false;
262
263
264
265
266
267 public final String getFullyQualifiedLogicName()
268 {
269 String fullyQualifiedLogicName5a = this.__fullyQualifiedLogicName5a;
270 if (!this.__fullyQualifiedLogicName5aSet)
271 {
272
273 fullyQualifiedLogicName5a = handleGetFullyQualifiedLogicName();
274
275 this.__fullyQualifiedLogicName5a = fullyQualifiedLogicName5a;
276 if (isMetafacadePropertyCachingEnabled())
277 {
278 this.__fullyQualifiedLogicName5aSet = true;
279 }
280 }
281 return fullyQualifiedLogicName5a;
282 }
283
284
285
286
287
288 protected abstract String handleGetLogicFile();
289
290 private String __logicFile6a;
291 private boolean __logicFile6aSet = false;
292
293
294
295
296
297 public final String getLogicFile()
298 {
299 String logicFile6a = this.__logicFile6a;
300 if (!this.__logicFile6aSet)
301 {
302
303 logicFile6a = handleGetLogicFile();
304
305 this.__logicFile6a = logicFile6a;
306 if (isMetafacadePropertyCachingEnabled())
307 {
308 this.__logicFile6aSet = true;
309 }
310 }
311 return logicFile6a;
312 }
313
314
315
316
317
318 protected abstract String handleGetLogicImplFile();
319
320 private String __logicImplFile7a;
321 private boolean __logicImplFile7aSet = false;
322
323
324
325
326
327 public final String getLogicImplFile()
328 {
329 String logicImplFile7a = this.__logicImplFile7a;
330 if (!this.__logicImplFile7aSet)
331 {
332
333 logicImplFile7a = handleGetLogicImplFile();
334
335 this.__logicImplFile7a = logicImplFile7a;
336 if (isMetafacadePropertyCachingEnabled())
337 {
338 this.__logicImplFile7aSet = true;
339 }
340 }
341 return logicImplFile7a;
342 }
343
344
345
346
347
348 protected abstract String handleGetLogicPackageName();
349
350 private String __logicPackageName8a;
351 private boolean __logicPackageName8aSet = false;
352
353
354
355
356
357 public final String getLogicPackageName()
358 {
359 String logicPackageName8a = this.__logicPackageName8a;
360 if (!this.__logicPackageName8aSet)
361 {
362
363 logicPackageName8a = handleGetLogicPackageName();
364
365 this.__logicPackageName8a = logicPackageName8a;
366 if (isMetafacadePropertyCachingEnabled())
367 {
368 this.__logicPackageName8aSet = true;
369 }
370 }
371 return logicPackageName8a;
372 }
373
374
375
376
377
378 protected abstract boolean handleIsRequiresInheritanceDelegatation();
379
380 private boolean __requiresInheritanceDelegatation9a;
381 private boolean __requiresInheritanceDelegatation9aSet = false;
382
383
384
385
386
387
388
389
390 public final boolean isRequiresInheritanceDelegatation()
391 {
392 boolean requiresInheritanceDelegatation9a = this.__requiresInheritanceDelegatation9a;
393 if (!this.__requiresInheritanceDelegatation9aSet)
394 {
395
396 requiresInheritanceDelegatation9a = handleIsRequiresInheritanceDelegatation();
397
398 this.__requiresInheritanceDelegatation9a = requiresInheritanceDelegatation9a;
399 if (isMetafacadePropertyCachingEnabled())
400 {
401 this.__requiresInheritanceDelegatation9aSet = true;
402 }
403 }
404 return requiresInheritanceDelegatation9a;
405 }
406
407
408
409
410
411 protected abstract boolean handleIsConstructorRequiresMetaclassCast();
412
413 private boolean __constructorRequiresMetaclassCast10a;
414 private boolean __constructorRequiresMetaclassCast10aSet = false;
415
416
417
418
419
420
421 public final boolean isConstructorRequiresMetaclassCast()
422 {
423 boolean constructorRequiresMetaclassCast10a = this.__constructorRequiresMetaclassCast10a;
424 if (!this.__constructorRequiresMetaclassCast10aSet)
425 {
426
427 constructorRequiresMetaclassCast10a = handleIsConstructorRequiresMetaclassCast();
428
429 this.__constructorRequiresMetaclassCast10a = constructorRequiresMetaclassCast10a;
430 if (isMetafacadePropertyCachingEnabled())
431 {
432 this.__constructorRequiresMetaclassCast10aSet = true;
433 }
434 }
435 return constructorRequiresMetaclassCast10a;
436 }
437
438
439
440
441
442 protected abstract int handleGetGeneralizationCount();
443
444 private int __generalizationCount11a;
445 private boolean __generalizationCount11aSet = false;
446
447
448
449
450
451 public final int getGeneralizationCount()
452 {
453 int generalizationCount11a = this.__generalizationCount11a;
454 if (!this.__generalizationCount11aSet)
455 {
456
457 generalizationCount11a = handleGetGeneralizationCount();
458
459 this.__generalizationCount11a = generalizationCount11a;
460 if (isMetafacadePropertyCachingEnabled())
461 {
462 this.__generalizationCount11aSet = true;
463 }
464 }
465 return generalizationCount11a;
466 }
467
468
469
470
471
472
473
474
475
476
477 protected abstract Collection handleGetMethodDataForPSM(ClassifierFacade superMetafacade);
478
479
480
481
482
483
484
485
486 public Collection getMethodDataForPSM(ClassifierFacade superMetafacade)
487 {
488
489 Collection returnValue = handleGetMethodDataForPSM(superMetafacade);
490
491 return returnValue;
492 }
493
494
495
496
497
498
499 protected abstract Collection handleGetMethodDataForPSM();
500
501
502
503
504
505 public Collection getMethodDataForPSM()
506 {
507
508 Collection returnValue = handleGetMethodDataForPSM();
509
510 return returnValue;
511 }
512
513
514
515 private ClassifierFacade __getMetaclass1r;
516 private boolean __getMetaclass1rSet = false;
517
518
519
520
521
522
523 public final ClassifierFacade getMetaclass()
524 {
525 ClassifierFacade getMetaclass1r = this.__getMetaclass1r;
526 if (!this.__getMetaclass1rSet)
527 {
528
529 Object result = handleGetMetaclass();
530 MetafacadeBase shieldedResult = this.shieldedElement(result);
531 try
532 {
533 getMetaclass1r = (ClassifierFacade)shieldedResult;
534 }
535 catch (ClassCastException ex)
536 {
537
538 MetafacadeLogic.logger.warn("incorrect metafacade cast for MetafacadeLogic.getMetaclass ClassifierFacade " + result + ": " + shieldedResult);
539 }
540
541 this.__getMetaclass1r = getMetaclass1r;
542 if (isMetafacadePropertyCachingEnabled())
543 {
544 this.__getMetaclass1rSet = true;
545 }
546 }
547 return getMetaclass1r;
548 }
549
550
551
552
553
554 protected abstract Object handleGetMetaclass();
555
556
557
558
559
560
561 public final Collection<Metafacade> getAllParents()
562 {
563 Collection<Metafacade> getAllParents2r = null;
564
565 Collection result = handleGetAllParents();
566 List shieldedResult = this.shieldedElements(result);
567 try
568 {
569 getAllParents2r = (Collection<Metafacade>)shieldedResult;
570 }
571 catch (ClassCastException ex)
572 {
573
574 MetafacadeLogic.logger.warn("incorrect metafacade cast for MetafacadeLogic.getAllParents Collection<Metafacade> " + result + ": " + shieldedResult);
575 }
576
577 return getAllParents2r;
578 }
579
580
581
582
583
584 protected abstract Collection handleGetAllParents();
585
586
587
588
589
590 public boolean isClassifierFacadeMetaType()
591 {
592 return true;
593 }
594
595
596
597
598
599 public boolean isGeneralizableElementFacadeMetaType()
600 {
601 return true;
602 }
603
604
605
606
607
608 public boolean isModelElementFacadeMetaType()
609 {
610 return true;
611 }
612
613
614
615
616
617
618 public AttributeFacade findAttribute(String name)
619 {
620 return this.getSuperClassifierFacade().findAttribute(name);
621 }
622
623
624
625
626
627 public Collection<ClassifierFacade> getAbstractions()
628 {
629 return this.getSuperClassifierFacade().getAbstractions();
630 }
631
632
633
634
635
636
637 public Collection<ClassifierFacade> getAllAssociatedClasses()
638 {
639 return this.getSuperClassifierFacade().getAllAssociatedClasses();
640 }
641
642
643
644
645
646
647 public Collection<ModelElementFacade> getAllProperties()
648 {
649 return this.getSuperClassifierFacade().getAllProperties();
650 }
651
652
653
654
655
656
657 public Collection<ModelElementFacade> getAllRequiredConstructorParameters()
658 {
659 return this.getSuperClassifierFacade().getAllRequiredConstructorParameters();
660 }
661
662
663
664
665
666
667 public ClassifierFacade getArray()
668 {
669 return this.getSuperClassifierFacade().getArray();
670 }
671
672
673
674
675
676 public String getArrayName()
677 {
678 return this.getSuperClassifierFacade().getArrayName();
679 }
680
681
682
683
684
685
686 public Collection<ClassifierFacade> getAssociatedClasses()
687 {
688 return this.getSuperClassifierFacade().getAssociatedClasses();
689 }
690
691
692
693
694
695 public List<AssociationEndFacade> getAssociationEnds()
696 {
697 return this.getSuperClassifierFacade().getAssociationEnds();
698 }
699
700
701
702
703
704 public List<AttributeFacade> getAttributes()
705 {
706 return this.getSuperClassifierFacade().getAttributes();
707 }
708
709
710
711
712
713
714 public List<AttributeFacade> getAttributes(boolean follow)
715 {
716 return this.getSuperClassifierFacade().getAttributes(follow);
717 }
718
719
720
721
722
723 public String getFullyQualifiedArrayName()
724 {
725 return this.getSuperClassifierFacade().getFullyQualifiedArrayName();
726 }
727
728
729
730
731
732
733
734
735 public Collection<OperationFacade> getImplementationOperations()
736 {
737 return this.getSuperClassifierFacade().getImplementationOperations();
738 }
739
740
741
742
743
744 public String getImplementedInterfaceList()
745 {
746 return this.getSuperClassifierFacade().getImplementedInterfaceList();
747 }
748
749
750
751
752
753 public Collection<AttributeFacade> getInstanceAttributes()
754 {
755 return this.getSuperClassifierFacade().getInstanceAttributes();
756 }
757
758
759
760
761
762 public List<OperationFacade> getInstanceOperations()
763 {
764 return this.getSuperClassifierFacade().getInstanceOperations();
765 }
766
767
768
769
770
771
772 public Collection<ClassifierFacade> getInterfaceAbstractions()
773 {
774 return this.getSuperClassifierFacade().getInterfaceAbstractions();
775 }
776
777
778
779
780
781
782 public String getJavaNewString()
783 {
784 return this.getSuperClassifierFacade().getJavaNewString();
785 }
786
787
788
789
790
791
792 public String getJavaNullString()
793 {
794 return this.getSuperClassifierFacade().getJavaNullString();
795 }
796
797
798
799
800
801 public Collection<AssociationEndFacade> getNavigableConnectingEnds()
802 {
803 return this.getSuperClassifierFacade().getNavigableConnectingEnds();
804 }
805
806
807
808
809
810
811 public List<AssociationEndFacade> getNavigableConnectingEnds(boolean follow)
812 {
813 return this.getSuperClassifierFacade().getNavigableConnectingEnds(follow);
814 }
815
816
817
818
819
820
821
822 public ClassifierFacade getNonArray()
823 {
824 return this.getSuperClassifierFacade().getNonArray();
825 }
826
827
828
829
830
831
832
833 public String getOperationCallFromAttributes()
834 {
835 return this.getSuperClassifierFacade().getOperationCallFromAttributes();
836 }
837
838
839
840
841
842 public List<OperationFacade> getOperations()
843 {
844 return this.getSuperClassifierFacade().getOperations();
845 }
846
847
848
849
850
851
852 public List<ModelElementFacade> getProperties()
853 {
854 return this.getSuperClassifierFacade().getProperties();
855 }
856
857
858
859
860
861
862
863 public List getProperties(boolean follow)
864 {
865 return this.getSuperClassifierFacade().getProperties(follow);
866 }
867
868
869
870
871
872
873 public Collection<ModelElementFacade> getRequiredConstructorParameters()
874 {
875 return this.getSuperClassifierFacade().getRequiredConstructorParameters();
876 }
877
878
879
880
881
882 public long getSerialVersionUID()
883 {
884 return this.getSuperClassifierFacade().getSerialVersionUID();
885 }
886
887
888
889
890
891 public Collection<AttributeFacade> getStaticAttributes()
892 {
893 return this.getSuperClassifierFacade().getStaticAttributes();
894 }
895
896
897
898
899
900 public List<OperationFacade> getStaticOperations()
901 {
902 return this.getSuperClassifierFacade().getStaticOperations();
903 }
904
905
906
907
908
909
910 public ClassifierFacade getSuperClass()
911 {
912 return this.getSuperClassifierFacade().getSuperClass();
913 }
914
915
916
917
918
919
920
921
922
923 public String getWrapperName()
924 {
925 return this.getSuperClassifierFacade().getWrapperName();
926 }
927
928
929
930
931
932 public boolean isAbstract()
933 {
934 return this.getSuperClassifierFacade().isAbstract();
935 }
936
937
938
939
940
941 public boolean isArrayType()
942 {
943 return this.getSuperClassifierFacade().isArrayType();
944 }
945
946
947
948
949
950 public boolean isAssociationClass()
951 {
952 return this.getSuperClassifierFacade().isAssociationClass();
953 }
954
955
956
957
958
959 public boolean isBlobType()
960 {
961 return this.getSuperClassifierFacade().isBlobType();
962 }
963
964
965
966
967
968 public boolean isBooleanType()
969 {
970 return this.getSuperClassifierFacade().isBooleanType();
971 }
972
973
974
975
976
977 public boolean isCharacterType()
978 {
979 return this.getSuperClassifierFacade().isCharacterType();
980 }
981
982
983
984
985
986 public boolean isClobType()
987 {
988 return this.getSuperClassifierFacade().isClobType();
989 }
990
991
992
993
994
995 public boolean isCollectionType()
996 {
997 return this.getSuperClassifierFacade().isCollectionType();
998 }
999
1000
1001
1002
1003
1004
1005
1006 public boolean isDataType()
1007 {
1008 return this.getSuperClassifierFacade().isDataType();
1009 }
1010
1011
1012
1013
1014
1015 public boolean isDateType()
1016 {
1017 return this.getSuperClassifierFacade().isDateType();
1018 }
1019
1020
1021
1022
1023
1024 public boolean isDoubleType()
1025 {
1026 return this.getSuperClassifierFacade().isDoubleType();
1027 }
1028
1029
1030
1031
1032
1033 public boolean isEmbeddedValue()
1034 {
1035 return this.getSuperClassifierFacade().isEmbeddedValue();
1036 }
1037
1038
1039
1040
1041
1042 public boolean isEnumeration()
1043 {
1044 return this.getSuperClassifierFacade().isEnumeration();
1045 }
1046
1047
1048
1049
1050
1051 public boolean isFileType()
1052 {
1053 return this.getSuperClassifierFacade().isFileType();
1054 }
1055
1056
1057
1058
1059
1060 public boolean isFloatType()
1061 {
1062 return this.getSuperClassifierFacade().isFloatType();
1063 }
1064
1065
1066
1067
1068
1069 public boolean isIntegerType()
1070 {
1071 return this.getSuperClassifierFacade().isIntegerType();
1072 }
1073
1074
1075
1076
1077
1078 public boolean isInterface()
1079 {
1080 return this.getSuperClassifierFacade().isInterface();
1081 }
1082
1083
1084
1085
1086
1087 public boolean isLeaf()
1088 {
1089 return this.getSuperClassifierFacade().isLeaf();
1090 }
1091
1092
1093
1094
1095
1096 public boolean isListType()
1097 {
1098 return this.getSuperClassifierFacade().isListType();
1099 }
1100
1101
1102
1103
1104
1105 public boolean isLongType()
1106 {
1107 return this.getSuperClassifierFacade().isLongType();
1108 }
1109
1110
1111
1112
1113
1114 public boolean isMapType()
1115 {
1116 return this.getSuperClassifierFacade().isMapType();
1117 }
1118
1119
1120
1121
1122
1123 public boolean isPrimitive()
1124 {
1125 return this.getSuperClassifierFacade().isPrimitive();
1126 }
1127
1128
1129
1130
1131
1132 public boolean isSetType()
1133 {
1134 return this.getSuperClassifierFacade().isSetType();
1135 }
1136
1137
1138
1139
1140
1141 public boolean isStringType()
1142 {
1143 return this.getSuperClassifierFacade().isStringType();
1144 }
1145
1146
1147
1148
1149
1150 public boolean isTimeType()
1151 {
1152 return this.getSuperClassifierFacade().isTimeType();
1153 }
1154
1155
1156
1157
1158
1159 public boolean isWrappedPrimitive()
1160 {
1161 return this.getSuperClassifierFacade().isWrappedPrimitive();
1162 }
1163
1164
1165
1166
1167
1168
1169 public Object findTaggedValue(String tagName, boolean follow)
1170 {
1171 return this.getSuperClassifierFacade().findTaggedValue(tagName, follow);
1172 }
1173
1174
1175
1176
1177
1178 public Collection<GeneralizableElementFacade> getAllGeneralizations()
1179 {
1180 return this.getSuperClassifierFacade().getAllGeneralizations();
1181 }
1182
1183
1184
1185
1186
1187 public Collection<GeneralizableElementFacade> getAllSpecializations()
1188 {
1189 return this.getSuperClassifierFacade().getAllSpecializations();
1190 }
1191
1192
1193
1194
1195
1196 public GeneralizableElementFacade getGeneralization()
1197 {
1198 return this.getSuperClassifierFacade().getGeneralization();
1199 }
1200
1201
1202
1203
1204
1205
1206 public Collection<GeneralizationFacade> getGeneralizationLinks()
1207 {
1208 return this.getSuperClassifierFacade().getGeneralizationLinks();
1209 }
1210
1211
1212
1213
1214
1215 public String getGeneralizationList()
1216 {
1217 return this.getSuperClassifierFacade().getGeneralizationList();
1218 }
1219
1220
1221
1222
1223
1224
1225 public GeneralizableElementFacade getGeneralizationRoot()
1226 {
1227 return this.getSuperClassifierFacade().getGeneralizationRoot();
1228 }
1229
1230
1231
1232
1233
1234 public Collection<GeneralizableElementFacade> getGeneralizations()
1235 {
1236 return this.getSuperClassifierFacade().getGeneralizations();
1237 }
1238
1239
1240
1241
1242
1243 public Collection<GeneralizableElementFacade> getSpecializations()
1244 {
1245 return this.getSuperClassifierFacade().getSpecializations();
1246 }
1247
1248
1249
1250
1251
1252 public void copyTaggedValues(ModelElementFacade element)
1253 {
1254 this.getSuperClassifierFacade().copyTaggedValues(element);
1255 }
1256
1257
1258
1259
1260
1261
1262 public Object findTaggedValue(String tagName)
1263 {
1264 return this.getSuperClassifierFacade().findTaggedValue(tagName);
1265 }
1266
1267
1268
1269
1270
1271
1272 public Collection<Object> findTaggedValues(String tagName)
1273 {
1274 return this.getSuperClassifierFacade().findTaggedValues(tagName);
1275 }
1276
1277
1278
1279
1280
1281
1282
1283 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1284 {
1285 return this.getSuperClassifierFacade().getBindedFullyQualifiedName(bindedElement);
1286 }
1287
1288
1289
1290
1291
1292 public Collection<ConstraintFacade> getConstraints()
1293 {
1294 return this.getSuperClassifierFacade().getConstraints();
1295 }
1296
1297
1298
1299
1300
1301
1302 public Collection<ConstraintFacade> getConstraints(String kind)
1303 {
1304 return this.getSuperClassifierFacade().getConstraints(kind);
1305 }
1306
1307
1308
1309
1310
1311
1312
1313 public String getDocumentation(String indent)
1314 {
1315 return this.getSuperClassifierFacade().getDocumentation(indent);
1316 }
1317
1318
1319
1320
1321
1322
1323
1324
1325 public String getDocumentation(String indent, int lineLength)
1326 {
1327 return this.getSuperClassifierFacade().getDocumentation(indent, lineLength);
1328 }
1329
1330
1331
1332
1333
1334
1335
1336 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
1337 {
1338 return this.getSuperClassifierFacade().getDocumentation(indent, lineLength, htmlStyle);
1339 }
1340
1341
1342
1343
1344
1345 public String getFullyQualifiedName()
1346 {
1347 return this.getSuperClassifierFacade().getFullyQualifiedName();
1348 }
1349
1350
1351
1352
1353
1354
1355
1356
1357 public String getFullyQualifiedName(boolean modelName)
1358 {
1359 return this.getSuperClassifierFacade().getFullyQualifiedName(modelName);
1360 }
1361
1362
1363
1364
1365
1366
1367 public String getFullyQualifiedNamePath()
1368 {
1369 return this.getSuperClassifierFacade().getFullyQualifiedNamePath();
1370 }
1371
1372
1373
1374
1375
1376 public String getId()
1377 {
1378 return this.getSuperClassifierFacade().getId();
1379 }
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389 public Collection<String> getKeywords()
1390 {
1391 return this.getSuperClassifierFacade().getKeywords();
1392 }
1393
1394
1395
1396
1397
1398 public String getLabel()
1399 {
1400 return this.getSuperClassifierFacade().getLabel();
1401 }
1402
1403
1404
1405
1406
1407 public TypeMappings getLanguageMappings()
1408 {
1409 return this.getSuperClassifierFacade().getLanguageMappings();
1410 }
1411
1412
1413
1414
1415
1416
1417 public ModelFacade getModel()
1418 {
1419 return this.getSuperClassifierFacade().getModel();
1420 }
1421
1422
1423
1424
1425
1426 public String getName()
1427 {
1428 return this.getSuperClassifierFacade().getName();
1429 }
1430
1431
1432
1433
1434
1435 public ModelElementFacade getPackage()
1436 {
1437 return this.getSuperClassifierFacade().getPackage();
1438 }
1439
1440
1441
1442
1443
1444 public String getPackageName()
1445 {
1446 return this.getSuperClassifierFacade().getPackageName();
1447 }
1448
1449
1450
1451
1452
1453
1454 public String getPackageName(boolean modelName)
1455 {
1456 return this.getSuperClassifierFacade().getPackageName(modelName);
1457 }
1458
1459
1460
1461
1462
1463 public String getPackagePath()
1464 {
1465 return this.getSuperClassifierFacade().getPackagePath();
1466 }
1467
1468
1469
1470
1471
1472
1473
1474
1475 public String getQualifiedName()
1476 {
1477 return this.getSuperClassifierFacade().getQualifiedName();
1478 }
1479
1480
1481
1482
1483
1484 public PackageFacade getRootPackage()
1485 {
1486 return this.getSuperClassifierFacade().getRootPackage();
1487 }
1488
1489
1490
1491
1492
1493 public Collection<DependencyFacade> getSourceDependencies()
1494 {
1495 return this.getSuperClassifierFacade().getSourceDependencies();
1496 }
1497
1498
1499
1500
1501
1502
1503 public StateMachineFacade getStateMachineContext()
1504 {
1505 return this.getSuperClassifierFacade().getStateMachineContext();
1506 }
1507
1508
1509
1510
1511
1512 public Collection<String> getStereotypeNames()
1513 {
1514 return this.getSuperClassifierFacade().getStereotypeNames();
1515 }
1516
1517
1518
1519
1520
1521 public Collection<StereotypeFacade> getStereotypes()
1522 {
1523 return this.getSuperClassifierFacade().getStereotypes();
1524 }
1525
1526
1527
1528
1529
1530 public Collection<TaggedValueFacade> getTaggedValues()
1531 {
1532 return this.getSuperClassifierFacade().getTaggedValues();
1533 }
1534
1535
1536
1537
1538
1539 public Collection<DependencyFacade> getTargetDependencies()
1540 {
1541 return this.getSuperClassifierFacade().getTargetDependencies();
1542 }
1543
1544
1545
1546
1547
1548 public Object getTemplateParameter(String parameterName)
1549 {
1550 return this.getSuperClassifierFacade().getTemplateParameter(parameterName);
1551 }
1552
1553
1554
1555
1556
1557 public Collection<TemplateParameterFacade> getTemplateParameters()
1558 {
1559 return this.getSuperClassifierFacade().getTemplateParameters();
1560 }
1561
1562
1563
1564
1565
1566
1567 public String getVisibility()
1568 {
1569 return this.getSuperClassifierFacade().getVisibility();
1570 }
1571
1572
1573
1574
1575
1576
1577 public boolean hasExactStereotype(String stereotypeName)
1578 {
1579 return this.getSuperClassifierFacade().hasExactStereotype(stereotypeName);
1580 }
1581
1582
1583
1584
1585
1586
1587 public boolean hasKeyword(String keywordName)
1588 {
1589 return this.getSuperClassifierFacade().hasKeyword(keywordName);
1590 }
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604 public boolean hasStereotype(String stereotypeName)
1605 {
1606 return this.getSuperClassifierFacade().hasStereotype(stereotypeName);
1607 }
1608
1609
1610
1611
1612
1613
1614 public boolean isBindingDependenciesPresent()
1615 {
1616 return this.getSuperClassifierFacade().isBindingDependenciesPresent();
1617 }
1618
1619
1620
1621
1622
1623 public boolean isConstraintsPresent()
1624 {
1625 return this.getSuperClassifierFacade().isConstraintsPresent();
1626 }
1627
1628
1629
1630
1631
1632 public boolean isDocumentationPresent()
1633 {
1634 return this.getSuperClassifierFacade().isDocumentationPresent();
1635 }
1636
1637
1638
1639
1640
1641 public boolean isReservedWord()
1642 {
1643 return this.getSuperClassifierFacade().isReservedWord();
1644 }
1645
1646
1647
1648
1649
1650
1651 public boolean isTemplateParametersPresent()
1652 {
1653 return this.getSuperClassifierFacade().isTemplateParametersPresent();
1654 }
1655
1656
1657
1658
1659
1660
1661
1662 public boolean isValidIdentifierName()
1663 {
1664 return this.getSuperClassifierFacade().isValidIdentifierName();
1665 }
1666
1667
1668
1669
1670
1671
1672
1673 public String translateConstraint(String name, String translation)
1674 {
1675 return this.getSuperClassifierFacade().translateConstraint(name, translation);
1676 }
1677
1678
1679
1680
1681
1682 public String[] translateConstraints(String translation)
1683 {
1684 return this.getSuperClassifierFacade().translateConstraints(translation);
1685 }
1686
1687
1688
1689
1690
1691 public String[] translateConstraints(String kind, String translation)
1692 {
1693 return this.getSuperClassifierFacade().translateConstraints(kind, translation);
1694 }
1695
1696
1697
1698
1699 @Override
1700 public void initialize()
1701 {
1702 this.getSuperClassifierFacade().initialize();
1703 }
1704
1705
1706
1707
1708
1709 @Override
1710 public Object getValidationOwner()
1711 {
1712 Object owner = this.getSuperClassifierFacade().getValidationOwner();
1713 return owner;
1714 }
1715
1716
1717
1718
1719
1720 @Override
1721 public String getValidationName()
1722 {
1723 String name = this.getSuperClassifierFacade().getValidationName();
1724 return name;
1725 }
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743 @Override
1744 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1745 {
1746 this.getSuperClassifierFacade().validateInvariants(validationMessages);
1747 try
1748 {
1749 final Object contextElement = this.THIS();
1750 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"generalization")))).booleanValue()?OCLIntrospector.invoke(contextElement,"generalization") instanceof Metafacade:true));
1751 if (!constraintValid)
1752 {
1753 validationMessages.add(
1754 new ModelValidationMessage(
1755 (MetafacadeBase)contextElement ,
1756 "org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only generalize another metafacade",
1757 "A metafacade can only generalize another metafacade."));
1758 }
1759 }
1760 catch (Throwable th)
1761 {
1762 Throwable cause = th.getCause();
1763 int depth = 0;
1764 while (cause != null && depth < 7)
1765 {
1766 th = cause;
1767 depth++;
1768 }
1769 logger.error("Error validating constraint 'org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only generalize another metafacade' ON "
1770 + this.THIS().toString() + ": " + th.getMessage(), th);
1771 }
1772 try
1773 {
1774 final Object contextElement = this.THIS();
1775 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"specializations")))).booleanValue()?OCLCollections.forAll(OCLIntrospector.invoke(contextElement,"specializations"),new Predicate(){public boolean evaluate(Object object){return Boolean.valueOf(String.valueOf(object instanceof Metafacade)).booleanValue();}}):true));
1776 if (!constraintValid)
1777 {
1778 validationMessages.add(
1779 new ModelValidationMessage(
1780 (MetafacadeBase)contextElement ,
1781 "org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only specialize another metafacade",
1782 "A metafacade can only specialize another metafacade."));
1783 }
1784 }
1785 catch (Throwable th)
1786 {
1787 Throwable cause = th.getCause();
1788 int depth = 0;
1789 while (cause != null && depth < 7)
1790 {
1791 th = cause;
1792 depth++;
1793 }
1794 logger.error("Error validating constraint 'org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only specialize another metafacade' ON "
1795 + this.THIS().toString() + ": " + th.getMessage(), th);
1796 }
1797 try
1798 {
1799 final Object contextElement = this.THIS();
1800 boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"generalizations"))||OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"sourceDependencies")));
1801 if (!constraintValid)
1802 {
1803 validationMessages.add(
1804 new ModelValidationMessage(
1805 (MetafacadeBase)contextElement ,
1806 "org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade must either extend an existing metafacade or have a direct dependency to a metaclass",
1807 "A metafacade must at the least, either extend an existing metafacade or have a direct dependency to a metaclass."));
1808 }
1809 }
1810 catch (Throwable th)
1811 {
1812 Throwable cause = th.getCause();
1813 int depth = 0;
1814 while (cause != null && depth < 7)
1815 {
1816 th = cause;
1817 depth++;
1818 }
1819 logger.error("Error validating constraint 'org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade must either extend an existing metafacade or have a direct dependency to a metaclass' ON "
1820 + this.THIS().toString() + ": " + th.getMessage(), th);
1821 }
1822 }
1823
1824
1825
1826
1827 private static final String NAME_PROPERTY = "name";
1828 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1829
1830
1831
1832
1833 @Override
1834 public String toString()
1835 {
1836 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1837 toString.append("[");
1838 try
1839 {
1840 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1841 }
1842 catch (final Throwable tryAgain)
1843 {
1844 try
1845 {
1846 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1847 }
1848 catch (final Throwable ignore)
1849 {
1850
1851 }
1852 }
1853 toString.append("]");
1854 return toString.toString();
1855 }
1856 }