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