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.StateMachineFacade;
11 import org.andromda.metafacades.uml.SubactivityStateFacade;
12 import org.apache.log4j.Logger;
13 import org.omg.uml.behavioralelements.activitygraphs.SubactivityState;
14
15
16
17
18
19
20
21
22
23
24
25 public abstract class SubactivityStateFacadeLogic
26 extends StateFacadeLogicImpl
27 implements SubactivityStateFacade
28 {
29
30
31
32
33 protected SubactivityState metaObject;
34
35
36
37
38
39 protected SubactivityStateFacadeLogic(SubactivityState metaObjectIn, String context)
40 {
41 super(metaObjectIn, getContext(context));
42 this.metaObject = metaObjectIn;
43 }
44
45
46
47
48 private static final Logger logger = Logger.getLogger(SubactivityStateFacadeLogic.class);
49
50
51
52
53
54
55 private static String getContext(String context)
56 {
57 if (context == null)
58 {
59 context = "org.andromda.metafacades.uml.SubactivityStateFacade";
60 }
61 return context;
62 }
63
64
65
66
67 @Override
68 public void resetMetafacadeContext(String context)
69 {
70 if (!this.contextRoot)
71 {
72 context = getContext(context);
73 setMetafacadeContext (context);
74 }
75 }
76
77
78
79
80
81 public boolean isSubactivityStateFacadeMetaType()
82 {
83 return true;
84 }
85
86
87
88
89
90
91
92 protected abstract boolean handleIsDynamic();
93
94 private boolean __dynamic1a;
95 private boolean __dynamic1aSet = false;
96
97
98
99
100
101 public final boolean isDynamic()
102 {
103 boolean dynamic1a = this.__dynamic1a;
104 if (!this.__dynamic1aSet)
105 {
106
107 dynamic1a = handleIsDynamic();
108
109 this.__dynamic1a = dynamic1a;
110 if (isMetafacadePropertyCachingEnabled())
111 {
112 this.__dynamic1aSet = true;
113 }
114 }
115 return dynamic1a;
116 }
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132 public final StateMachineFacade getSubmachine()
133 {
134 StateMachineFacade getSubmachine1r = null;
135
136 Object result = handleGetSubmachine();
137 MetafacadeBase shieldedResult = this.shieldedElement(result);
138 try
139 {
140 getSubmachine1r = (StateMachineFacade)shieldedResult;
141 }
142 catch (ClassCastException ex)
143 {
144
145 SubactivityStateFacadeLogic.logger.warn("incorrect metafacade cast for SubactivityStateFacadeLogic.getSubmachine StateMachineFacade " + result + ": " + shieldedResult);
146 }
147
148 return getSubmachine1r;
149 }
150
151
152
153
154
155 protected abstract Object handleGetSubmachine();
156
157
158
159
160
161 @Override
162 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
163 {
164 super.validateInvariants(validationMessages);
165 }
166 }