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