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