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