1
2
3
4
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import java.util.List;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.ModelValidationMessage;
11 import org.andromda.metafacades.uml.PartitionFacade;
12 import org.andromda.metafacades.uml.StateFacade;
13 import org.andromda.metafacades.uml.StateMachineFacade;
14 import org.andromda.metafacades.uml.StateVertexFacade;
15 import org.andromda.metafacades.uml.TransitionFacade;
16 import org.apache.log4j.Logger;
17 import org.omg.uml.behavioralelements.statemachines.StateVertex;
18
19
20
21
22
23
24
25
26 public abstract class StateVertexFacadeLogic
27 extends ModelElementFacadeLogicImpl
28 implements StateVertexFacade
29 {
30
31
32
33
34 protected StateVertex metaObject;
35
36
37
38
39
40 protected StateVertexFacadeLogic(StateVertex metaObjectIn, String context)
41 {
42 super(metaObjectIn, getContext(context));
43 this.metaObject = metaObjectIn;
44 }
45
46
47
48
49 private static final Logger logger = Logger.getLogger(StateVertexFacadeLogic.class);
50
51
52
53
54
55
56 private static String getContext(String context)
57 {
58 if (context == null)
59 {
60 context = "org.andromda.metafacades.uml.StateVertexFacade";
61 }
62 return context;
63 }
64
65
66
67
68 @Override
69 public void resetMetafacadeContext(String context)
70 {
71 if (!this.contextRoot)
72 {
73 context = getContext(context);
74 setMetafacadeContext (context);
75 }
76 }
77
78
79
80
81
82 public boolean isStateVertexFacadeMetaType()
83 {
84 return true;
85 }
86
87
88
89
90
91
92
93
94
95 public final Collection<TransitionFacade> getOutgoings()
96 {
97 Collection<TransitionFacade> getOutgoings1r = null;
98
99 Collection result = handleGetOutgoings();
100 List shieldedResult = this.shieldedElements(result);
101 try
102 {
103 getOutgoings1r = (Collection<TransitionFacade>)shieldedResult;
104 }
105 catch (ClassCastException ex)
106 {
107
108 StateVertexFacadeLogic.logger.warn("incorrect metafacade cast for StateVertexFacadeLogic.getOutgoings Collection<TransitionFacade> " + result + ": " + shieldedResult);
109 }
110
111 return getOutgoings1r;
112 }
113
114
115
116
117
118 protected abstract Collection handleGetOutgoings();
119
120 private PartitionFacade __getPartition2r;
121 private boolean __getPartition2rSet = false;
122
123
124
125
126
127 public final PartitionFacade getPartition()
128 {
129 PartitionFacade getPartition2r = this.__getPartition2r;
130 if (!this.__getPartition2rSet)
131 {
132
133 Object result = handleGetPartition();
134 MetafacadeBase shieldedResult = this.shieldedElement(result);
135 try
136 {
137 getPartition2r = (PartitionFacade)shieldedResult;
138 }
139 catch (ClassCastException ex)
140 {
141
142 StateVertexFacadeLogic.logger.warn("incorrect metafacade cast for StateVertexFacadeLogic.getPartition PartitionFacade " + result + ": " + shieldedResult);
143 }
144
145 this.__getPartition2r = getPartition2r;
146 if (isMetafacadePropertyCachingEnabled())
147 {
148 this.__getPartition2rSet = true;
149 }
150 }
151 return getPartition2r;
152 }
153
154
155
156
157
158 protected abstract Object handleGetPartition();
159
160
161
162
163
164
165
166 public final Collection<TransitionFacade> getIncomings()
167 {
168 Collection<TransitionFacade> getIncomings3r = null;
169
170 Collection result = handleGetIncomings();
171 List shieldedResult = this.shieldedElements(result);
172 try
173 {
174 getIncomings3r = (Collection<TransitionFacade>)shieldedResult;
175 }
176 catch (ClassCastException ex)
177 {
178
179 StateVertexFacadeLogic.logger.warn("incorrect metafacade cast for StateVertexFacadeLogic.getIncomings Collection<TransitionFacade> " + result + ": " + shieldedResult);
180 }
181
182 return getIncomings3r;
183 }
184
185
186
187
188
189 protected abstract Collection handleGetIncomings();
190
191
192
193
194
195
196
197 public final StateFacade getContainer()
198 {
199 StateFacade getContainer4r = null;
200
201 Object result = handleGetContainer();
202 MetafacadeBase shieldedResult = this.shieldedElement(result);
203 try
204 {
205 getContainer4r = (StateFacade)shieldedResult;
206 }
207 catch (ClassCastException ex)
208 {
209
210 StateVertexFacadeLogic.logger.warn("incorrect metafacade cast for StateVertexFacadeLogic.getContainer StateFacade " + result + ": " + shieldedResult);
211 }
212
213 return getContainer4r;
214 }
215
216
217
218
219
220 protected abstract Object handleGetContainer();
221
222 private StateMachineFacade __getStateMachine5r;
223 private boolean __getStateMachine5rSet = false;
224
225
226
227
228
229
230
231 public final StateMachineFacade getStateMachine()
232 {
233 StateMachineFacade getStateMachine5r = this.__getStateMachine5r;
234 if (!this.__getStateMachine5rSet)
235 {
236
237 Object result = handleGetStateMachine();
238 MetafacadeBase shieldedResult = this.shieldedElement(result);
239 try
240 {
241 getStateMachine5r = (StateMachineFacade)shieldedResult;
242 }
243 catch (ClassCastException ex)
244 {
245
246 StateVertexFacadeLogic.logger.warn("incorrect metafacade cast for StateVertexFacadeLogic.getStateMachine StateMachineFacade " + result + ": " + shieldedResult);
247 }
248
249 this.__getStateMachine5r = getStateMachine5r;
250 if (isMetafacadePropertyCachingEnabled())
251 {
252 this.__getStateMachine5rSet = true;
253 }
254 }
255 return getStateMachine5r;
256 }
257
258
259
260
261
262 protected abstract Object handleGetStateMachine();
263
264
265
266
267
268 @Override
269 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
270 {
271 super.validateInvariants(validationMessages);
272 }
273 }