1 package org.andromda.metafacades.uml14;
2
3 import java.lang.reflect.Method;
4 import java.util.Collections;
5 import java.util.List;
6 import org.andromda.metafacades.uml.FrontEndAction;
7 import org.andromda.metafacades.uml.FrontEndForward;
8 import org.andromda.metafacades.uml.TransitionFacade;
9
10
11
12
13
14
15
16 public class FrontEndEventLogicImpl
17 extends FrontEndEventLogic
18 {
19 private static final long serialVersionUID = -7746762732086766084L;
20
21
22
23
24
25 public FrontEndEventLogicImpl (Object metaObject, String context)
26 {
27 super (metaObject, context);
28 }
29
30
31
32
33 @Override
34 protected boolean handleIsContainedInFrontEndUseCase()
35 {
36 return this.getTransition() instanceof FrontEndForward;
37 }
38
39
40
41
42 @Override
43 protected Object handleGetControllerCall()
44 {
45
46 try
47 {
48 final Method method = metaObject.getClass().getMethod("getOperation", (Class[])null);
49 return method.invoke(metaObject, (Object[])null);
50 }
51 catch (Exception ex)
52 {
53 return null;
54 }
55 }
56
57
58
59
60 @Override
61 protected FrontEndAction handleGetAction()
62 {
63 FrontEndAction action = null;
64 TransitionFacade transition = getTransition();
65 if (transition instanceof FrontEndAction)
66 {
67 action = (FrontEndAction)transition;
68 }
69 return action;
70 }
71
72
73
74
75 @Override
76 protected List handleGetControllerCalls()
77 {
78 Object controllerCall = this.getControllerCall();
79 return controllerCall == null ? Collections.emptyList() : Collections.singletonList(controllerCall);
80 }
81
82 }