1
2
3
4 package org.andromda.metafacades.uml14;
5
6 /***
7 * MetafacadeLogic for org.andromda.metafacades.uml.FrontEndUseCase
8 *
9 * @see org.andromda.metafacades.uml.FrontEndUseCase
10 */
11 public abstract class FrontEndUseCaseLogic
12 extends org.andromda.metafacades.uml14.UseCaseFacadeLogicImpl
13 implements org.andromda.metafacades.uml.FrontEndUseCase
14 {
15
16 protected Object metaObject;
17
18 public FrontEndUseCaseLogic(Object metaObject, String context)
19 {
20 super((org.omg.uml.behavioralelements.usecases.UseCase)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.FrontEndUseCase";
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.FrontEndUseCase
50 */
51 public boolean isFrontEndUseCaseMetaType()
52 {
53 return true;
54 }
55
56
57
58 /***
59 * @see org.andromda.metafacades.uml.FrontEndUseCase#isEntryUseCase()
60 */
61 protected abstract boolean handleIsEntryUseCase();
62
63 private void handleIsEntryUseCase1aPreCondition()
64 {
65 }
66
67 private void handleIsEntryUseCase1aPostCondition()
68 {
69 }
70
71 private boolean __entryUseCase1a;
72 private boolean __entryUseCase1aSet = false;
73
74 public final boolean isEntryUseCase()
75 {
76 boolean entryUseCase1a = this.__entryUseCase1a;
77 if (!this.__entryUseCase1aSet)
78 {
79 handleIsEntryUseCase1aPreCondition();
80 entryUseCase1a = handleIsEntryUseCase();
81 handleIsEntryUseCase1aPostCondition();
82 this.__entryUseCase1a = entryUseCase1a;
83 if (isMetafacadePropertyCachingEnabled())
84 {
85 this.__entryUseCase1aSet = true;
86 }
87 }
88 return entryUseCase1a;
89 }
90
91 /***
92 * @see org.andromda.metafacades.uml.FrontEndUseCase#isSecured()
93 */
94 protected abstract boolean handleIsSecured();
95
96 private void handleIsSecured2aPreCondition()
97 {
98 }
99
100 private void handleIsSecured2aPostCondition()
101 {
102 }
103
104 private boolean __secured2a;
105 private boolean __secured2aSet = false;
106
107 public final boolean isSecured()
108 {
109 boolean secured2a = this.__secured2a;
110 if (!this.__secured2aSet)
111 {
112 handleIsSecured2aPreCondition();
113 secured2a = handleIsSecured();
114 handleIsSecured2aPostCondition();
115 this.__secured2a = secured2a;
116 if (isMetafacadePropertyCachingEnabled())
117 {
118 this.__secured2aSet = true;
119 }
120 }
121 return secured2a;
122 }
123
124
125
126 private void handleGetController1rPreCondition()
127 {
128 }
129
130 private void handleGetController1rPostCondition()
131 {
132 }
133
134 private org.andromda.metafacades.uml.FrontEndController __getController1r;
135 private boolean __getController1rSet = false;
136
137 public final org.andromda.metafacades.uml.FrontEndController getController()
138 {
139 org.andromda.metafacades.uml.FrontEndController getController1r = this.__getController1r;
140 if (!this.__getController1rSet)
141 {
142 handleGetController1rPreCondition();
143 Object result = this.shieldedElement(handleGetController());
144 try
145 {
146 getController1r = (org.andromda.metafacades.uml.FrontEndController)result;
147 }
148 catch (ClassCastException ex)
149 {
150
151
152 }
153 handleGetController1rPostCondition();
154 this.__getController1r = getController1r;
155 if (isMetafacadePropertyCachingEnabled())
156 {
157 this.__getController1rSet = true;
158 }
159 }
160 return getController1r;
161 }
162
163 protected abstract java.lang.Object handleGetController();
164
165 private void handleGetActivityGraph2rPreCondition()
166 {
167 }
168
169 private void handleGetActivityGraph2rPostCondition()
170 {
171 }
172
173 private org.andromda.metafacades.uml.FrontEndActivityGraph __getActivityGraph2r;
174 private boolean __getActivityGraph2rSet = false;
175
176 public final org.andromda.metafacades.uml.FrontEndActivityGraph getActivityGraph()
177 {
178 org.andromda.metafacades.uml.FrontEndActivityGraph getActivityGraph2r = this.__getActivityGraph2r;
179 if (!this.__getActivityGraph2rSet)
180 {
181 handleGetActivityGraph2rPreCondition();
182 Object result = this.shieldedElement(handleGetActivityGraph());
183 try
184 {
185 getActivityGraph2r = (org.andromda.metafacades.uml.FrontEndActivityGraph)result;
186 }
187 catch (ClassCastException ex)
188 {
189
190
191 }
192 handleGetActivityGraph2rPostCondition();
193 this.__getActivityGraph2r = getActivityGraph2r;
194 if (isMetafacadePropertyCachingEnabled())
195 {
196 this.__getActivityGraph2rSet = true;
197 }
198 }
199 return getActivityGraph2r;
200 }
201
202 protected abstract java.lang.Object handleGetActivityGraph();
203
204 private void handleGetAllUseCases4rPreCondition()
205 {
206 }
207
208 private void handleGetAllUseCases4rPostCondition()
209 {
210 }
211
212 private java.util.List __getAllUseCases4r;
213 private boolean __getAllUseCases4rSet = false;
214
215 public final java.util.List getAllUseCases()
216 {
217 java.util.List getAllUseCases4r = this.__getAllUseCases4r;
218 if (!this.__getAllUseCases4rSet)
219 {
220 handleGetAllUseCases4rPreCondition();
221 Object result = this.shieldedElements(handleGetAllUseCases());
222 try
223 {
224 getAllUseCases4r = (java.util.List)result;
225 }
226 catch (ClassCastException ex)
227 {
228
229
230 }
231 handleGetAllUseCases4rPostCondition();
232 this.__getAllUseCases4r = getAllUseCases4r;
233 if (isMetafacadePropertyCachingEnabled())
234 {
235 this.__getAllUseCases4rSet = true;
236 }
237 }
238 return getAllUseCases4r;
239 }
240
241 protected abstract java.util.List handleGetAllUseCases();
242
243 private void handleGetRoles5rPreCondition()
244 {
245 }
246
247 private void handleGetRoles5rPostCondition()
248 {
249 }
250
251 private java.util.List __getRoles5r;
252 private boolean __getRoles5rSet = false;
253
254 public final java.util.List getRoles()
255 {
256 java.util.List getRoles5r = this.__getRoles5r;
257 if (!this.__getRoles5rSet)
258 {
259 handleGetRoles5rPreCondition();
260 Object result = this.shieldedElements(handleGetRoles());
261 try
262 {
263 getRoles5r = (java.util.List)result;
264 }
265 catch (ClassCastException ex)
266 {
267
268
269 }
270 handleGetRoles5rPostCondition();
271 this.__getRoles5r = getRoles5r;
272 if (isMetafacadePropertyCachingEnabled())
273 {
274 this.__getRoles5rSet = true;
275 }
276 }
277 return getRoles5r;
278 }
279
280 protected abstract java.util.List handleGetRoles();
281
282 private void handleGetAllRoles6rPreCondition()
283 {
284 }
285
286 private void handleGetAllRoles6rPostCondition()
287 {
288 }
289
290 private java.util.List __getAllRoles6r;
291 private boolean __getAllRoles6rSet = false;
292
293 public final java.util.List getAllRoles()
294 {
295 java.util.List getAllRoles6r = this.__getAllRoles6r;
296 if (!this.__getAllRoles6rSet)
297 {
298 handleGetAllRoles6rPreCondition();
299 Object result = this.shieldedElements(handleGetAllRoles());
300 try
301 {
302 getAllRoles6r = (java.util.List)result;
303 }
304 catch (ClassCastException ex)
305 {
306
307
308 }
309 handleGetAllRoles6rPostCondition();
310 this.__getAllRoles6r = getAllRoles6r;
311 if (isMetafacadePropertyCachingEnabled())
312 {
313 this.__getAllRoles6rSet = true;
314 }
315 }
316 return getAllRoles6r;
317 }
318
319 protected abstract java.util.List handleGetAllRoles();
320
321 private void handleGetViews7rPreCondition()
322 {
323 }
324
325 private void handleGetViews7rPostCondition()
326 {
327 }
328
329 private java.util.List __getViews7r;
330 private boolean __getViews7rSet = false;
331
332 public final java.util.List getViews()
333 {
334 java.util.List getViews7r = this.__getViews7r;
335 if (!this.__getViews7rSet)
336 {
337 handleGetViews7rPreCondition();
338 Object result = this.shieldedElements(handleGetViews());
339 try
340 {
341 getViews7r = (java.util.List)result;
342 }
343 catch (ClassCastException ex)
344 {
345
346
347 }
348 handleGetViews7rPostCondition();
349 this.__getViews7r = getViews7r;
350 if (isMetafacadePropertyCachingEnabled())
351 {
352 this.__getViews7rSet = true;
353 }
354 }
355 return getViews7r;
356 }
357
358 protected abstract java.util.List handleGetViews();
359
360 private void handleGetReferencingFinalStates9rPreCondition()
361 {
362 }
363
364 private void handleGetReferencingFinalStates9rPostCondition()
365 {
366 }
367
368 private java.util.List __getReferencingFinalStates9r;
369 private boolean __getReferencingFinalStates9rSet = false;
370
371 public final java.util.List getReferencingFinalStates()
372 {
373 java.util.List getReferencingFinalStates9r = this.__getReferencingFinalStates9r;
374 if (!this.__getReferencingFinalStates9rSet)
375 {
376 handleGetReferencingFinalStates9rPreCondition();
377 Object result = this.shieldedElements(handleGetReferencingFinalStates());
378 try
379 {
380 getReferencingFinalStates9r = (java.util.List)result;
381 }
382 catch (ClassCastException ex)
383 {
384
385
386 }
387 handleGetReferencingFinalStates9rPostCondition();
388 this.__getReferencingFinalStates9r = getReferencingFinalStates9r;
389 if (isMetafacadePropertyCachingEnabled())
390 {
391 this.__getReferencingFinalStates9rSet = true;
392 }
393 }
394 return getReferencingFinalStates9r;
395 }
396
397 protected abstract java.util.List handleGetReferencingFinalStates();
398
399 private void handleGetActions10rPreCondition()
400 {
401 }
402
403 private void handleGetActions10rPostCondition()
404 {
405 }
406
407 private java.util.List __getActions10r;
408 private boolean __getActions10rSet = false;
409
410 public final java.util.List getActions()
411 {
412 java.util.List getActions10r = this.__getActions10r;
413 if (!this.__getActions10rSet)
414 {
415 handleGetActions10rPreCondition();
416 Object result = this.shieldedElements(handleGetActions());
417 try
418 {
419 getActions10r = (java.util.List)result;
420 }
421 catch (ClassCastException ex)
422 {
423
424
425 }
426 handleGetActions10rPostCondition();
427 this.__getActions10r = getActions10r;
428 if (isMetafacadePropertyCachingEnabled())
429 {
430 this.__getActions10rSet = true;
431 }
432 }
433 return getActions10r;
434 }
435
436 protected abstract java.util.List handleGetActions();
437
438 private void handleGetInitialView11rPreCondition()
439 {
440 }
441
442 private void handleGetInitialView11rPostCondition()
443 {
444 }
445
446 private org.andromda.metafacades.uml.FrontEndView __getInitialView11r;
447 private boolean __getInitialView11rSet = false;
448
449 public final org.andromda.metafacades.uml.FrontEndView getInitialView()
450 {
451 org.andromda.metafacades.uml.FrontEndView getInitialView11r = this.__getInitialView11r;
452 if (!this.__getInitialView11rSet)
453 {
454 handleGetInitialView11rPreCondition();
455 Object result = this.shieldedElement(handleGetInitialView());
456 try
457 {
458 getInitialView11r = (org.andromda.metafacades.uml.FrontEndView)result;
459 }
460 catch (ClassCastException ex)
461 {
462
463
464 }
465 handleGetInitialView11rPostCondition();
466 this.__getInitialView11r = getInitialView11r;
467 if (isMetafacadePropertyCachingEnabled())
468 {
469 this.__getInitialView11rSet = true;
470 }
471 }
472 return getInitialView11r;
473 }
474
475 protected abstract java.lang.Object handleGetInitialView();
476
477 private void handleGetViewVariables12rPreCondition()
478 {
479 }
480
481 private void handleGetViewVariables12rPostCondition()
482 {
483 }
484
485 private java.util.List __getViewVariables12r;
486 private boolean __getViewVariables12rSet = false;
487
488 public final java.util.List getViewVariables()
489 {
490 java.util.List getViewVariables12r = this.__getViewVariables12r;
491 if (!this.__getViewVariables12rSet)
492 {
493 handleGetViewVariables12rPreCondition();
494 Object result = this.shieldedElements(handleGetViewVariables());
495 try
496 {
497 getViewVariables12r = (java.util.List)result;
498 }
499 catch (ClassCastException ex)
500 {
501
502
503 }
504 handleGetViewVariables12rPostCondition();
505 this.__getViewVariables12r = getViewVariables12r;
506 if (isMetafacadePropertyCachingEnabled())
507 {
508 this.__getViewVariables12rSet = true;
509 }
510 }
511 return getViewVariables12r;
512 }
513
514 protected abstract java.util.List handleGetViewVariables();
515
516 /***
517 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
518 */
519 public void validateInvariants(java.util.Collection validationMessages)
520 {
521 super.validateInvariants(validationMessages);
522 {
523 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.notEmpty(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"activityGraph")));
524 if (!constraintValid)
525 validationMessages.add(
526 new org.andromda.core.metafacade.ModelValidationMessage(
527 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
528 "org::andromda::metafacades::uml::FrontEndUseCase::each usecase needs one and only one graph",
529 "Each use-case needs one and only one activity graph."));
530 }
531 {
532 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.one(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"allUseCases"),new org.apache.commons.collections.Predicate(){public boolean evaluate(java.lang.Object object){return Boolean.valueOf(String.valueOf(org.andromda.translation.ocl.validation.OCLExpressions.equal(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(object,"entryUseCase"),true))).booleanValue();}}));
533 if (!constraintValid)
534 validationMessages.add(
535 new org.andromda.core.metafacade.ModelValidationMessage(
536 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
537 "org::andromda::metafacades::uml::FrontEndUseCase::one and only one usecase must be a FrontEndApplication",
538 "One and only one use-case must be marked as the application entry use-case. Currently this is done by adding the FrontEndApplication stereotype to it."));
539 }
540 {
541 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.notEmpty(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"name"))&&org.andromda.translation.ocl.validation.OCLCollections.isUnique(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"model.allUseCases"),new org.apache.commons.collections.Transformer(){public Object transform(java.lang.Object object){return org.andromda.translation.ocl.validation.OCLIntrospector.invoke(object,"name");}}));
542 if (!constraintValid)
543 validationMessages.add(
544 new org.andromda.core.metafacade.ModelValidationMessage(
545 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
546 "org::andromda::metafacades::uml::FrontEndUseCase::non-empty unique usecase name",
547 "Each use-case must have a non-empty name that is unique among all use-cases."));
548 }
549 {
550 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.notEmpty(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"packageName")));
551 if (!constraintValid)
552 validationMessages.add(
553 new org.andromda.core.metafacade.ModelValidationMessage(
554 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
555 "org::andromda::metafacades::uml::FrontEndUseCase::each front-end use-case needs to be in a package",
556 "Each front-end use-case is required to be modeled in a package, doing otherwise will result in uncompileable code due to filename collisions."));
557 }
558 }
559
560 /***
561 * The property that stores the name of the metafacade.
562 */
563 private static final String NAME_PROPERTY = "name";
564
565 /***
566 * @see java.lang.Object#toString()
567 */
568 public String toString()
569 {
570 final StringBuffer toString = new StringBuffer(this.getClass().getName());
571 toString.append("[");
572 try
573 {
574 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
575 }
576 catch (final Throwable throwable)
577 {
578
579 }
580 toString.append("]");
581 return toString.toString();
582 }
583 }