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