1
2
3
4
5 package org.andromda.cartridges.meta.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.AssociationEndFacade;
13 import org.andromda.metafacades.uml.AssociationFacade;
14 import org.andromda.metafacades.uml.ClassifierFacade;
15 import org.andromda.metafacades.uml.ConstraintFacade;
16 import org.andromda.metafacades.uml.DependencyFacade;
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 MetafacadeAssociationEndLogic
33 extends MetafacadeBase
34 implements MetafacadeAssociationEnd
35 {
36
37
38
39
40 protected Object metaObject;
41
42
43
44
45
46 protected MetafacadeAssociationEndLogic(Object metaObjectIn, String context)
47 {
48 super(metaObjectIn, getContext(context));
49 this.superAssociationEndFacade =
50 (AssociationEndFacade)
51 MetafacadeFactory.getInstance().createFacadeImpl(
52 "org.andromda.metafacades.uml.AssociationEndFacade",
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.meta.metafacades.MetafacadeAssociationEnd";
68 }
69 return context;
70 }
71
72 private AssociationEndFacade superAssociationEndFacade;
73 private boolean superAssociationEndFacadeInitialized = false;
74
75
76
77
78
79 private AssociationEndFacade getSuperAssociationEndFacade()
80 {
81 if (!this.superAssociationEndFacadeInitialized)
82 {
83 ((MetafacadeBase)this.superAssociationEndFacade).setMetafacadeContext(this.getMetafacadeContext());
84 this.superAssociationEndFacadeInitialized = true;
85 }
86 return this.superAssociationEndFacade;
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.superAssociationEndFacadeInitialized)
101 {
102 ((MetafacadeBase)this.superAssociationEndFacade).resetMetafacadeContext(context);
103 }
104 }
105 }
106
107
108
109
110
111 public boolean isMetafacadeAssociationEndMetaType()
112 {
113 return true;
114 }
115
116
117
118
119
120
121
122 protected abstract String handleGetImplementationOperationName();
123
124 private String __implementationOperationName1a;
125 private boolean __implementationOperationName1aSet = false;
126
127
128
129
130
131
132 public final String getImplementationOperationName()
133 {
134 String implementationOperationName1a = this.__implementationOperationName1a;
135 if (!this.__implementationOperationName1aSet)
136 {
137
138 implementationOperationName1a = handleGetImplementationOperationName();
139
140 this.__implementationOperationName1a = implementationOperationName1a;
141 if (isMetafacadePropertyCachingEnabled())
142 {
143 this.__implementationOperationName1aSet = true;
144 }
145 }
146 return implementationOperationName1a;
147 }
148
149
150
151
152
153 public boolean isAssociationEndFacadeMetaType()
154 {
155 return true;
156 }
157
158
159
160
161
162 public boolean isModelElementFacadeMetaType()
163 {
164 return true;
165 }
166
167
168
169
170
171
172 public String getAdderName()
173 {
174 return this.getSuperAssociationEndFacade().getAdderName();
175 }
176
177
178
179
180
181
182
183 public String getAggregationKind()
184 {
185 return this.getSuperAssociationEndFacade().getAggregationKind();
186 }
187
188
189
190
191
192 public AssociationFacade getAssociation()
193 {
194 return this.getSuperAssociationEndFacade().getAssociation();
195 }
196
197
198
199
200
201
202
203
204 public String getDefault()
205 {
206 return this.getSuperAssociationEndFacade().getDefault();
207 }
208
209
210
211
212
213 public String getGetterName()
214 {
215 return this.getSuperAssociationEndFacade().getGetterName();
216 }
217
218
219
220
221
222
223 public String getGetterSetterTypeName()
224 {
225 return this.getSuperAssociationEndFacade().getGetterSetterTypeName();
226 }
227
228
229
230
231
232
233 public int getLower()
234 {
235 return this.getSuperAssociationEndFacade().getLower();
236 }
237
238
239
240
241
242 public AssociationEndFacade getOtherEnd()
243 {
244 return this.getSuperAssociationEndFacade().getOtherEnd();
245 }
246
247
248
249
250
251 public String getRemoverName()
252 {
253 return this.getSuperAssociationEndFacade().getRemoverName();
254 }
255
256
257
258
259
260 public String getSetterName()
261 {
262 return this.getSuperAssociationEndFacade().getSetterName();
263 }
264
265
266
267
268
269 public ClassifierFacade getType()
270 {
271 return this.getSuperAssociationEndFacade().getType();
272 }
273
274
275
276
277
278
279 public int getUpper()
280 {
281 return this.getSuperAssociationEndFacade().getUpper();
282 }
283
284
285
286
287
288 public boolean isAggregation()
289 {
290 return this.getSuperAssociationEndFacade().isAggregation();
291 }
292
293
294
295
296
297
298 public boolean isBidirectional()
299 {
300 return this.getSuperAssociationEndFacade().isBidirectional();
301 }
302
303
304
305
306
307
308 public boolean isChild()
309 {
310 return this.getSuperAssociationEndFacade().isChild();
311 }
312
313
314
315
316
317 public boolean isComposition()
318 {
319 return this.getSuperAssociationEndFacade().isComposition();
320 }
321
322
323
324
325
326
327 public boolean isDerived()
328 {
329 return this.getSuperAssociationEndFacade().isDerived();
330 }
331
332
333
334
335
336
337 public boolean isLeaf()
338 {
339 return this.getSuperAssociationEndFacade().isLeaf();
340 }
341
342
343
344
345
346 public boolean isMany()
347 {
348 return this.getSuperAssociationEndFacade().isMany();
349 }
350
351
352
353
354
355 public boolean isMany2Many()
356 {
357 return this.getSuperAssociationEndFacade().isMany2Many();
358 }
359
360
361
362
363
364 public boolean isMany2One()
365 {
366 return this.getSuperAssociationEndFacade().isMany2One();
367 }
368
369
370
371
372
373 public boolean isNavigable()
374 {
375 return this.getSuperAssociationEndFacade().isNavigable();
376 }
377
378
379
380
381
382 public boolean isOne2Many()
383 {
384 return this.getSuperAssociationEndFacade().isOne2Many();
385 }
386
387
388
389
390
391 public boolean isOne2One()
392 {
393 return this.getSuperAssociationEndFacade().isOne2One();
394 }
395
396
397
398
399
400
401 public boolean isOrdered()
402 {
403 return this.getSuperAssociationEndFacade().isOrdered();
404 }
405
406
407
408
409
410 public boolean isReadOnly()
411 {
412 return this.getSuperAssociationEndFacade().isReadOnly();
413 }
414
415
416
417
418
419 public boolean isRequired()
420 {
421 return this.getSuperAssociationEndFacade().isRequired();
422 }
423
424
425
426
427
428 public boolean isStatic()
429 {
430 return this.getSuperAssociationEndFacade().isStatic();
431 }
432
433
434
435
436
437
438 public boolean isUnique()
439 {
440 return this.getSuperAssociationEndFacade().isUnique();
441 }
442
443
444
445
446
447 public void copyTaggedValues(ModelElementFacade element)
448 {
449 this.getSuperAssociationEndFacade().copyTaggedValues(element);
450 }
451
452
453
454
455
456
457 public Object findTaggedValue(String tagName)
458 {
459 return this.getSuperAssociationEndFacade().findTaggedValue(tagName);
460 }
461
462
463
464
465
466
467 public Collection<Object> findTaggedValues(String tagName)
468 {
469 return this.getSuperAssociationEndFacade().findTaggedValues(tagName);
470 }
471
472
473
474
475
476
477
478 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
479 {
480 return this.getSuperAssociationEndFacade().getBindedFullyQualifiedName(bindedElement);
481 }
482
483
484
485
486
487 public Collection<ConstraintFacade> getConstraints()
488 {
489 return this.getSuperAssociationEndFacade().getConstraints();
490 }
491
492
493
494
495
496
497 public Collection<ConstraintFacade> getConstraints(String kind)
498 {
499 return this.getSuperAssociationEndFacade().getConstraints(kind);
500 }
501
502
503
504
505
506
507
508 public String getDocumentation(String indent)
509 {
510 return this.getSuperAssociationEndFacade().getDocumentation(indent);
511 }
512
513
514
515
516
517
518
519
520 public String getDocumentation(String indent, int lineLength)
521 {
522 return this.getSuperAssociationEndFacade().getDocumentation(indent, lineLength);
523 }
524
525
526
527
528
529
530
531 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
532 {
533 return this.getSuperAssociationEndFacade().getDocumentation(indent, lineLength, htmlStyle);
534 }
535
536
537
538
539
540 public String getFullyQualifiedName()
541 {
542 return this.getSuperAssociationEndFacade().getFullyQualifiedName();
543 }
544
545
546
547
548
549
550
551
552 public String getFullyQualifiedName(boolean modelName)
553 {
554 return this.getSuperAssociationEndFacade().getFullyQualifiedName(modelName);
555 }
556
557
558
559
560
561
562 public String getFullyQualifiedNamePath()
563 {
564 return this.getSuperAssociationEndFacade().getFullyQualifiedNamePath();
565 }
566
567
568
569
570
571 public String getId()
572 {
573 return this.getSuperAssociationEndFacade().getId();
574 }
575
576
577
578
579
580
581
582
583
584 public Collection<String> getKeywords()
585 {
586 return this.getSuperAssociationEndFacade().getKeywords();
587 }
588
589
590
591
592
593 public String getLabel()
594 {
595 return this.getSuperAssociationEndFacade().getLabel();
596 }
597
598
599
600
601
602 public TypeMappings getLanguageMappings()
603 {
604 return this.getSuperAssociationEndFacade().getLanguageMappings();
605 }
606
607
608
609
610
611
612 public ModelFacade getModel()
613 {
614 return this.getSuperAssociationEndFacade().getModel();
615 }
616
617
618
619
620
621 public String getName()
622 {
623 return this.getSuperAssociationEndFacade().getName();
624 }
625
626
627
628
629
630 public ModelElementFacade getPackage()
631 {
632 return this.getSuperAssociationEndFacade().getPackage();
633 }
634
635
636
637
638
639 public String getPackageName()
640 {
641 return this.getSuperAssociationEndFacade().getPackageName();
642 }
643
644
645
646
647
648
649 public String getPackageName(boolean modelName)
650 {
651 return this.getSuperAssociationEndFacade().getPackageName(modelName);
652 }
653
654
655
656
657
658 public String getPackagePath()
659 {
660 return this.getSuperAssociationEndFacade().getPackagePath();
661 }
662
663
664
665
666
667
668
669
670 public String getQualifiedName()
671 {
672 return this.getSuperAssociationEndFacade().getQualifiedName();
673 }
674
675
676
677
678
679 public PackageFacade getRootPackage()
680 {
681 return this.getSuperAssociationEndFacade().getRootPackage();
682 }
683
684
685
686
687
688 public Collection<DependencyFacade> getSourceDependencies()
689 {
690 return this.getSuperAssociationEndFacade().getSourceDependencies();
691 }
692
693
694
695
696
697
698 public StateMachineFacade getStateMachineContext()
699 {
700 return this.getSuperAssociationEndFacade().getStateMachineContext();
701 }
702
703
704
705
706
707 public Collection<String> getStereotypeNames()
708 {
709 return this.getSuperAssociationEndFacade().getStereotypeNames();
710 }
711
712
713
714
715
716 public Collection<StereotypeFacade> getStereotypes()
717 {
718 return this.getSuperAssociationEndFacade().getStereotypes();
719 }
720
721
722
723
724
725 public Collection<TaggedValueFacade> getTaggedValues()
726 {
727 return this.getSuperAssociationEndFacade().getTaggedValues();
728 }
729
730
731
732
733
734 public Collection<DependencyFacade> getTargetDependencies()
735 {
736 return this.getSuperAssociationEndFacade().getTargetDependencies();
737 }
738
739
740
741
742
743 public Object getTemplateParameter(String parameterName)
744 {
745 return this.getSuperAssociationEndFacade().getTemplateParameter(parameterName);
746 }
747
748
749
750
751
752 public Collection<TemplateParameterFacade> getTemplateParameters()
753 {
754 return this.getSuperAssociationEndFacade().getTemplateParameters();
755 }
756
757
758
759
760
761
762 public String getVisibility()
763 {
764 return this.getSuperAssociationEndFacade().getVisibility();
765 }
766
767
768
769
770
771
772 public boolean hasExactStereotype(String stereotypeName)
773 {
774 return this.getSuperAssociationEndFacade().hasExactStereotype(stereotypeName);
775 }
776
777
778
779
780
781
782 public boolean hasKeyword(String keywordName)
783 {
784 return this.getSuperAssociationEndFacade().hasKeyword(keywordName);
785 }
786
787
788
789
790
791
792
793
794
795
796
797
798
799 public boolean hasStereotype(String stereotypeName)
800 {
801 return this.getSuperAssociationEndFacade().hasStereotype(stereotypeName);
802 }
803
804
805
806
807
808
809 public boolean isBindingDependenciesPresent()
810 {
811 return this.getSuperAssociationEndFacade().isBindingDependenciesPresent();
812 }
813
814
815
816
817
818 public boolean isConstraintsPresent()
819 {
820 return this.getSuperAssociationEndFacade().isConstraintsPresent();
821 }
822
823
824
825
826
827 public boolean isDocumentationPresent()
828 {
829 return this.getSuperAssociationEndFacade().isDocumentationPresent();
830 }
831
832
833
834
835
836 public boolean isReservedWord()
837 {
838 return this.getSuperAssociationEndFacade().isReservedWord();
839 }
840
841
842
843
844
845
846 public boolean isTemplateParametersPresent()
847 {
848 return this.getSuperAssociationEndFacade().isTemplateParametersPresent();
849 }
850
851
852
853
854
855
856
857 public boolean isValidIdentifierName()
858 {
859 return this.getSuperAssociationEndFacade().isValidIdentifierName();
860 }
861
862
863
864
865
866
867
868 public String translateConstraint(String name, String translation)
869 {
870 return this.getSuperAssociationEndFacade().translateConstraint(name, translation);
871 }
872
873
874
875
876
877 public String[] translateConstraints(String translation)
878 {
879 return this.getSuperAssociationEndFacade().translateConstraints(translation);
880 }
881
882
883
884
885
886 public String[] translateConstraints(String kind, String translation)
887 {
888 return this.getSuperAssociationEndFacade().translateConstraints(kind, translation);
889 }
890
891
892
893
894 @Override
895 public void initialize()
896 {
897 this.getSuperAssociationEndFacade().initialize();
898 }
899
900
901
902
903
904 @Override
905 public Object getValidationOwner()
906 {
907 Object owner = this.getSuperAssociationEndFacade().getValidationOwner();
908 return owner;
909 }
910
911
912
913
914
915 @Override
916 public String getValidationName()
917 {
918 String name = this.getSuperAssociationEndFacade().getValidationName();
919 return name;
920 }
921
922
923
924
925
926 @Override
927 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
928 {
929 this.getSuperAssociationEndFacade().validateInvariants(validationMessages);
930 }
931
932
933
934
935 private static final String NAME_PROPERTY = "name";
936 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
937
938
939
940
941 @Override
942 public String toString()
943 {
944 final StringBuilder toString = new StringBuilder(this.getClass().getName());
945 toString.append("[");
946 try
947 {
948 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
949 }
950 catch (final Throwable tryAgain)
951 {
952 try
953 {
954 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
955 }
956 catch (final Throwable ignore)
957 {
958
959 }
960 }
961 toString.append("]");
962 return toString.toString();
963 }
964 }