View Javadoc
1   package org.andromda.metafacades.uml14;
2   
3   import org.omg.uml.behavioralelements.statemachines.Pseudostate;
4   import org.omg.uml.foundation.datatypes.PseudostateKindEnum;
5   
6   /**
7    * Metaclass facade implementation.
8    * @author Bob Fields
9    */
10  public class PseudostateFacadeLogicImpl
11      extends PseudostateFacadeLogic
12  {
13      private static final long serialVersionUID = 34L;
14      /**
15       * @param metaObject
16       * @param context
17       */
18      public PseudostateFacadeLogicImpl(
19          Pseudostate metaObject,
20          String context)
21      {
22          super(metaObject, context);
23      }
24  
25      /**
26       * @see org.andromda.metafacades.uml.PseudostateFacade#isChoice()
27       */
28      @Override
29      protected boolean handleIsChoice()
30      {
31          return PseudostateKindEnum.PK_CHOICE.equals(metaObject.getKind());
32      }
33  
34      /**
35       * @see org.andromda.metafacades.uml.PseudostateFacade#isInitialState()
36       */
37      @Override
38      protected boolean handleIsInitialState()
39      {
40          return PseudostateKindEnum.PK_INITIAL.equals(metaObject.getKind());
41      }
42  
43      /**
44       * @see org.andromda.metafacades.uml.PseudostateFacade#isJoin()
45       */
46      @Override
47      protected boolean handleIsJoin()
48      {
49          return PseudostateKindEnum.PK_JOIN.equals(metaObject.getKind());
50      }
51  
52      /**
53       * @see org.andromda.metafacades.uml.PseudostateFacade#isFork()
54       */
55      @Override
56      protected boolean handleIsFork()
57      {
58          return PseudostateKindEnum.PK_FORK.equals(metaObject.getKind());
59      }
60  
61      /**
62       * @see org.andromda.metafacades.uml.PseudostateFacade#isJunction()
63       */
64      @Override
65      protected boolean handleIsJunction()
66      {
67          return PseudostateKindEnum.PK_JUNCTION.equals(metaObject.getKind());
68      }
69  
70      /**
71       * @see org.andromda.metafacades.uml.PseudostateFacade#isDecisionPoint()
72       */
73      @Override
74      protected boolean handleIsDecisionPoint()
75      {
76          return (this.isChoice() || this.isJunction()) && metaObject.getOutgoing().size() > 1;
77      }
78  
79      /**
80       * @see org.andromda.metafacades.uml.PseudostateFacade#isMergePoint()
81       */
82      @Override
83      protected boolean handleIsMergePoint()
84      {
85          return (this.isChoice() || this.isJunction()) && metaObject.getIncoming().size() > 1;
86      }
87  
88      /**
89       * @see org.andromda.metafacades.uml.PseudostateFacade#isDeepHistory()
90       */
91      @Override
92      protected boolean handleIsDeepHistory()
93      {
94          return PseudostateKindEnum.PK_DEEP_HISTORY.equals(metaObject.getKind());
95      }
96  
97      /**
98       * @see org.andromda.metafacades.uml.PseudostateFacade#isShallowHistory()
99       */
100     @Override
101     protected boolean handleIsShallowHistory()
102     {
103         return PseudostateKindEnum.PK_SHALLOW_HISTORY.equals(metaObject.getKind());
104     }
105 
106     /**
107      * @see org.andromda.metafacades.uml.PseudostateFacade#isSplit()
108      */
109     @Override
110     protected boolean handleIsSplit()
111     {
112         return (this.isJoin() || this.isFork()) && metaObject.getOutgoing().size() > 1;
113     }
114 
115     /**
116      * @see org.andromda.metafacades.uml.PseudostateFacade#isCollect()
117      */
118     @Override
119     protected boolean handleIsCollect()
120     {
121         return (this.isJoin() || this.isFork()) && metaObject.getIncoming().size() > 1;
122     }
123 
124     /**
125      * @see org.andromda.metafacades.uml.PseudostateFacade#getValidationOwner()
126      */
127     @Override
128     public Object handleGetValidationOwner()
129     {
130         return this.getStateMachine();
131     }
132 }