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.FrontEndAction;
11 import org.andromda.metafacades.uml.FrontEndControllerOperation;
12 import org.andromda.metafacades.uml.FrontEndParameter;
13 import org.andromda.metafacades.uml.FrontEndView;
14 import org.apache.log4j.Logger;
15 import org.omg.uml.foundation.core.Parameter;
16
17
18
19
20
21
22
23 public abstract class FrontEndParameterLogic
24 extends ParameterFacadeLogicImpl
25 implements FrontEndParameter
26 {
27
28
29
30
31 protected Object metaObject;
32
33
34
35
36
37 protected FrontEndParameterLogic(Object metaObjectIn, String context)
38 {
39 super((Parameter)metaObjectIn, getContext(context));
40 this.metaObject = metaObjectIn;
41 }
42
43
44
45
46 private static final Logger logger = Logger.getLogger(FrontEndParameterLogic.class);
47
48
49
50
51
52
53 private static String getContext(String context)
54 {
55 if (context == null)
56 {
57 context = "org.andromda.metafacades.uml.FrontEndParameter";
58 }
59 return context;
60 }
61
62
63
64
65 @Override
66 public void resetMetafacadeContext(String context)
67 {
68 if (!this.contextRoot)
69 {
70 context = getContext(context);
71 setMetafacadeContext (context);
72 }
73 }
74
75
76
77
78
79 public boolean isFrontEndParameterMetaType()
80 {
81 return true;
82 }
83
84
85
86
87
88
89
90 protected abstract boolean handleIsControllerOperationArgument();
91
92 private boolean __controllerOperationArgument1a;
93 private boolean __controllerOperationArgument1aSet = false;
94
95
96
97
98
99 public final boolean isControllerOperationArgument()
100 {
101 boolean controllerOperationArgument1a = this.__controllerOperationArgument1a;
102 if (!this.__controllerOperationArgument1aSet)
103 {
104
105 controllerOperationArgument1a = handleIsControllerOperationArgument();
106
107 this.__controllerOperationArgument1a = controllerOperationArgument1a;
108 if (isMetafacadePropertyCachingEnabled())
109 {
110 this.__controllerOperationArgument1aSet = true;
111 }
112 }
113 return controllerOperationArgument1a;
114 }
115
116
117
118
119
120 protected abstract boolean handleIsContainedInFrontEndUseCase();
121
122 private boolean __containedInFrontEndUseCase2a;
123 private boolean __containedInFrontEndUseCase2aSet = false;
124
125
126
127
128
129 public final boolean isContainedInFrontEndUseCase()
130 {
131 boolean containedInFrontEndUseCase2a = this.__containedInFrontEndUseCase2a;
132 if (!this.__containedInFrontEndUseCase2aSet)
133 {
134
135 containedInFrontEndUseCase2a = handleIsContainedInFrontEndUseCase();
136
137 this.__containedInFrontEndUseCase2a = containedInFrontEndUseCase2a;
138 if (isMetafacadePropertyCachingEnabled())
139 {
140 this.__containedInFrontEndUseCase2aSet = true;
141 }
142 }
143 return containedInFrontEndUseCase2a;
144 }
145
146
147
148
149
150 protected abstract boolean handleIsActionParameter();
151
152 private boolean __actionParameter3a;
153 private boolean __actionParameter3aSet = false;
154
155
156
157
158
159 public final boolean isActionParameter()
160 {
161 boolean actionParameter3a = this.__actionParameter3a;
162 if (!this.__actionParameter3aSet)
163 {
164
165 actionParameter3a = handleIsActionParameter();
166
167 this.__actionParameter3a = actionParameter3a;
168 if (isMetafacadePropertyCachingEnabled())
169 {
170 this.__actionParameter3aSet = true;
171 }
172 }
173 return actionParameter3a;
174 }
175
176
177
178
179
180 protected abstract boolean handleIsTable();
181
182 private boolean __table4a;
183 private boolean __table4aSet = false;
184
185
186
187
188
189 public final boolean isTable()
190 {
191 boolean table4a = this.__table4a;
192 if (!this.__table4aSet)
193 {
194
195 table4a = handleIsTable();
196
197 this.__table4a = table4a;
198 if (isMetafacadePropertyCachingEnabled())
199 {
200 this.__table4aSet = true;
201 }
202 }
203 return table4a;
204 }
205
206
207
208
209
210 protected abstract Collection<String> handleGetTableColumnNames();
211
212 private Collection<String> __tableColumnNames5a;
213 private boolean __tableColumnNames5aSet = false;
214
215
216
217
218
219
220
221 public final Collection<String> getTableColumnNames()
222 {
223 Collection<String> tableColumnNames5a = this.__tableColumnNames5a;
224 if (!this.__tableColumnNames5aSet)
225 {
226
227 tableColumnNames5a = handleGetTableColumnNames();
228
229 this.__tableColumnNames5a = tableColumnNames5a;
230 if (isMetafacadePropertyCachingEnabled())
231 {
232 this.__tableColumnNames5aSet = true;
233 }
234 }
235 return tableColumnNames5a;
236 }
237
238
239
240
241
242 protected abstract Collection<String> handleGetTableColumns();
243
244 private Collection<String> __tableColumns6a;
245 private boolean __tableColumns6aSet = false;
246
247
248
249
250
251
252 public final Collection<String> getTableColumns()
253 {
254 Collection<String> tableColumns6a = this.__tableColumns6a;
255 if (!this.__tableColumns6aSet)
256 {
257
258 tableColumns6a = handleGetTableColumns();
259
260 this.__tableColumns6a = tableColumns6a;
261 if (isMetafacadePropertyCachingEnabled())
262 {
263 this.__tableColumns6aSet = true;
264 }
265 }
266 return tableColumns6a;
267 }
268
269
270
271
272
273 protected abstract Collection<String> handleGetTableAttributeNames();
274
275 private Collection<String> __tableAttributeNames7a;
276 private boolean __tableAttributeNames7aSet = false;
277
278
279
280
281
282
283 public final Collection<String> getTableAttributeNames()
284 {
285 Collection<String> tableAttributeNames7a = this.__tableAttributeNames7a;
286 if (!this.__tableAttributeNames7aSet)
287 {
288
289 tableAttributeNames7a = handleGetTableAttributeNames();
290
291 this.__tableAttributeNames7a = tableAttributeNames7a;
292 if (isMetafacadePropertyCachingEnabled())
293 {
294 this.__tableAttributeNames7aSet = true;
295 }
296 }
297 return tableAttributeNames7a;
298 }
299
300
301
302 private FrontEndView __getView1r;
303 private boolean __getView1rSet = false;
304
305
306
307
308
309
310 public final FrontEndView getView()
311 {
312 FrontEndView getView1r = this.__getView1r;
313 if (!this.__getView1rSet)
314 {
315
316 Object result = handleGetView();
317 MetafacadeBase shieldedResult = this.shieldedElement(result);
318 try
319 {
320 getView1r = (FrontEndView)shieldedResult;
321 }
322 catch (ClassCastException ex)
323 {
324
325 FrontEndParameterLogic.logger.warn("incorrect metafacade cast for FrontEndParameterLogic.getView FrontEndView " + result + ": " + shieldedResult);
326 }
327
328 this.__getView1r = getView1r;
329 if (isMetafacadePropertyCachingEnabled())
330 {
331 this.__getView1rSet = true;
332 }
333 }
334 return getView1r;
335 }
336
337
338
339
340
341 protected abstract Object handleGetView();
342
343 private FrontEndAction __getAction2r;
344 private boolean __getAction2rSet = false;
345
346
347
348
349
350 public final FrontEndAction getAction()
351 {
352 FrontEndAction getAction2r = this.__getAction2r;
353 if (!this.__getAction2rSet)
354 {
355
356 Object result = handleGetAction();
357 MetafacadeBase shieldedResult = this.shieldedElement(result);
358 try
359 {
360 getAction2r = (FrontEndAction)shieldedResult;
361 }
362 catch (ClassCastException ex)
363 {
364
365 FrontEndParameterLogic.logger.warn("incorrect metafacade cast for FrontEndParameterLogic.getAction FrontEndAction " + result + ": " + shieldedResult);
366 }
367
368 this.__getAction2r = getAction2r;
369 if (isMetafacadePropertyCachingEnabled())
370 {
371 this.__getAction2rSet = true;
372 }
373 }
374 return getAction2r;
375 }
376
377
378
379
380
381 protected abstract Object handleGetAction();
382
383 private FrontEndControllerOperation __getControllerOperation3r;
384 private boolean __getControllerOperation3rSet = false;
385
386
387
388
389
390 public final FrontEndControllerOperation getControllerOperation()
391 {
392 FrontEndControllerOperation getControllerOperation3r = this.__getControllerOperation3r;
393 if (!this.__getControllerOperation3rSet)
394 {
395
396 Object result = handleGetControllerOperation();
397 MetafacadeBase shieldedResult = this.shieldedElement(result);
398 try
399 {
400 getControllerOperation3r = (FrontEndControllerOperation)shieldedResult;
401 }
402 catch (ClassCastException ex)
403 {
404
405 FrontEndParameterLogic.logger.warn("incorrect metafacade cast for FrontEndParameterLogic.getControllerOperation FrontEndControllerOperation " + result + ": " + shieldedResult);
406 }
407
408 this.__getControllerOperation3r = getControllerOperation3r;
409 if (isMetafacadePropertyCachingEnabled())
410 {
411 this.__getControllerOperation3rSet = true;
412 }
413 }
414 return getControllerOperation3r;
415 }
416
417
418
419
420
421 protected abstract Object handleGetControllerOperation();
422
423
424
425
426
427 @Override
428 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
429 {
430 super.validateInvariants(validationMessages);
431 }
432 }