01: package org.andromda.metafacades.uml14;
02:
03: import org.andromda.metafacades.uml.ActionStateFacade;
04: import org.andromda.metafacades.uml.FinalStateFacade;
05: import org.andromda.metafacades.uml.PseudostateFacade;
06: import org.andromda.metafacades.uml.StateVertexFacade;
07:
08: /**
09: * Metaclass facade implementation.
10: */
11: public class TransitionFacadeLogicImpl extends TransitionFacadeLogic {
12: public TransitionFacadeLogicImpl(
13: org.omg.uml.behavioralelements.statemachines.Transition metaObject,
14: String context) {
15: super (metaObject, context);
16: }
17:
18: protected Object handleGetEffect() {
19: return metaObject.getEffect();
20: }
21:
22: protected Object handleGetSource() {
23: return metaObject.getSource();
24: }
25:
26: protected Object handleGetTarget() {
27: return metaObject.getTarget();
28: }
29:
30: protected Object handleGetTrigger() {
31: return metaObject.getTrigger();
32: }
33:
34: protected Object handleGetGuard() {
35: return metaObject.getGuard();
36: }
37:
38: protected boolean handleIsTriggerPresent() {
39: return metaObject.getTrigger() != null;
40: }
41:
42: protected boolean handleIsExitingDecisionPoint() {
43: final StateVertexFacade sourceVertex = getSource();
44: return sourceVertex instanceof PseudostateFacade
45: && ((PseudostateFacade) sourceVertex).isDecisionPoint();
46: }
47:
48: protected boolean handleIsEnteringDecisionPoint() {
49: final StateVertexFacade target = getTarget();
50: return target instanceof PseudostateFacade
51: && ((PseudostateFacade) target).isDecisionPoint();
52: }
53:
54: protected boolean handleIsExitingActionState() {
55: return getSource() instanceof ActionStateFacade;
56: }
57:
58: protected boolean handleIsEnteringActionState() {
59: return getTarget() instanceof ActionStateFacade;
60: }
61:
62: protected boolean handleIsExitingInitialState() {
63: StateVertexFacade sourceVertex = getSource();
64: return sourceVertex instanceof PseudostateFacade
65: && ((PseudostateFacade) sourceVertex).isInitialState();
66: }
67:
68: protected boolean handleIsEnteringFinalState() {
69: return getTarget() instanceof FinalStateFacade;
70: }
71:
72: public Object getValidationOwner() {
73: return getTarget().getStateMachine();
74: }
75:
76: }
|