1
2
3
4 package org.andromda.metafacades.uml14;
5
6 /***
7 * MetafacadeLogic for org.andromda.metafacades.uml.AssociationEndFacade
8 *
9 * @see org.andromda.metafacades.uml.AssociationEndFacade
10 */
11 public abstract class AssociationEndFacadeLogic
12 extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13 implements org.andromda.metafacades.uml.AssociationEndFacade
14 {
15
16 protected org.omg.uml.foundation.core.AssociationEnd metaObject;
17
18 public AssociationEndFacadeLogic(org.omg.uml.foundation.core.AssociationEnd 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.AssociationEndFacade";
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.AssociationEndFacade
50 */
51 public boolean isAssociationEndFacadeMetaType()
52 {
53 return true;
54 }
55
56
57
58 /***
59 * @see org.andromda.metafacades.uml.AssociationEndFacade#isOne2One()
60 */
61 protected abstract boolean handleIsOne2One();
62
63 private void handleIsOne2One1aPreCondition()
64 {
65 }
66
67 private void handleIsOne2One1aPostCondition()
68 {
69 }
70
71 private boolean __one2One1a;
72 private boolean __one2One1aSet = false;
73
74 public final boolean isOne2One()
75 {
76 boolean one2One1a = this.__one2One1a;
77 if (!this.__one2One1aSet)
78 {
79 handleIsOne2One1aPreCondition();
80 one2One1a = handleIsOne2One();
81 handleIsOne2One1aPostCondition();
82 this.__one2One1a = one2One1a;
83 if (isMetafacadePropertyCachingEnabled())
84 {
85 this.__one2One1aSet = true;
86 }
87 }
88 return one2One1a;
89 }
90
91 /***
92 * @see org.andromda.metafacades.uml.AssociationEndFacade#isOne2Many()
93 */
94 protected abstract boolean handleIsOne2Many();
95
96 private void handleIsOne2Many2aPreCondition()
97 {
98 }
99
100 private void handleIsOne2Many2aPostCondition()
101 {
102 }
103
104 private boolean __one2Many2a;
105 private boolean __one2Many2aSet = false;
106
107 public final boolean isOne2Many()
108 {
109 boolean one2Many2a = this.__one2Many2a;
110 if (!this.__one2Many2aSet)
111 {
112 handleIsOne2Many2aPreCondition();
113 one2Many2a = handleIsOne2Many();
114 handleIsOne2Many2aPostCondition();
115 this.__one2Many2a = one2Many2a;
116 if (isMetafacadePropertyCachingEnabled())
117 {
118 this.__one2Many2aSet = true;
119 }
120 }
121 return one2Many2a;
122 }
123
124 /***
125 * @see org.andromda.metafacades.uml.AssociationEndFacade#isMany2One()
126 */
127 protected abstract boolean handleIsMany2One();
128
129 private void handleIsMany2One3aPreCondition()
130 {
131 }
132
133 private void handleIsMany2One3aPostCondition()
134 {
135 }
136
137 private boolean __many2One3a;
138 private boolean __many2One3aSet = false;
139
140 public final boolean isMany2One()
141 {
142 boolean many2One3a = this.__many2One3a;
143 if (!this.__many2One3aSet)
144 {
145 handleIsMany2One3aPreCondition();
146 many2One3a = handleIsMany2One();
147 handleIsMany2One3aPostCondition();
148 this.__many2One3a = many2One3a;
149 if (isMetafacadePropertyCachingEnabled())
150 {
151 this.__many2One3aSet = true;
152 }
153 }
154 return many2One3a;
155 }
156
157 /***
158 * @see org.andromda.metafacades.uml.AssociationEndFacade#isMany2Many()
159 */
160 protected abstract boolean handleIsMany2Many();
161
162 private void handleIsMany2Many4aPreCondition()
163 {
164 }
165
166 private void handleIsMany2Many4aPostCondition()
167 {
168 }
169
170 private boolean __many2Many4a;
171 private boolean __many2Many4aSet = false;
172
173 public final boolean isMany2Many()
174 {
175 boolean many2Many4a = this.__many2Many4a;
176 if (!this.__many2Many4aSet)
177 {
178 handleIsMany2Many4aPreCondition();
179 many2Many4a = handleIsMany2Many();
180 handleIsMany2Many4aPostCondition();
181 this.__many2Many4a = many2Many4a;
182 if (isMetafacadePropertyCachingEnabled())
183 {
184 this.__many2Many4aSet = true;
185 }
186 }
187 return many2Many4a;
188 }
189
190 /***
191 * @see org.andromda.metafacades.uml.AssociationEndFacade#isAggregation()
192 */
193 protected abstract boolean handleIsAggregation();
194
195 private void handleIsAggregation5aPreCondition()
196 {
197 }
198
199 private void handleIsAggregation5aPostCondition()
200 {
201 }
202
203 private boolean __aggregation5a;
204 private boolean __aggregation5aSet = false;
205
206 public final boolean isAggregation()
207 {
208 boolean aggregation5a = this.__aggregation5a;
209 if (!this.__aggregation5aSet)
210 {
211 handleIsAggregation5aPreCondition();
212 aggregation5a = handleIsAggregation();
213 handleIsAggregation5aPostCondition();
214 this.__aggregation5a = aggregation5a;
215 if (isMetafacadePropertyCachingEnabled())
216 {
217 this.__aggregation5aSet = true;
218 }
219 }
220 return aggregation5a;
221 }
222
223 /***
224 * @see org.andromda.metafacades.uml.AssociationEndFacade#isComposition()
225 */
226 protected abstract boolean handleIsComposition();
227
228 private void handleIsComposition6aPreCondition()
229 {
230 }
231
232 private void handleIsComposition6aPostCondition()
233 {
234 }
235
236 private boolean __composition6a;
237 private boolean __composition6aSet = false;
238
239 public final boolean isComposition()
240 {
241 boolean composition6a = this.__composition6a;
242 if (!this.__composition6aSet)
243 {
244 handleIsComposition6aPreCondition();
245 composition6a = handleIsComposition();
246 handleIsComposition6aPostCondition();
247 this.__composition6a = composition6a;
248 if (isMetafacadePropertyCachingEnabled())
249 {
250 this.__composition6aSet = true;
251 }
252 }
253 return composition6a;
254 }
255
256 /***
257 * @see org.andromda.metafacades.uml.AssociationEndFacade#isOrdered()
258 */
259 protected abstract boolean handleIsOrdered();
260
261 private void handleIsOrdered7aPreCondition()
262 {
263 }
264
265 private void handleIsOrdered7aPostCondition()
266 {
267 }
268
269 private boolean __ordered7a;
270 private boolean __ordered7aSet = false;
271
272 public final boolean isOrdered()
273 {
274 boolean ordered7a = this.__ordered7a;
275 if (!this.__ordered7aSet)
276 {
277 handleIsOrdered7aPreCondition();
278 ordered7a = handleIsOrdered();
279 handleIsOrdered7aPostCondition();
280 this.__ordered7a = ordered7a;
281 if (isMetafacadePropertyCachingEnabled())
282 {
283 this.__ordered7aSet = true;
284 }
285 }
286 return ordered7a;
287 }
288
289 /***
290 * @see org.andromda.metafacades.uml.AssociationEndFacade#isReadOnly()
291 */
292 protected abstract boolean handleIsReadOnly();
293
294 private void handleIsReadOnly8aPreCondition()
295 {
296 }
297
298 private void handleIsReadOnly8aPostCondition()
299 {
300 }
301
302 private boolean __readOnly8a;
303 private boolean __readOnly8aSet = false;
304
305 public final boolean isReadOnly()
306 {
307 boolean readOnly8a = this.__readOnly8a;
308 if (!this.__readOnly8aSet)
309 {
310 handleIsReadOnly8aPreCondition();
311 readOnly8a = handleIsReadOnly();
312 handleIsReadOnly8aPostCondition();
313 this.__readOnly8a = readOnly8a;
314 if (isMetafacadePropertyCachingEnabled())
315 {
316 this.__readOnly8aSet = true;
317 }
318 }
319 return readOnly8a;
320 }
321
322 /***
323 * @see org.andromda.metafacades.uml.AssociationEndFacade#isNavigable()
324 */
325 protected abstract boolean handleIsNavigable();
326
327 private void handleIsNavigable9aPreCondition()
328 {
329 }
330
331 private void handleIsNavigable9aPostCondition()
332 {
333 }
334
335 private boolean __navigable9a;
336 private boolean __navigable9aSet = false;
337
338 public final boolean isNavigable()
339 {
340 boolean navigable9a = this.__navigable9a;
341 if (!this.__navigable9aSet)
342 {
343 handleIsNavigable9aPreCondition();
344 navigable9a = handleIsNavigable();
345 handleIsNavigable9aPostCondition();
346 this.__navigable9a = navigable9a;
347 if (isMetafacadePropertyCachingEnabled())
348 {
349 this.__navigable9aSet = true;
350 }
351 }
352 return navigable9a;
353 }
354
355 /***
356 * @see org.andromda.metafacades.uml.AssociationEndFacade#getGetterName()
357 */
358 protected abstract java.lang.String handleGetGetterName();
359
360 private void handleGetGetterName10aPreCondition()
361 {
362 }
363
364 private void handleGetGetterName10aPostCondition()
365 {
366 }
367
368 private java.lang.String __getterName10a;
369 private boolean __getterName10aSet = false;
370
371 public final java.lang.String getGetterName()
372 {
373 java.lang.String getterName10a = this.__getterName10a;
374 if (!this.__getterName10aSet)
375 {
376 handleGetGetterName10aPreCondition();
377 getterName10a = handleGetGetterName();
378 handleGetGetterName10aPostCondition();
379 this.__getterName10a = getterName10a;
380 if (isMetafacadePropertyCachingEnabled())
381 {
382 this.__getterName10aSet = true;
383 }
384 }
385 return getterName10a;
386 }
387
388 /***
389 * @see org.andromda.metafacades.uml.AssociationEndFacade#getSetterName()
390 */
391 protected abstract java.lang.String handleGetSetterName();
392
393 private void handleGetSetterName11aPreCondition()
394 {
395 }
396
397 private void handleGetSetterName11aPostCondition()
398 {
399 }
400
401 private java.lang.String __setterName11a;
402 private boolean __setterName11aSet = false;
403
404 public final java.lang.String getSetterName()
405 {
406 java.lang.String setterName11a = this.__setterName11a;
407 if (!this.__setterName11aSet)
408 {
409 handleGetSetterName11aPreCondition();
410 setterName11a = handleGetSetterName();
411 handleGetSetterName11aPostCondition();
412 this.__setterName11a = setterName11a;
413 if (isMetafacadePropertyCachingEnabled())
414 {
415 this.__setterName11aSet = true;
416 }
417 }
418 return setterName11a;
419 }
420
421 /***
422 * @see org.andromda.metafacades.uml.AssociationEndFacade#getGetterSetterTypeName()
423 */
424 protected abstract java.lang.String handleGetGetterSetterTypeName();
425
426 private void handleGetGetterSetterTypeName12aPreCondition()
427 {
428 }
429
430 private void handleGetGetterSetterTypeName12aPostCondition()
431 {
432 }
433
434 private java.lang.String __getterSetterTypeName12a;
435 private boolean __getterSetterTypeName12aSet = false;
436
437 public final java.lang.String getGetterSetterTypeName()
438 {
439 java.lang.String getterSetterTypeName12a = this.__getterSetterTypeName12a;
440 if (!this.__getterSetterTypeName12aSet)
441 {
442 handleGetGetterSetterTypeName12aPreCondition();
443 getterSetterTypeName12a = handleGetGetterSetterTypeName();
444 handleGetGetterSetterTypeName12aPostCondition();
445 this.__getterSetterTypeName12a = getterSetterTypeName12a;
446 if (isMetafacadePropertyCachingEnabled())
447 {
448 this.__getterSetterTypeName12aSet = true;
449 }
450 }
451 return getterSetterTypeName12a;
452 }
453
454 /***
455 * @see org.andromda.metafacades.uml.AssociationEndFacade#isMany()
456 */
457 protected abstract boolean handleIsMany();
458
459 private void handleIsMany13aPreCondition()
460 {
461 }
462
463 private void handleIsMany13aPostCondition()
464 {
465 }
466
467 private boolean __many13a;
468 private boolean __many13aSet = false;
469
470 public final boolean isMany()
471 {
472 boolean many13a = this.__many13a;
473 if (!this.__many13aSet)
474 {
475 handleIsMany13aPreCondition();
476 many13a = handleIsMany();
477 handleIsMany13aPostCondition();
478 this.__many13a = many13a;
479 if (isMetafacadePropertyCachingEnabled())
480 {
481 this.__many13aSet = true;
482 }
483 }
484 return many13a;
485 }
486
487 /***
488 * @see org.andromda.metafacades.uml.AssociationEndFacade#isRequired()
489 */
490 protected abstract boolean handleIsRequired();
491
492 private void handleIsRequired14aPreCondition()
493 {
494 }
495
496 private void handleIsRequired14aPostCondition()
497 {
498 }
499
500 private boolean __required14a;
501 private boolean __required14aSet = false;
502
503 public final boolean isRequired()
504 {
505 boolean required14a = this.__required14a;
506 if (!this.__required14aSet)
507 {
508 handleIsRequired14aPreCondition();
509 required14a = handleIsRequired();
510 handleIsRequired14aPostCondition();
511 this.__required14a = required14a;
512 if (isMetafacadePropertyCachingEnabled())
513 {
514 this.__required14aSet = true;
515 }
516 }
517 return required14a;
518 }
519
520 /***
521 * @see org.andromda.metafacades.uml.AssociationEndFacade#isChild()
522 */
523 protected abstract boolean handleIsChild();
524
525 private void handleIsChild15aPreCondition()
526 {
527 }
528
529 private void handleIsChild15aPostCondition()
530 {
531 }
532
533 private boolean __child15a;
534 private boolean __child15aSet = false;
535
536 public final boolean isChild()
537 {
538 boolean child15a = this.__child15a;
539 if (!this.__child15aSet)
540 {
541 handleIsChild15aPreCondition();
542 child15a = handleIsChild();
543 handleIsChild15aPostCondition();
544 this.__child15a = child15a;
545 if (isMetafacadePropertyCachingEnabled())
546 {
547 this.__child15aSet = true;
548 }
549 }
550 return child15a;
551 }
552
553 /***
554 * @see org.andromda.metafacades.uml.AssociationEndFacade#getUpper()
555 */
556 protected abstract int handleGetUpper();
557
558 private void handleGetUpper16aPreCondition()
559 {
560 }
561
562 private void handleGetUpper16aPostCondition()
563 {
564 }
565
566 private int __upper16a;
567 private boolean __upper16aSet = false;
568
569 public final int getUpper()
570 {
571 int upper16a = this.__upper16a;
572 if (!this.__upper16aSet)
573 {
574 handleGetUpper16aPreCondition();
575 upper16a = handleGetUpper();
576 handleGetUpper16aPostCondition();
577 this.__upper16a = upper16a;
578 if (isMetafacadePropertyCachingEnabled())
579 {
580 this.__upper16aSet = true;
581 }
582 }
583 return upper16a;
584 }
585
586 /***
587 * @see org.andromda.metafacades.uml.AssociationEndFacade#getLower()
588 */
589 protected abstract int handleGetLower();
590
591 private void handleGetLower17aPreCondition()
592 {
593 }
594
595 private void handleGetLower17aPostCondition()
596 {
597 }
598
599 private int __lower17a;
600 private boolean __lower17aSet = false;
601
602 public final int getLower()
603 {
604 int lower17a = this.__lower17a;
605 if (!this.__lower17aSet)
606 {
607 handleGetLower17aPreCondition();
608 lower17a = handleGetLower();
609 handleGetLower17aPostCondition();
610 this.__lower17a = lower17a;
611 if (isMetafacadePropertyCachingEnabled())
612 {
613 this.__lower17aSet = true;
614 }
615 }
616 return lower17a;
617 }
618
619
620
621 private void handleGetOtherEnd1rPreCondition()
622 {
623 }
624
625 private void handleGetOtherEnd1rPostCondition()
626 {
627 }
628
629 public final org.andromda.metafacades.uml.AssociationEndFacade getOtherEnd()
630 {
631 org.andromda.metafacades.uml.AssociationEndFacade getOtherEnd1r = null;
632 handleGetOtherEnd1rPreCondition();
633 Object result = this.shieldedElement(handleGetOtherEnd());
634 try
635 {
636 getOtherEnd1r = (org.andromda.metafacades.uml.AssociationEndFacade)result;
637 }
638 catch (ClassCastException ex)
639 {
640
641
642 }
643 handleGetOtherEnd1rPostCondition();
644 return getOtherEnd1r;
645 }
646
647 protected abstract java.lang.Object handleGetOtherEnd();
648
649 private void handleGetAssociation4rPreCondition()
650 {
651 }
652
653 private void handleGetAssociation4rPostCondition()
654 {
655 }
656
657 public final org.andromda.metafacades.uml.AssociationFacade getAssociation()
658 {
659 org.andromda.metafacades.uml.AssociationFacade getAssociation4r = null;
660 handleGetAssociation4rPreCondition();
661 Object result = this.shieldedElement(handleGetAssociation());
662 try
663 {
664 getAssociation4r = (org.andromda.metafacades.uml.AssociationFacade)result;
665 }
666 catch (ClassCastException ex)
667 {
668
669
670 }
671 handleGetAssociation4rPostCondition();
672 return getAssociation4r;
673 }
674
675 protected abstract java.lang.Object handleGetAssociation();
676
677 private void handleGetType5rPreCondition()
678 {
679 }
680
681 private void handleGetType5rPostCondition()
682 {
683 }
684
685 public final org.andromda.metafacades.uml.ClassifierFacade getType()
686 {
687 org.andromda.metafacades.uml.ClassifierFacade getType5r = null;
688 handleGetType5rPreCondition();
689 Object result = this.shieldedElement(handleGetType());
690 try
691 {
692 getType5r = (org.andromda.metafacades.uml.ClassifierFacade)result;
693 }
694 catch (ClassCastException ex)
695 {
696
697
698 }
699 handleGetType5rPostCondition();
700 return getType5r;
701 }
702
703 protected abstract java.lang.Object handleGetType();
704
705 /***
706 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
707 */
708 public void validateInvariants(java.util.Collection validationMessages)
709 {
710 super.validateInvariants(validationMessages);
711 {
712 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,"type")));
713 if (!constraintValid)
714 validationMessages.add(
715 new org.andromda.core.metafacade.ModelValidationMessage(
716 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
717 "org::andromda::metafacades::uml::AssociationEndFacade::association end needs a type",
718 "Each association end needs a type, you cannot leave the type unspecified."));
719 }
720 }
721
722 /***
723 * The property that stores the name of the metafacade.
724 */
725 private static final String NAME_PROPERTY = "name";
726
727 /***
728 * @see java.lang.Object#toString()
729 */
730 public String toString()
731 {
732 final StringBuffer toString = new StringBuffer(this.getClass().getName());
733 toString.append("[");
734 try
735 {
736 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
737 }
738 catch (final Throwable throwable)
739 {
740
741 }
742 toString.append("]");
743 return toString.toString();
744 }
745 }