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.ActionStateFacade;
12 import org.andromda.metafacades.uml.ActivityGraphFacade;
13 import org.andromda.metafacades.uml.ObjectFlowStateFacade;
14 import org.andromda.metafacades.uml.PartitionFacade;
15 import org.andromda.metafacades.uml.UseCaseFacade;
16 import org.apache.log4j.Logger;
17 import org.omg.uml.behavioralelements.activitygraphs.ActivityGraph;
18
19
20
21
22
23
24
25
26
27
28 public abstract class ActivityGraphFacadeLogic
29 extends StateMachineFacadeLogicImpl
30 implements ActivityGraphFacade
31 {
32
33
34
35
36 protected ActivityGraph metaObject;
37
38
39
40
41
42 protected ActivityGraphFacadeLogic(ActivityGraph metaObjectIn, String context)
43 {
44 super(metaObjectIn, getContext(context));
45 this.metaObject = metaObjectIn;
46 }
47
48
49
50
51 private static final Logger logger = Logger.getLogger(ActivityGraphFacadeLogic.class);
52
53
54
55
56
57
58 private static String getContext(String context)
59 {
60 if (context == null)
61 {
62 context = "org.andromda.metafacades.uml.ActivityGraphFacade";
63 }
64 return context;
65 }
66
67
68
69
70 @Override
71 public void resetMetafacadeContext(String context)
72 {
73 if (!this.contextRoot)
74 {
75 context = getContext(context);
76 setMetafacadeContext (context);
77 }
78 }
79
80
81
82
83
84 public boolean isActivityGraphFacadeMetaType()
85 {
86 return true;
87 }
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102 public final Collection<ObjectFlowStateFacade> getObjectFlowStates()
103 {
104 Collection<ObjectFlowStateFacade> getObjectFlowStates1r = null;
105
106 Collection result = handleGetObjectFlowStates();
107 List shieldedResult = this.shieldedElements(result);
108 try
109 {
110 getObjectFlowStates1r = (Collection<ObjectFlowStateFacade>)shieldedResult;
111 }
112 catch (ClassCastException ex)
113 {
114
115 ActivityGraphFacadeLogic.logger.warn("incorrect metafacade cast for ActivityGraphFacadeLogic.getObjectFlowStates Collection<ObjectFlowStateFacade> " + result + ": " + shieldedResult);
116 }
117
118 return getObjectFlowStates1r;
119 }
120
121
122
123
124
125 protected abstract Collection handleGetObjectFlowStates();
126
127
128
129
130
131
132
133
134
135
136
137
138 public final Collection<ActionStateFacade> getActionStates()
139 {
140 Collection<ActionStateFacade> getActionStates2r = null;
141
142 Collection result = handleGetActionStates();
143 List shieldedResult = this.shieldedElements(result);
144 try
145 {
146 getActionStates2r = (Collection<ActionStateFacade>)shieldedResult;
147 }
148 catch (ClassCastException ex)
149 {
150
151 ActivityGraphFacadeLogic.logger.warn("incorrect metafacade cast for ActivityGraphFacadeLogic.getActionStates Collection<ActionStateFacade> " + result + ": " + shieldedResult);
152 }
153
154 return getActionStates2r;
155 }
156
157
158
159
160
161 protected abstract Collection handleGetActionStates();
162
163
164
165
166
167
168
169
170
171
172
173
174 public final Collection<PartitionFacade> getPartitions()
175 {
176 Collection<PartitionFacade> getPartitions3r = null;
177
178 Collection result = handleGetPartitions();
179 List shieldedResult = this.shieldedElements(result);
180 try
181 {
182 getPartitions3r = (Collection<PartitionFacade>)shieldedResult;
183 }
184 catch (ClassCastException ex)
185 {
186
187 ActivityGraphFacadeLogic.logger.warn("incorrect metafacade cast for ActivityGraphFacadeLogic.getPartitions Collection<PartitionFacade> " + result + ": " + shieldedResult);
188 }
189
190 return getPartitions3r;
191 }
192
193
194
195
196
197 protected abstract Collection handleGetPartitions();
198
199
200
201
202
203 public final UseCaseFacade getUseCase()
204 {
205 UseCaseFacade getUseCase4r = null;
206
207 Object result = handleGetUseCase();
208 MetafacadeBase shieldedResult = this.shieldedElement(result);
209 try
210 {
211 getUseCase4r = (UseCaseFacade)shieldedResult;
212 }
213 catch (ClassCastException ex)
214 {
215
216 ActivityGraphFacadeLogic.logger.warn("incorrect metafacade cast for ActivityGraphFacadeLogic.getUseCase UseCaseFacade " + result + ": " + shieldedResult);
217 }
218
219 return getUseCase4r;
220 }
221
222
223
224
225
226 protected abstract Object handleGetUseCase();
227
228
229
230
231
232 @Override
233 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
234 {
235 super.validateInvariants(validationMessages);
236 }
237 }