1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import org.andromda.core.metafacade.ModelValidationMessage;
9 import org.andromda.metafacades.uml.FrontEndExceptionHandler;
10
11 /**
12 * A front-end exception handler intercepts exceptions and delegates them into a front-end action
13 * state that will handle it (for example by simply displaying it if the action state happened to be
14 * a view) .
15 * MetafacadeLogic for FrontEndExceptionHandler
16 *
17 * @see FrontEndExceptionHandler
18 */
19 public abstract class FrontEndExceptionHandlerLogic
20 extends FrontEndForwardLogicImpl
21 implements FrontEndExceptionHandler
22 {
23 /**
24 * The underlying UML object
25 * @see Object
26 */
27 protected Object metaObject;
28
29 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
30 * @param metaObjectIn
31 * @param context
32 */
33 protected FrontEndExceptionHandlerLogic(Object metaObjectIn, String context)
34 {
35 super(metaObjectIn, getContext(context));
36 this.metaObject = metaObjectIn;
37 }
38
39 /**
40 * Gets the context for this metafacade logic instance.
41 * @param context String. Set to FrontEndExceptionHandler if null
42 * @return context String
43 */
44 private static String getContext(String context)
45 {
46 if (context == null)
47 {
48 context = "org.andromda.metafacades.uml.FrontEndExceptionHandler";
49 }
50 return context;
51 }
52
53 /** Reset context only for non-root metafacades
54 * @param context
55 */
56 @Override
57 public void resetMetafacadeContext(String context)
58 {
59 if (!this.contextRoot) // reset context only for non-root metafacades
60 {
61 context = getContext(context); // to have same value as in original constructor call
62 setMetafacadeContext (context);
63 }
64 }
65
66 /**
67 * @return boolean true always
68 * @see FrontEndExceptionHandler
69 */
70 public boolean isFrontEndExceptionHandlerMetaType()
71 {
72 return true;
73 }
74
75 // --------------- attributes ---------------------
76
77 /**
78 * @see FrontEndExceptionHandler#isFrontEndException()
79 * @return boolean
80 */
81 protected abstract boolean handleIsFrontEndException();
82
83 private boolean __frontEndException1a;
84 private boolean __frontEndException1aSet = false;
85
86 /**
87 * Indicatesif this element carries the FrontEndException stereotype.
88 * @return (boolean)handleIsFrontEndException()
89 */
90 public final boolean isFrontEndException()
91 {
92 boolean frontEndException1a = this.__frontEndException1a;
93 if (!this.__frontEndException1aSet)
94 {
95 // frontEndException has no pre constraints
96 frontEndException1a = handleIsFrontEndException();
97 // frontEndException has no post constraints
98 this.__frontEndException1a = frontEndException1a;
99 if (isMetafacadePropertyCachingEnabled())
100 {
101 this.__frontEndException1aSet = true;
102 }
103 }
104 return frontEndException1a;
105 }
106
107 // ------------- associations ------------------
108
109 /**
110 * @param validationMessages Collection<ModelValidationMessage>
111 * @see FrontEndForwardLogicImpl#validateInvariants(Collection validationMessages)
112 */
113 @Override
114 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
115 {
116 super.validateInvariants(validationMessages);
117 }
118 }