1
2
3
4 package org.andromda.cartridges.bpm4struts.metafacades;
5
6 /***
7 * MetafacadeLogic for org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler
8 *
9 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler
10 */
11 public abstract class StrutsExceptionHandlerLogic
12 extends org.andromda.core.metafacade.MetafacadeBase
13 implements org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler
14 {
15
16 protected Object metaObject;
17
18 public StrutsExceptionHandlerLogic(Object metaObject, String context)
19 {
20 super(metaObject, getContext(context));
21 this.superStrutsForward =
22 (org.andromda.cartridges.bpm4struts.metafacades.StrutsForward)
23 org.andromda.core.metafacade.MetafacadeFactory.getInstance().createFacadeImpl(
24 "org.andromda.cartridges.bpm4struts.metafacades.StrutsForward",
25 metaObject,
26 getContext(context));
27 this.superFrontEndExceptionHandler =
28 (org.andromda.metafacades.uml.FrontEndExceptionHandler)
29 org.andromda.core.metafacade.MetafacadeFactory.getInstance().createFacadeImpl(
30 "org.andromda.metafacades.uml.FrontEndExceptionHandler",
31 metaObject,
32 getContext(context));
33 this.metaObject = metaObject;
34 }
35
36 /***
37 * Gets the context for this metafacade logic instance.
38 */
39 private static String getContext(String context)
40 {
41 if (context == null)
42 {
43 context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler";
44 }
45 return context;
46 }
47
48 private org.andromda.cartridges.bpm4struts.metafacades.StrutsForward superStrutsForward;
49 private boolean superStrutsForwardInitialized = false;
50
51 /***
52 * Gets the org.andromda.cartridges.bpm4struts.metafacades.StrutsForward parent instance.
53 */
54 protected org.andromda.cartridges.bpm4struts.metafacades.StrutsForward getSuperStrutsForward()
55 {
56 if (!this.superStrutsForwardInitialized)
57 {
58 ((org.andromda.core.metafacade.MetafacadeBase)superStrutsForward).setMetafacadeContext(this.getMetafacadeContext());
59 this.superStrutsForwardInitialized = true;
60 }
61 return superStrutsForward;
62 }
63
64 private org.andromda.metafacades.uml.FrontEndExceptionHandler superFrontEndExceptionHandler;
65 private boolean superFrontEndExceptionHandlerInitialized = false;
66
67 /***
68 * Gets the org.andromda.metafacades.uml.FrontEndExceptionHandler parent instance.
69 */
70 protected org.andromda.metafacades.uml.FrontEndExceptionHandler getSuperFrontEndExceptionHandler()
71 {
72 if (!this.superFrontEndExceptionHandlerInitialized)
73 {
74 ((org.andromda.core.metafacade.MetafacadeBase)superFrontEndExceptionHandler).setMetafacadeContext(this.getMetafacadeContext());
75 this.superFrontEndExceptionHandlerInitialized = true;
76 }
77 return superFrontEndExceptionHandler;
78 }
79
80 /***
81 * @see org.andromda.core.metafacade.MetafacadeBase
82 */
83 public void resetMetafacadeContext(String context)
84 {
85 if (!this.contextRoot)
86 {
87 context = getContext(context);
88 setMetafacadeContext (context);
89 if (this.superStrutsForwardInitialized)
90 {
91 ((org.andromda.core.metafacade.MetafacadeBase)superStrutsForward).resetMetafacadeContext(context);
92 }
93 if (this.superFrontEndExceptionHandlerInitialized)
94 {
95 ((org.andromda.core.metafacade.MetafacadeBase)superFrontEndExceptionHandler).resetMetafacadeContext(context);
96 }
97 }
98 }
99
100 /***
101 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler
102 */
103 public boolean isStrutsExceptionHandlerMetaType()
104 {
105 return true;
106 }
107
108
109
110 /***
111 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler#getExceptionKey()
112 */
113 protected abstract java.lang.String handleGetExceptionKey();
114
115 private void handleGetExceptionKey1aPreCondition()
116 {
117 }
118
119 private void handleGetExceptionKey1aPostCondition()
120 {
121 }
122
123 private java.lang.String __exceptionKey1a;
124 private boolean __exceptionKey1aSet = false;
125
126 public final java.lang.String getExceptionKey()
127 {
128 java.lang.String exceptionKey1a = this.__exceptionKey1a;
129 if (!this.__exceptionKey1aSet)
130 {
131 handleGetExceptionKey1aPreCondition();
132 exceptionKey1a = handleGetExceptionKey();
133 handleGetExceptionKey1aPostCondition();
134 this.__exceptionKey1a = exceptionKey1a;
135 if (isMetafacadePropertyCachingEnabled())
136 {
137 this.__exceptionKey1aSet = true;
138 }
139 }
140 return exceptionKey1a;
141 }
142
143 /***
144 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler#getExceptionType()
145 */
146 protected abstract java.lang.String handleGetExceptionType();
147
148 private void handleGetExceptionType2aPreCondition()
149 {
150 }
151
152 private void handleGetExceptionType2aPostCondition()
153 {
154 }
155
156 private java.lang.String __exceptionType2a;
157 private boolean __exceptionType2aSet = false;
158
159 public final java.lang.String getExceptionType()
160 {
161 java.lang.String exceptionType2a = this.__exceptionType2a;
162 if (!this.__exceptionType2aSet)
163 {
164 handleGetExceptionType2aPreCondition();
165 exceptionType2a = handleGetExceptionType();
166 handleGetExceptionType2aPostCondition();
167 this.__exceptionType2a = exceptionType2a;
168 if (isMetafacadePropertyCachingEnabled())
169 {
170 this.__exceptionType2aSet = true;
171 }
172 }
173 return exceptionType2a;
174 }
175
176 /***
177 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler#getExceptionPath()
178 */
179 protected abstract java.lang.String handleGetExceptionPath();
180
181 private void handleGetExceptionPath3aPreCondition()
182 {
183 }
184
185 private void handleGetExceptionPath3aPostCondition()
186 {
187 }
188
189 private java.lang.String __exceptionPath3a;
190 private boolean __exceptionPath3aSet = false;
191
192 public final java.lang.String getExceptionPath()
193 {
194 java.lang.String exceptionPath3a = this.__exceptionPath3a;
195 if (!this.__exceptionPath3aSet)
196 {
197 handleGetExceptionPath3aPreCondition();
198 exceptionPath3a = handleGetExceptionPath();
199 handleGetExceptionPath3aPostCondition();
200 this.__exceptionPath3a = exceptionPath3a;
201 if (isMetafacadePropertyCachingEnabled())
202 {
203 this.__exceptionPath3aSet = true;
204 }
205 }
206 return exceptionPath3a;
207 }
208
209 /***
210 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsExceptionHandler#getMessageKey()
211 */
212 protected abstract java.lang.String handleGetMessageKey();
213
214 private void handleGetMessageKey4aPreCondition()
215 {
216 }
217
218 private void handleGetMessageKey4aPostCondition()
219 {
220 }
221
222 private java.lang.String __messageKey4a;
223 private boolean __messageKey4aSet = false;
224
225 public final java.lang.String getMessageKey()
226 {
227 java.lang.String messageKey4a = this.__messageKey4a;
228 if (!this.__messageKey4aSet)
229 {
230 handleGetMessageKey4aPreCondition();
231 messageKey4a = handleGetMessageKey();
232 handleGetMessageKey4aPostCondition();
233 this.__messageKey4a = messageKey4a;
234 if (isMetafacadePropertyCachingEnabled())
235 {
236 this.__messageKey4aSet = true;
237 }
238 }
239 return messageKey4a;
240 }
241
242
243
244 /***
245 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsForward
246 */
247 public boolean isStrutsForwardMetaType()
248 {
249 return true;
250 }
251
252 /***
253 * @see org.andromda.metafacades.uml.FrontEndExceptionHandler
254 */
255 public boolean isFrontEndExceptionHandlerMetaType()
256 {
257 return true;
258 }
259
260 /***
261 * @see org.andromda.metafacades.uml.FrontEndForward
262 */
263 public boolean isFrontEndForwardMetaType()
264 {
265 return true;
266 }
267
268 /***
269 * @see org.andromda.metafacades.uml.TransitionFacade
270 */
271 public boolean isTransitionFacadeMetaType()
272 {
273 return true;
274 }
275
276 /***
277 * @see org.andromda.metafacades.uml.ModelElementFacade
278 */
279 public boolean isModelElementFacadeMetaType()
280 {
281 return true;
282 }
283
284
285
286 public java.lang.String getForwardName()
287 {
288 return this.getSuperStrutsForward().getForwardName();
289 }
290
291
292 public java.lang.String getForwardPath()
293 {
294 return this.getSuperStrutsForward().getForwardPath();
295 }
296
297
298 public java.lang.String getGuardName()
299 {
300 return this.getSuperStrutsForward().getGuardName();
301 }
302
303
304 public org.andromda.cartridges.bpm4struts.metafacades.StrutsActivityGraph getStrutsActivityGraph()
305 {
306 return this.getSuperStrutsForward().getStrutsActivityGraph();
307 }
308
309
310 public java.util.Map getSuccessMessages()
311 {
312 return this.getSuperStrutsForward().getSuccessMessages();
313 }
314
315
316 public java.lang.String getTargetNameKey()
317 {
318 return this.getSuperStrutsForward().getTargetNameKey();
319 }
320
321
322 public java.util.Map getWarningMessages()
323 {
324 return this.getSuperStrutsForward().getWarningMessages();
325 }
326
327
328 public boolean isEnteringPage()
329 {
330 return this.getSuperStrutsForward().isEnteringPage();
331 }
332
333
334 public boolean isExitingPage()
335 {
336 return this.getSuperStrutsForward().isExitingPage();
337 }
338
339
340 public boolean isSuccessMessagesPresent()
341 {
342 return this.getSuperStrutsForward().isSuccessMessagesPresent();
343 }
344
345
346 public boolean isWarningMessagesPresent()
347 {
348 return this.getSuperStrutsForward().isWarningMessagesPresent();
349 }
350
351
352 public java.lang.String getActionMethodName()
353 {
354 return this.getSuperStrutsForward().getActionMethodName();
355 }
356
357
358 public java.util.List getActions()
359 {
360 return this.getSuperStrutsForward().getActions();
361 }
362
363
364 public org.andromda.metafacades.uml.FrontEndEvent getDecisionTrigger()
365 {
366 return this.getSuperStrutsForward().getDecisionTrigger();
367 }
368
369
370 public java.util.List getForwardParameters()
371 {
372 return this.getSuperStrutsForward().getForwardParameters();
373 }
374
375
376 public org.andromda.metafacades.uml.FrontEndActivityGraph getFrontEndActivityGraph()
377 {
378 return this.getSuperStrutsForward().getFrontEndActivityGraph();
379 }
380
381
382 public org.andromda.metafacades.uml.FrontEndControllerOperation getOperationCall()
383 {
384 return this.getSuperStrutsForward().getOperationCall();
385 }
386
387
388 public org.andromda.metafacades.uml.FrontEndUseCase getUseCase()
389 {
390 return this.getSuperStrutsForward().getUseCase();
391 }
392
393
394 public boolean isContainedInFrontEndUseCase()
395 {
396 return this.getSuperStrutsForward().isContainedInFrontEndUseCase();
397 }
398
399
400 public boolean isEnteringView()
401 {
402 return this.getSuperStrutsForward().isEnteringView();
403 }
404
405
406 public boolean isExitingView()
407 {
408 return this.getSuperStrutsForward().isExitingView();
409 }
410
411
412 public void copyTaggedValues(org.andromda.metafacades.uml.ModelElementFacade element)
413 {
414 this.getSuperStrutsForward().copyTaggedValues(element);
415 }
416
417
418 public java.lang.Object findTaggedValue(java.lang.String tagName)
419 {
420 return this.getSuperStrutsForward().findTaggedValue(tagName);
421 }
422
423
424 public java.util.Collection findTaggedValues(java.lang.String tagName)
425 {
426 return this.getSuperStrutsForward().findTaggedValues(tagName);
427 }
428
429
430 public java.util.Collection getConstraints()
431 {
432 return this.getSuperStrutsForward().getConstraints();
433 }
434
435
436 public java.util.Collection getConstraints(java.lang.String kind)
437 {
438 return this.getSuperStrutsForward().getConstraints(kind);
439 }
440
441
442 public java.lang.String getDocumentation(java.lang.String indent, int lineLength)
443 {
444 return this.getSuperStrutsForward().getDocumentation(indent, lineLength);
445 }
446
447
448 public java.lang.String getDocumentation(java.lang.String indent, int lineLength, boolean htmlStyle)
449 {
450 return this.getSuperStrutsForward().getDocumentation(indent, lineLength, htmlStyle);
451 }
452
453
454 public java.lang.String getDocumentation(java.lang.String indent)
455 {
456 return this.getSuperStrutsForward().getDocumentation(indent);
457 }
458
459
460 public java.lang.String getFullyQualifiedName(boolean modelName)
461 {
462 return this.getSuperStrutsForward().getFullyQualifiedName(modelName);
463 }
464
465
466 public java.lang.String getFullyQualifiedName()
467 {
468 return this.getSuperStrutsForward().getFullyQualifiedName();
469 }
470
471
472 public java.lang.String getFullyQualifiedNamePath()
473 {
474 return this.getSuperStrutsForward().getFullyQualifiedNamePath();
475 }
476
477
478 public java.lang.String getId()
479 {
480 return this.getSuperStrutsForward().getId();
481 }
482
483
484 public org.andromda.metafacades.uml.TypeMappings getLanguageMappings()
485 {
486 return this.getSuperStrutsForward().getLanguageMappings();
487 }
488
489
490 public org.andromda.metafacades.uml.ModelFacade getModel()
491 {
492 return this.getSuperStrutsForward().getModel();
493 }
494
495
496 public java.lang.String getName()
497 {
498 return this.getSuperStrutsForward().getName();
499 }
500
501
502 public org.andromda.metafacades.uml.ModelElementFacade getPackage()
503 {
504 return this.getSuperStrutsForward().getPackage();
505 }
506
507
508 public java.lang.String getPackageName(boolean modelName)
509 {
510 return this.getSuperStrutsForward().getPackageName(modelName);
511 }
512
513
514 public java.lang.String getPackageName()
515 {
516 return this.getSuperStrutsForward().getPackageName();
517 }
518
519
520 public java.lang.String getPackagePath()
521 {
522 return this.getSuperStrutsForward().getPackagePath();
523 }
524
525
526 public org.andromda.metafacades.uml.PackageFacade getRootPackage()
527 {
528 return this.getSuperStrutsForward().getRootPackage();
529 }
530
531
532 public java.util.Collection getSourceDependencies()
533 {
534 return this.getSuperStrutsForward().getSourceDependencies();
535 }
536
537
538 public org.andromda.metafacades.uml.StateMachineFacade getStateMachineContext()
539 {
540 return this.getSuperStrutsForward().getStateMachineContext();
541 }
542
543
544 public java.util.Collection getStereotypeNames()
545 {
546 return this.getSuperStrutsForward().getStereotypeNames();
547 }
548
549
550 public java.util.Collection getStereotypes()
551 {
552 return this.getSuperStrutsForward().getStereotypes();
553 }
554
555
556 public java.util.Collection getTaggedValues()
557 {
558 return this.getSuperStrutsForward().getTaggedValues();
559 }
560
561
562 public java.util.Collection getTargetDependencies()
563 {
564 return this.getSuperStrutsForward().getTargetDependencies();
565 }
566
567
568 public java.lang.Object getTemplateParameter(java.lang.String parameterName)
569 {
570 return this.getSuperStrutsForward().getTemplateParameter(parameterName);
571 }
572
573
574 public java.util.Collection getTemplateParameters()
575 {
576 return this.getSuperStrutsForward().getTemplateParameters();
577 }
578
579
580 public java.lang.String getVisibility()
581 {
582 return this.getSuperStrutsForward().getVisibility();
583 }
584
585
586 public boolean hasExactStereotype(java.lang.String stereotypeName)
587 {
588 return this.getSuperStrutsForward().hasExactStereotype(stereotypeName);
589 }
590
591
592 public boolean hasStereotype(java.lang.String stereotypeName)
593 {
594 return this.getSuperStrutsForward().hasStereotype(stereotypeName);
595 }
596
597
598 public boolean isBindingDependenciesPresent()
599 {
600 return this.getSuperStrutsForward().isBindingDependenciesPresent();
601 }
602
603
604 public boolean isConstraintsPresent()
605 {
606 return this.getSuperStrutsForward().isConstraintsPresent();
607 }
608
609
610 public boolean isTemplateParametersPresent()
611 {
612 return this.getSuperStrutsForward().isTemplateParametersPresent();
613 }
614
615
616 public java.lang.String translateConstraint(java.lang.String name, java.lang.String translation)
617 {
618 return this.getSuperStrutsForward().translateConstraint(name, translation);
619 }
620
621
622 public java.lang.String[] translateConstraints(java.lang.String translation)
623 {
624 return this.getSuperStrutsForward().translateConstraints(translation);
625 }
626
627
628 public java.lang.String[] translateConstraints(java.lang.String kind, java.lang.String translation)
629 {
630 return this.getSuperStrutsForward().translateConstraints(kind, translation);
631 }
632
633
634 public org.andromda.metafacades.uml.ActionFacade getEffect()
635 {
636 return this.getSuperStrutsForward().getEffect();
637 }
638
639
640 public org.andromda.metafacades.uml.GuardFacade getGuard()
641 {
642 return this.getSuperStrutsForward().getGuard();
643 }
644
645
646 public org.andromda.metafacades.uml.StateVertexFacade getSource()
647 {
648 return this.getSuperStrutsForward().getSource();
649 }
650
651
652 public org.andromda.metafacades.uml.StateVertexFacade getTarget()
653 {
654 return this.getSuperStrutsForward().getTarget();
655 }
656
657
658 public org.andromda.metafacades.uml.EventFacade getTrigger()
659 {
660 return this.getSuperStrutsForward().getTrigger();
661 }
662
663
664 public boolean isEnteringActionState()
665 {
666 return this.getSuperStrutsForward().isEnteringActionState();
667 }
668
669
670 public boolean isEnteringDecisionPoint()
671 {
672 return this.getSuperStrutsForward().isEnteringDecisionPoint();
673 }
674
675
676 public boolean isEnteringFinalState()
677 {
678 return this.getSuperStrutsForward().isEnteringFinalState();
679 }
680
681
682 public boolean isExitingActionState()
683 {
684 return this.getSuperStrutsForward().isExitingActionState();
685 }
686
687
688 public boolean isExitingDecisionPoint()
689 {
690 return this.getSuperStrutsForward().isExitingDecisionPoint();
691 }
692
693
694 public boolean isExitingInitialState()
695 {
696 return this.getSuperStrutsForward().isExitingInitialState();
697 }
698
699
700 public boolean isTriggerPresent()
701 {
702 return this.getSuperStrutsForward().isTriggerPresent();
703 }
704
705
706
707 public boolean isFrontEndException()
708 {
709 return this.getSuperFrontEndExceptionHandler().isFrontEndException();
710 }
711
712 /***
713 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
714 */
715 public void initialize()
716 {
717 this.getSuperStrutsForward().initialize();
718 this.getSuperFrontEndExceptionHandler().initialize();
719 }
720
721 /***
722 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
723 */
724 public Object getValidationOwner()
725 {
726 Object owner = this.getSuperStrutsForward().getValidationOwner();
727 if (owner == null)
728 {
729 owner = this.getSuperFrontEndExceptionHandler().getValidationOwner();
730 }
731 return owner;
732 }
733
734 /***
735 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
736 */
737 public String getValidationName()
738 {
739 String name = this.getSuperStrutsForward().getValidationName();
740 if (name == null)
741 {
742 name = this.getSuperFrontEndExceptionHandler().getValidationName();
743 }
744 return name;
745 }
746
747 /***
748 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
749 */
750 public void validateInvariants(java.util.Collection validationMessages)
751 {
752 this.getSuperStrutsForward().validateInvariants(validationMessages);
753 this.getSuperFrontEndExceptionHandler().validateInvariants(validationMessages);
754 {
755 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(org.andromda.translation.ocl.validation.OCLExpressions.equal(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"enteringPage"),false))).booleanValue()?Boolean.valueOf(String.valueOf(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"enteringFinalState"))).booleanValue():true));
756 if (!constraintValid)
757 validationMessages.add(
758 new org.andromda.core.metafacade.ModelValidationMessage(
759 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
760 "org::andromda::cartridges::bpm4struts::metafacades::StrutsExceptionHandler::must target page or final state",
761 "When you model an action-exception you must either target a FrontEndView action state or a final state."));
762 }
763 }
764
765 /***
766 * The property that stores the name of the metafacade.
767 */
768 private static final String NAME_PROPERTY = "name";
769
770 /***
771 * @see java.lang.Object#toString()
772 */
773 public String toString()
774 {
775 final StringBuffer toString = new StringBuffer(this.getClass().getName());
776 toString.append("[");
777 try
778 {
779 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
780 }
781 catch (final Throwable throwable)
782 {
783
784 }
785 toString.append("]");
786 return toString.toString();
787 }
788 }