1
2
3
4
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import org.andromda.core.metafacade.MetafacadeBase;
9 import org.andromda.core.metafacade.ModelValidationMessage;
10 import org.andromda.metafacades.uml.ActionFacade;
11 import org.andromda.metafacades.uml.EventFacade;
12 import org.andromda.metafacades.uml.GuardFacade;
13 import org.andromda.metafacades.uml.StateVertexFacade;
14 import org.andromda.metafacades.uml.TransitionFacade;
15 import org.apache.log4j.Logger;
16 import org.omg.uml.behavioralelements.statemachines.Transition;
17
18
19
20
21
22
23
24
25
26 public abstract class TransitionFacadeLogic
27 extends ModelElementFacadeLogicImpl
28 implements TransitionFacade
29 {
30
31
32
33
34 protected Transition metaObject;
35
36
37
38
39
40 protected TransitionFacadeLogic(Transition metaObjectIn, String context)
41 {
42 super(metaObjectIn, getContext(context));
43 this.metaObject = metaObjectIn;
44 }
45
46
47
48
49 private static final Logger logger = Logger.getLogger(TransitionFacadeLogic.class);
50
51
52
53
54
55
56 private static String getContext(String context)
57 {
58 if (context == null)
59 {
60 context = "org.andromda.metafacades.uml.TransitionFacade";
61 }
62 return context;
63 }
64
65
66
67
68 @Override
69 public void resetMetafacadeContext(String context)
70 {
71 if (!this.contextRoot)
72 {
73 context = getContext(context);
74 setMetafacadeContext (context);
75 }
76 }
77
78
79
80
81
82 public boolean isTransitionFacadeMetaType()
83 {
84 return true;
85 }
86
87
88
89
90
91
92
93 protected abstract boolean handleIsTriggerPresent();
94
95 private boolean __triggerPresent1a;
96 private boolean __triggerPresent1aSet = false;
97
98
99
100
101
102 public final boolean isTriggerPresent()
103 {
104 boolean triggerPresent1a = this.__triggerPresent1a;
105 if (!this.__triggerPresent1aSet)
106 {
107
108 triggerPresent1a = handleIsTriggerPresent();
109
110 this.__triggerPresent1a = triggerPresent1a;
111 if (isMetafacadePropertyCachingEnabled())
112 {
113 this.__triggerPresent1aSet = true;
114 }
115 }
116 return triggerPresent1a;
117 }
118
119
120
121
122
123 protected abstract boolean handleIsExitingDecisionPoint();
124
125 private boolean __exitingDecisionPoint2a;
126 private boolean __exitingDecisionPoint2aSet = false;
127
128
129
130
131
132
133 public final boolean isExitingDecisionPoint()
134 {
135 boolean exitingDecisionPoint2a = this.__exitingDecisionPoint2a;
136 if (!this.__exitingDecisionPoint2aSet)
137 {
138
139 exitingDecisionPoint2a = handleIsExitingDecisionPoint();
140
141 this.__exitingDecisionPoint2a = exitingDecisionPoint2a;
142 if (isMetafacadePropertyCachingEnabled())
143 {
144 this.__exitingDecisionPoint2aSet = true;
145 }
146 }
147 return exitingDecisionPoint2a;
148 }
149
150
151
152
153
154 protected abstract boolean handleIsEnteringDecisionPoint();
155
156 private boolean __enteringDecisionPoint3a;
157 private boolean __enteringDecisionPoint3aSet = false;
158
159
160
161
162
163
164 public final boolean isEnteringDecisionPoint()
165 {
166 boolean enteringDecisionPoint3a = this.__enteringDecisionPoint3a;
167 if (!this.__enteringDecisionPoint3aSet)
168 {
169
170 enteringDecisionPoint3a = handleIsEnteringDecisionPoint();
171
172 this.__enteringDecisionPoint3a = enteringDecisionPoint3a;
173 if (isMetafacadePropertyCachingEnabled())
174 {
175 this.__enteringDecisionPoint3aSet = true;
176 }
177 }
178 return enteringDecisionPoint3a;
179 }
180
181
182
183
184
185 protected abstract boolean handleIsExitingActionState();
186
187 private boolean __exitingActionState4a;
188 private boolean __exitingActionState4aSet = false;
189
190
191
192
193
194
195 public final boolean isExitingActionState()
196 {
197 boolean exitingActionState4a = this.__exitingActionState4a;
198 if (!this.__exitingActionState4aSet)
199 {
200
201 exitingActionState4a = handleIsExitingActionState();
202
203 this.__exitingActionState4a = exitingActionState4a;
204 if (isMetafacadePropertyCachingEnabled())
205 {
206 this.__exitingActionState4aSet = true;
207 }
208 }
209 return exitingActionState4a;
210 }
211
212
213
214
215
216 protected abstract boolean handleIsEnteringActionState();
217
218 private boolean __enteringActionState5a;
219 private boolean __enteringActionState5aSet = false;
220
221
222
223
224
225
226 public final boolean isEnteringActionState()
227 {
228 boolean enteringActionState5a = this.__enteringActionState5a;
229 if (!this.__enteringActionState5aSet)
230 {
231
232 enteringActionState5a = handleIsEnteringActionState();
233
234 this.__enteringActionState5a = enteringActionState5a;
235 if (isMetafacadePropertyCachingEnabled())
236 {
237 this.__enteringActionState5aSet = true;
238 }
239 }
240 return enteringActionState5a;
241 }
242
243
244
245
246
247 protected abstract boolean handleIsExitingInitialState();
248
249 private boolean __exitingInitialState6a;
250 private boolean __exitingInitialState6aSet = false;
251
252
253
254
255
256
257 public final boolean isExitingInitialState()
258 {
259 boolean exitingInitialState6a = this.__exitingInitialState6a;
260 if (!this.__exitingInitialState6aSet)
261 {
262
263 exitingInitialState6a = handleIsExitingInitialState();
264
265 this.__exitingInitialState6a = exitingInitialState6a;
266 if (isMetafacadePropertyCachingEnabled())
267 {
268 this.__exitingInitialState6aSet = true;
269 }
270 }
271 return exitingInitialState6a;
272 }
273
274
275
276
277
278 protected abstract boolean handleIsEnteringFinalState();
279
280 private boolean __enteringFinalState7a;
281 private boolean __enteringFinalState7aSet = false;
282
283
284
285
286
287
288 public final boolean isEnteringFinalState()
289 {
290 boolean enteringFinalState7a = this.__enteringFinalState7a;
291 if (!this.__enteringFinalState7aSet)
292 {
293
294 enteringFinalState7a = handleIsEnteringFinalState();
295
296 this.__enteringFinalState7a = enteringFinalState7a;
297 if (isMetafacadePropertyCachingEnabled())
298 {
299 this.__enteringFinalState7aSet = true;
300 }
301 }
302 return enteringFinalState7a;
303 }
304
305
306
307
308
309
310
311
312
313
314
315 public final GuardFacade getGuard()
316 {
317 GuardFacade getGuard1r = null;
318
319 Object result = handleGetGuard();
320 MetafacadeBase shieldedResult = this.shieldedElement(result);
321 try
322 {
323 getGuard1r = (GuardFacade)shieldedResult;
324 }
325 catch (ClassCastException ex)
326 {
327
328 TransitionFacadeLogic.logger.warn("incorrect metafacade cast for TransitionFacadeLogic.getGuard GuardFacade " + result + ": " + shieldedResult);
329 }
330
331 return getGuard1r;
332 }
333
334
335
336
337
338 protected abstract Object handleGetGuard();
339
340
341
342
343
344 public final EventFacade getTrigger()
345 {
346 EventFacade getTrigger2r = null;
347
348 Object result = handleGetTrigger();
349 MetafacadeBase shieldedResult = this.shieldedElement(result);
350 try
351 {
352 getTrigger2r = (EventFacade)shieldedResult;
353 }
354 catch (ClassCastException ex)
355 {
356
357 TransitionFacadeLogic.logger.warn("incorrect metafacade cast for TransitionFacadeLogic.getTrigger EventFacade " + result + ": " + shieldedResult);
358 }
359
360 return getTrigger2r;
361 }
362
363
364
365
366
367 protected abstract Object handleGetTrigger();
368
369
370
371
372
373
374
375
376
377 public final StateVertexFacade getSource()
378 {
379 StateVertexFacade getSource3r = null;
380
381 Object result = handleGetSource();
382 MetafacadeBase shieldedResult = this.shieldedElement(result);
383 try
384 {
385 getSource3r = (StateVertexFacade)shieldedResult;
386 }
387 catch (ClassCastException ex)
388 {
389
390 TransitionFacadeLogic.logger.warn("incorrect metafacade cast for TransitionFacadeLogic.getSource StateVertexFacade " + result + ": " + shieldedResult);
391 }
392
393 return getSource3r;
394 }
395
396
397
398
399
400 protected abstract Object handleGetSource();
401
402
403
404
405
406
407
408
409
410 public final StateVertexFacade getTarget()
411 {
412 StateVertexFacade getTarget4r = null;
413
414 Object result = handleGetTarget();
415 MetafacadeBase shieldedResult = this.shieldedElement(result);
416 try
417 {
418 getTarget4r = (StateVertexFacade)shieldedResult;
419 }
420 catch (ClassCastException ex)
421 {
422
423 TransitionFacadeLogic.logger.warn("incorrect metafacade cast for TransitionFacadeLogic.getTarget StateVertexFacade " + result + ": " + shieldedResult);
424 }
425
426 return getTarget4r;
427 }
428
429
430
431
432
433 protected abstract Object handleGetTarget();
434
435
436
437
438
439 public final ActionFacade getEffect()
440 {
441 ActionFacade getEffect5r = null;
442
443 Object result = handleGetEffect();
444 MetafacadeBase shieldedResult = this.shieldedElement(result);
445 try
446 {
447 getEffect5r = (ActionFacade)shieldedResult;
448 }
449 catch (ClassCastException ex)
450 {
451
452 TransitionFacadeLogic.logger.warn("incorrect metafacade cast for TransitionFacadeLogic.getEffect ActionFacade " + result + ": " + shieldedResult);
453 }
454
455 return getEffect5r;
456 }
457
458
459
460
461
462 protected abstract Object handleGetEffect();
463
464
465
466
467
468 @Override
469 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
470 {
471 super.validateInvariants(validationMessages);
472 }
473 }