1 package org.andromda.metafacades.uml14;
2
3 import org.andromda.metafacades.uml.ActionStateFacade;
4 import org.andromda.metafacades.uml.FinalStateFacade;
5 import org.andromda.metafacades.uml.PseudostateFacade;
6 import org.andromda.metafacades.uml.StateVertexFacade;
7 import org.omg.uml.behavioralelements.commonbehavior.Action;
8 import org.omg.uml.behavioralelements.statemachines.Event;
9 import org.omg.uml.behavioralelements.statemachines.Guard;
10 import org.omg.uml.behavioralelements.statemachines.StateVertex;
11 import org.omg.uml.behavioralelements.statemachines.Transition;
12
13
14
15
16
17 public class TransitionFacadeLogicImpl
18 extends TransitionFacadeLogic
19 {
20 private static final long serialVersionUID = 34L;
21
22
23
24
25 public TransitionFacadeLogicImpl(Transition metaObject,
26 String context)
27 {
28 super(metaObject, context);
29 }
30
31
32
33
34 protected Action handleGetEffect()
35 {
36 return metaObject.getEffect();
37 }
38
39
40
41
42 protected StateVertex handleGetSource()
43 {
44 return metaObject.getSource();
45 }
46
47
48
49
50 protected StateVertex handleGetTarget()
51 {
52 return metaObject.getTarget();
53 }
54
55
56
57
58 protected Event handleGetTrigger()
59 {
60 return metaObject.getTrigger();
61 }
62
63
64
65
66 protected Guard handleGetGuard()
67 {
68 return metaObject.getGuard();
69 }
70
71
72
73
74 protected boolean handleIsTriggerPresent()
75 {
76 return metaObject.getTrigger() != null;
77 }
78
79
80
81
82 protected boolean handleIsExitingDecisionPoint()
83 {
84 final StateVertexFacade sourceVertex = getSource();
85 return sourceVertex instanceof PseudostateFacade && ((PseudostateFacade)sourceVertex).isDecisionPoint();
86 }
87
88
89
90
91 protected boolean handleIsEnteringDecisionPoint()
92 {
93 final StateVertexFacade target = getTarget();
94 return target instanceof PseudostateFacade && ((PseudostateFacade)target).isDecisionPoint();
95 }
96
97
98
99
100 protected boolean handleIsExitingActionState()
101 {
102 return getSource() instanceof ActionStateFacade;
103 }
104
105
106
107
108 protected boolean handleIsEnteringActionState()
109 {
110 return getTarget() instanceof ActionStateFacade;
111 }
112
113
114
115
116 protected boolean handleIsExitingInitialState()
117 {
118 StateVertexFacade sourceVertex = getSource();
119 return sourceVertex instanceof PseudostateFacade && ((PseudostateFacade)sourceVertex).isInitialState();
120 }
121
122
123
124
125 protected boolean handleIsEnteringFinalState()
126 {
127 return getTarget() instanceof FinalStateFacade;
128 }
129
130
131
132
133 public Object handleGetValidationOwner()
134 {
135 return getTarget().getStateMachine();
136 }
137
138 }