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