1
2
3
4 package org.andromda.metafacades.uml14;
5
6 /***
7 * MetafacadeLogic for org.andromda.metafacades.uml.FrontEndAction
8 *
9 * @see org.andromda.metafacades.uml.FrontEndAction
10 */
11 public abstract class FrontEndActionLogic
12 extends org.andromda.metafacades.uml14.FrontEndForwardLogicImpl
13 implements org.andromda.metafacades.uml.FrontEndAction
14 {
15
16 protected Object metaObject;
17
18 public FrontEndActionLogic(Object metaObject, String context)
19 {
20 super(metaObject, getContext(context));
21 this.metaObject = metaObject;
22 }
23
24 /***
25 * Gets the context for this metafacade logic instance.
26 */
27 private static String getContext(String context)
28 {
29 if (context == null)
30 {
31 context = "org.andromda.metafacades.uml.FrontEndAction";
32 }
33 return context;
34 }
35
36 /***
37 * @see org.andromda.core.metafacade.MetafacadeBase
38 */
39 public void resetMetafacadeContext(String context)
40 {
41 if (!this.contextRoot)
42 {
43 context = getContext(context);
44 setMetafacadeContext (context);
45 }
46 }
47
48 /***
49 * @see org.andromda.metafacades.uml.FrontEndAction
50 */
51 public boolean isFrontEndActionMetaType()
52 {
53 return true;
54 }
55
56
57
58 /***
59 * @see org.andromda.metafacades.uml.FrontEndAction#isUseCaseStart()
60 */
61 protected abstract boolean handleIsUseCaseStart();
62
63 private void handleIsUseCaseStart1aPreCondition()
64 {
65 }
66
67 private void handleIsUseCaseStart1aPostCondition()
68 {
69 }
70
71 private boolean __useCaseStart1a;
72 private boolean __useCaseStart1aSet = false;
73
74 public final boolean isUseCaseStart()
75 {
76 boolean useCaseStart1a = this.__useCaseStart1a;
77 if (!this.__useCaseStart1aSet)
78 {
79 handleIsUseCaseStart1aPreCondition();
80 useCaseStart1a = handleIsUseCaseStart();
81 handleIsUseCaseStart1aPostCondition();
82 this.__useCaseStart1a = useCaseStart1a;
83 if (isMetafacadePropertyCachingEnabled())
84 {
85 this.__useCaseStart1aSet = true;
86 }
87 }
88 return useCaseStart1a;
89 }
90
91
92
93 protected abstract org.andromda.metafacades.uml.ParameterFacade handleFindParameter(java.lang.String name);
94
95 private void handleFindParameter1oPreCondition()
96 {
97 }
98
99 private void handleFindParameter1oPostCondition()
100 {
101 }
102
103 public org.andromda.metafacades.uml.ParameterFacade findParameter(java.lang.String name)
104 {
105 handleFindParameter1oPreCondition();
106 org.andromda.metafacades.uml.ParameterFacade returnValue = handleFindParameter(name);
107 handleFindParameter1oPostCondition();
108 return returnValue;
109 }
110
111
112
113 private void handleGetInput1rPreCondition()
114 {
115 }
116
117 private void handleGetInput1rPostCondition()
118 {
119 }
120
121 private org.andromda.metafacades.uml.FrontEndView __getInput1r;
122 private boolean __getInput1rSet = false;
123
124 public final org.andromda.metafacades.uml.FrontEndView getInput()
125 {
126 org.andromda.metafacades.uml.FrontEndView getInput1r = this.__getInput1r;
127 if (!this.__getInput1rSet)
128 {
129 handleGetInput1rPreCondition();
130 Object result = this.shieldedElement(handleGetInput());
131 try
132 {
133 getInput1r = (org.andromda.metafacades.uml.FrontEndView)result;
134 }
135 catch (ClassCastException ex)
136 {
137
138
139 }
140 handleGetInput1rPostCondition();
141 this.__getInput1r = getInput1r;
142 if (isMetafacadePropertyCachingEnabled())
143 {
144 this.__getInput1rSet = true;
145 }
146 }
147 return getInput1r;
148 }
149
150 protected abstract java.lang.Object handleGetInput();
151
152 private void handleGetParameters2rPreCondition()
153 {
154 }
155
156 private void handleGetParameters2rPostCondition()
157 {
158 }
159
160 private java.util.List __getParameters2r;
161 private boolean __getParameters2rSet = false;
162
163 public final java.util.List getParameters()
164 {
165 java.util.List getParameters2r = this.__getParameters2r;
166 if (!this.__getParameters2rSet)
167 {
168 handleGetParameters2rPreCondition();
169 Object result = this.shieldedElements(handleGetParameters());
170 try
171 {
172 getParameters2r = (java.util.List)result;
173 }
174 catch (ClassCastException ex)
175 {
176
177
178 }
179 handleGetParameters2rPostCondition();
180 this.__getParameters2r = getParameters2r;
181 if (isMetafacadePropertyCachingEnabled())
182 {
183 this.__getParameters2rSet = true;
184 }
185 }
186 return getParameters2r;
187 }
188
189 protected abstract java.util.List handleGetParameters();
190
191 private void handleGetDeferredOperations4rPreCondition()
192 {
193 }
194
195 private void handleGetDeferredOperations4rPostCondition()
196 {
197 }
198
199 private java.util.List __getDeferredOperations4r;
200 private boolean __getDeferredOperations4rSet = false;
201
202 public final java.util.List getDeferredOperations()
203 {
204 java.util.List getDeferredOperations4r = this.__getDeferredOperations4r;
205 if (!this.__getDeferredOperations4rSet)
206 {
207 handleGetDeferredOperations4rPreCondition();
208 Object result = this.shieldedElements(handleGetDeferredOperations());
209 try
210 {
211 getDeferredOperations4r = (java.util.List)result;
212 }
213 catch (ClassCastException ex)
214 {
215
216
217 }
218 handleGetDeferredOperations4rPostCondition();
219 this.__getDeferredOperations4r = getDeferredOperations4r;
220 if (isMetafacadePropertyCachingEnabled())
221 {
222 this.__getDeferredOperations4rSet = true;
223 }
224 }
225 return getDeferredOperations4r;
226 }
227
228 protected abstract java.util.List handleGetDeferredOperations();
229
230 private void handleGetController5rPreCondition()
231 {
232 }
233
234 private void handleGetController5rPostCondition()
235 {
236 }
237
238 private org.andromda.metafacades.uml.FrontEndController __getController5r;
239 private boolean __getController5rSet = false;
240
241 public final org.andromda.metafacades.uml.FrontEndController getController()
242 {
243 org.andromda.metafacades.uml.FrontEndController getController5r = this.__getController5r;
244 if (!this.__getController5rSet)
245 {
246 handleGetController5rPreCondition();
247 Object result = this.shieldedElement(handleGetController());
248 try
249 {
250 getController5r = (org.andromda.metafacades.uml.FrontEndController)result;
251 }
252 catch (ClassCastException ex)
253 {
254
255
256 }
257 handleGetController5rPostCondition();
258 this.__getController5r = getController5r;
259 if (isMetafacadePropertyCachingEnabled())
260 {
261 this.__getController5rSet = true;
262 }
263 }
264 return getController5r;
265 }
266
267 protected abstract java.lang.Object handleGetController();
268
269 private void handleGetActionStates6rPreCondition()
270 {
271 }
272
273 private void handleGetActionStates6rPostCondition()
274 {
275 }
276
277 private java.util.List __getActionStates6r;
278 private boolean __getActionStates6rSet = false;
279
280 public final java.util.List getActionStates()
281 {
282 java.util.List getActionStates6r = this.__getActionStates6r;
283 if (!this.__getActionStates6rSet)
284 {
285 handleGetActionStates6rPreCondition();
286 Object result = this.shieldedElements(handleGetActionStates());
287 try
288 {
289 getActionStates6r = (java.util.List)result;
290 }
291 catch (ClassCastException ex)
292 {
293
294
295 }
296 handleGetActionStates6rPostCondition();
297 this.__getActionStates6r = getActionStates6r;
298 if (isMetafacadePropertyCachingEnabled())
299 {
300 this.__getActionStates6rSet = true;
301 }
302 }
303 return getActionStates6r;
304 }
305
306 protected abstract java.util.List handleGetActionStates();
307
308 private void handleGetDecisionTransitions8rPreCondition()
309 {
310 }
311
312 private void handleGetDecisionTransitions8rPostCondition()
313 {
314 }
315
316 private java.util.List __getDecisionTransitions8r;
317 private boolean __getDecisionTransitions8rSet = false;
318
319 public final java.util.List getDecisionTransitions()
320 {
321 java.util.List getDecisionTransitions8r = this.__getDecisionTransitions8r;
322 if (!this.__getDecisionTransitions8rSet)
323 {
324 handleGetDecisionTransitions8rPreCondition();
325 Object result = this.shieldedElements(handleGetDecisionTransitions());
326 try
327 {
328 getDecisionTransitions8r = (java.util.List)result;
329 }
330 catch (ClassCastException ex)
331 {
332
333
334 }
335 handleGetDecisionTransitions8rPostCondition();
336 this.__getDecisionTransitions8r = getDecisionTransitions8r;
337 if (isMetafacadePropertyCachingEnabled())
338 {
339 this.__getDecisionTransitions8rSet = true;
340 }
341 }
342 return getDecisionTransitions8r;
343 }
344
345 protected abstract java.util.List handleGetDecisionTransitions();
346
347 private void handleGetTransitions11rPreCondition()
348 {
349 }
350
351 private void handleGetTransitions11rPostCondition()
352 {
353 }
354
355 private java.util.List __getTransitions11r;
356 private boolean __getTransitions11rSet = false;
357
358 public final java.util.List getTransitions()
359 {
360 java.util.List getTransitions11r = this.__getTransitions11r;
361 if (!this.__getTransitions11rSet)
362 {
363 handleGetTransitions11rPreCondition();
364 Object result = this.shieldedElements(handleGetTransitions());
365 try
366 {
367 getTransitions11r = (java.util.List)result;
368 }
369 catch (ClassCastException ex)
370 {
371
372
373 }
374 handleGetTransitions11rPostCondition();
375 this.__getTransitions11r = getTransitions11r;
376 if (isMetafacadePropertyCachingEnabled())
377 {
378 this.__getTransitions11rSet = true;
379 }
380 }
381 return getTransitions11r;
382 }
383
384 protected abstract java.util.List handleGetTransitions();
385
386 private void handleGetFormFields12rPreCondition()
387 {
388 }
389
390 private void handleGetFormFields12rPostCondition()
391 {
392 }
393
394 private java.util.List __getFormFields12r;
395 private boolean __getFormFields12rSet = false;
396
397 public final java.util.List getFormFields()
398 {
399 java.util.List getFormFields12r = this.__getFormFields12r;
400 if (!this.__getFormFields12rSet)
401 {
402 handleGetFormFields12rPreCondition();
403 Object result = this.shieldedElements(handleGetFormFields());
404 try
405 {
406 getFormFields12r = (java.util.List)result;
407 }
408 catch (ClassCastException ex)
409 {
410
411
412 }
413 handleGetFormFields12rPostCondition();
414 this.__getFormFields12r = getFormFields12r;
415 if (isMetafacadePropertyCachingEnabled())
416 {
417 this.__getFormFields12rSet = true;
418 }
419 }
420 return getFormFields12r;
421 }
422
423 protected abstract java.util.List handleGetFormFields();
424
425 private void handleGetActionForwards13rPreCondition()
426 {
427 }
428
429 private void handleGetActionForwards13rPostCondition()
430 {
431 }
432
433 private java.util.List __getActionForwards13r;
434 private boolean __getActionForwards13rSet = false;
435
436 public final java.util.List getActionForwards()
437 {
438 java.util.List getActionForwards13r = this.__getActionForwards13r;
439 if (!this.__getActionForwards13rSet)
440 {
441 handleGetActionForwards13rPreCondition();
442 Object result = this.shieldedElements(handleGetActionForwards());
443 try
444 {
445 getActionForwards13r = (java.util.List)result;
446 }
447 catch (ClassCastException ex)
448 {
449
450
451 }
452 handleGetActionForwards13rPostCondition();
453 this.__getActionForwards13r = getActionForwards13r;
454 if (isMetafacadePropertyCachingEnabled())
455 {
456 this.__getActionForwards13rSet = true;
457 }
458 }
459 return getActionForwards13r;
460 }
461
462 protected abstract java.util.List handleGetActionForwards();
463
464 private void handleGetTargetViews14rPreCondition()
465 {
466 }
467
468 private void handleGetTargetViews14rPostCondition()
469 {
470 }
471
472 private java.util.List __getTargetViews14r;
473 private boolean __getTargetViews14rSet = false;
474
475 public final java.util.List getTargetViews()
476 {
477 java.util.List getTargetViews14r = this.__getTargetViews14r;
478 if (!this.__getTargetViews14rSet)
479 {
480 handleGetTargetViews14rPreCondition();
481 Object result = this.shieldedElements(handleGetTargetViews());
482 try
483 {
484 getTargetViews14r = (java.util.List)result;
485 }
486 catch (ClassCastException ex)
487 {
488
489
490 }
491 handleGetTargetViews14rPostCondition();
492 this.__getTargetViews14r = getTargetViews14r;
493 if (isMetafacadePropertyCachingEnabled())
494 {
495 this.__getTargetViews14rSet = true;
496 }
497 }
498 return getTargetViews14r;
499 }
500
501 protected abstract java.util.List handleGetTargetViews();
502
503 /***
504 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
505 */
506 public void validateInvariants(java.util.Collection validationMessages)
507 {
508 super.validateInvariants(validationMessages);
509 {
510 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.isUnique(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"parameters"),new org.apache.commons.collections.Transformer(){public Object transform(java.lang.Object object){return org.andromda.translation.ocl.validation.OCLIntrospector.invoke(object,"name");}}));
511 if (!constraintValid)
512 validationMessages.add(
513 new org.andromda.core.metafacade.ModelValidationMessage(
514 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
515 "org::andromda::metafacades::uml::FrontEndAction::parameters must be unique",
516 "Each front-end action parameter must have a unique name."));
517 }
518 {
519 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(Boolean.valueOf(String.valueOf(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"exitingView"))).booleanValue())).booleanValue()?Boolean.valueOf(String.valueOf(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"triggerPresent"))).booleanValue():true));
520 if (!constraintValid)
521 validationMessages.add(
522 new org.andromda.core.metafacade.ModelValidationMessage(
523 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
524 "org::andromda::metafacades::uml::FrontEndAction::each action must carry a trigger",
525 "Each action transition coming out of a view must have a trigger (the name is sufficient), it is recommended to add a trigger of type 'signal'."));
526 }
527 }
528
529 /***
530 * The property that stores the name of the metafacade.
531 */
532 private static final String NAME_PROPERTY = "name";
533
534 /***
535 * @see java.lang.Object#toString()
536 */
537 public String toString()
538 {
539 final StringBuffer toString = new StringBuffer(this.getClass().getName());
540 toString.append("[");
541 try
542 {
543 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
544 }
545 catch (final Throwable throwable)
546 {
547
548 }
549 toString.append("]");
550 return toString.toString();
551 }
552 }