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