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