1
2
3
4
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import java.util.List;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.ModelValidationMessage;
11 import org.andromda.metafacades.uml.FrontEndAction;
12 import org.andromda.metafacades.uml.FrontEndControllerOperation;
13 import org.andromda.metafacades.uml.FrontEndEvent;
14 import org.apache.log4j.Logger;
15 import org.omg.uml.behavioralelements.statemachines.Event;
16
17
18
19
20
21
22
23
24 public abstract class FrontEndEventLogic
25 extends EventFacadeLogicImpl
26 implements FrontEndEvent
27 {
28
29
30
31
32 protected Object metaObject;
33
34
35
36
37
38 protected FrontEndEventLogic(Object metaObjectIn, String context)
39 {
40 super((Event)metaObjectIn, getContext(context));
41 this.metaObject = metaObjectIn;
42 }
43
44
45
46
47 private static final Logger logger = Logger.getLogger(FrontEndEventLogic.class);
48
49
50
51
52
53
54 private static String getContext(String context)
55 {
56 if (context == null)
57 {
58 context = "org.andromda.metafacades.uml.FrontEndEvent";
59 }
60 return context;
61 }
62
63
64
65
66 @Override
67 public void resetMetafacadeContext(String context)
68 {
69 if (!this.contextRoot)
70 {
71 context = getContext(context);
72 setMetafacadeContext (context);
73 }
74 }
75
76
77
78
79
80 public boolean isFrontEndEventMetaType()
81 {
82 return true;
83 }
84
85
86
87
88
89
90
91 protected abstract boolean handleIsContainedInFrontEndUseCase();
92
93 private boolean __containedInFrontEndUseCase1a;
94 private boolean __containedInFrontEndUseCase1aSet = false;
95
96
97
98
99
100 public final boolean isContainedInFrontEndUseCase()
101 {
102 boolean containedInFrontEndUseCase1a = this.__containedInFrontEndUseCase1a;
103 if (!this.__containedInFrontEndUseCase1aSet)
104 {
105
106 containedInFrontEndUseCase1a = handleIsContainedInFrontEndUseCase();
107
108 this.__containedInFrontEndUseCase1a = containedInFrontEndUseCase1a;
109 if (isMetafacadePropertyCachingEnabled())
110 {
111 this.__containedInFrontEndUseCase1aSet = true;
112 }
113 }
114 return containedInFrontEndUseCase1a;
115 }
116
117
118
119 private FrontEndControllerOperation __getControllerCall1r;
120 private boolean __getControllerCall1rSet = false;
121
122
123
124
125
126
127
128 public final FrontEndControllerOperation getControllerCall()
129 {
130 FrontEndControllerOperation getControllerCall1r = this.__getControllerCall1r;
131 if (!this.__getControllerCall1rSet)
132 {
133
134 Object result = handleGetControllerCall();
135 MetafacadeBase shieldedResult = this.shieldedElement(result);
136 try
137 {
138 getControllerCall1r = (FrontEndControllerOperation)shieldedResult;
139 }
140 catch (ClassCastException ex)
141 {
142
143 FrontEndEventLogic.logger.warn("incorrect metafacade cast for FrontEndEventLogic.getControllerCall FrontEndControllerOperation " + result + ": " + shieldedResult);
144 }
145
146 this.__getControllerCall1r = getControllerCall1r;
147 if (isMetafacadePropertyCachingEnabled())
148 {
149 this.__getControllerCall1rSet = true;
150 }
151 }
152 return getControllerCall1r;
153 }
154
155
156
157
158
159 protected abstract Object handleGetControllerCall();
160
161 private FrontEndAction __getAction2r;
162 private boolean __getAction2rSet = false;
163
164
165
166
167
168
169
170 public final FrontEndAction getAction()
171 {
172 FrontEndAction getAction2r = this.__getAction2r;
173 if (!this.__getAction2rSet)
174 {
175
176 Object result = handleGetAction();
177 MetafacadeBase shieldedResult = this.shieldedElement(result);
178 try
179 {
180 getAction2r = (FrontEndAction)shieldedResult;
181 }
182 catch (ClassCastException ex)
183 {
184
185 FrontEndEventLogic.logger.warn("incorrect metafacade cast for FrontEndEventLogic.getAction FrontEndAction " + result + ": " + shieldedResult);
186 }
187
188 this.__getAction2r = getAction2r;
189 if (isMetafacadePropertyCachingEnabled())
190 {
191 this.__getAction2rSet = true;
192 }
193 }
194 return getAction2r;
195 }
196
197
198
199
200
201 protected abstract Object handleGetAction();
202
203
204
205
206
207
208
209 public final List<FrontEndControllerOperation> getControllerCalls()
210 {
211 List<FrontEndControllerOperation> getControllerCalls3r = null;
212
213 List result = handleGetControllerCalls();
214 List shieldedResult = this.shieldedElements(result);
215 try
216 {
217 getControllerCalls3r = (List<FrontEndControllerOperation>)shieldedResult;
218 }
219 catch (ClassCastException ex)
220 {
221
222 FrontEndEventLogic.logger.warn("incorrect metafacade cast for FrontEndEventLogic.getControllerCalls List<FrontEndControllerOperation> " + result + ": " + shieldedResult);
223 }
224
225 return getControllerCalls3r;
226 }
227
228
229
230
231
232 protected abstract List handleGetControllerCalls();
233
234
235
236
237
238 @Override
239 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
240 {
241 super.validateInvariants(validationMessages);
242 }
243 }