001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.metafacades.uml14; 006 007import java.util.Collection; 008import java.util.List; 009import org.andromda.core.metafacade.MetafacadeBase; 010import org.andromda.core.metafacade.ModelValidationMessage; 011import org.andromda.metafacades.uml.ClassifierFacade; 012import org.andromda.metafacades.uml.ConstraintFacade; 013import org.andromda.metafacades.uml.ModelElementFacade; 014import org.andromda.metafacades.uml.OperationFacade; 015import org.andromda.metafacades.uml.ParameterFacade; 016import org.andromda.translation.ocl.validation.OCLCollections; 017import org.andromda.translation.ocl.validation.OCLExpressions; 018import org.andromda.translation.ocl.validation.OCLIntrospector; 019import org.andromda.translation.ocl.validation.OCLResultEnsurer; 020import org.apache.log4j.Logger; 021import org.omg.uml.foundation.core.Operation; 022 023/** 024 * A behavioral feature of a classifier that specifies the name, type, parameters, and constraints 025 * for invoking an associated behavior. May invoke both the execution of method behaviors as well as 026 * other behavioral responses. 027 * MetafacadeLogic for OperationFacade 028 * 029 * @see OperationFacade 030 */ 031public abstract class OperationFacadeLogic 032 extends ModelElementFacadeLogicImpl 033 implements OperationFacade 034{ 035 /** 036 * The underlying UML object 037 * @see Operation 038 */ 039 protected Operation metaObject; 040 041 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 042 * @param metaObjectIn 043 * @param context 044 */ 045 protected OperationFacadeLogic(Operation metaObjectIn, String context) 046 { 047 super(metaObjectIn, getContext(context)); 048 this.metaObject = metaObjectIn; 049 } 050 051 /** 052 * The logger instance. 053 */ 054 private static final Logger logger = Logger.getLogger(OperationFacadeLogic.class); 055 056 /** 057 * Gets the context for this metafacade logic instance. 058 * @param context String. Set to OperationFacade if null 059 * @return context String 060 */ 061 private static String getContext(String context) 062 { 063 if (context == null) 064 { 065 context = "org.andromda.metafacades.uml.OperationFacade"; 066 } 067 return context; 068 } 069 070 /** Reset context only for non-root metafacades 071 * @param context 072 */ 073 @Override 074 public void resetMetafacadeContext(String context) 075 { 076 if (!this.contextRoot) // reset context only for non-root metafacades 077 { 078 context = getContext(context); // to have same value as in original constructor call 079 setMetafacadeContext (context); 080 } 081 } 082 083 /** 084 * @return boolean true always 085 * @see OperationFacade 086 */ 087 public boolean isOperationFacadeMetaType() 088 { 089 return true; 090 } 091 092 // --------------- attributes --------------------- 093 094 /** 095 * @see OperationFacade#getSignature() 096 * @return String 097 */ 098 protected abstract String handleGetSignature(); 099 100 private String __signature1a; 101 private boolean __signature1aSet = false; 102 103 /** 104 * Return the operation signature, including public/protested abstract returnType name plus 105 * argument type and name 106 * @return (String)handleGetSignature() 107 */ 108 public final String getSignature() 109 { 110 String signature1a = this.__signature1a; 111 if (!this.__signature1aSet) 112 { 113 // signature has no pre constraints 114 signature1a = handleGetSignature(); 115 // signature has no post constraints 116 this.__signature1a = signature1a; 117 if (isMetafacadePropertyCachingEnabled()) 118 { 119 this.__signature1aSet = true; 120 } 121 } 122 return signature1a; 123 } 124 125 /** 126 * @see OperationFacade#getCall() 127 * @return String 128 */ 129 protected abstract String handleGetCall(); 130 131 private String __call2a; 132 private boolean __call2aSet = false; 133 134 /** 135 * Constructs the operation call with the operation name 136 * @return (String)handleGetCall() 137 */ 138 public final String getCall() 139 { 140 String call2a = this.__call2a; 141 if (!this.__call2aSet) 142 { 143 // call has no pre constraints 144 call2a = handleGetCall(); 145 // call has no post constraints 146 this.__call2a = call2a; 147 if (isMetafacadePropertyCachingEnabled()) 148 { 149 this.__call2aSet = true; 150 } 151 } 152 return call2a; 153 } 154 155 /** 156 * @see OperationFacade#getTypedArgumentList() 157 * @return String 158 */ 159 protected abstract String handleGetTypedArgumentList(); 160 161 private String __typedArgumentList3a; 162 private boolean __typedArgumentList3aSet = false; 163 164 /** 165 * A comma-separated parameter list (type and name of each parameter) of an operation. 166 * @return (String)handleGetTypedArgumentList() 167 */ 168 public final String getTypedArgumentList() 169 { 170 String typedArgumentList3a = this.__typedArgumentList3a; 171 if (!this.__typedArgumentList3aSet) 172 { 173 // typedArgumentList has no pre constraints 174 typedArgumentList3a = handleGetTypedArgumentList(); 175 // typedArgumentList has no post constraints 176 this.__typedArgumentList3a = typedArgumentList3a; 177 if (isMetafacadePropertyCachingEnabled()) 178 { 179 this.__typedArgumentList3aSet = true; 180 } 181 } 182 return typedArgumentList3a; 183 } 184 185 /** 186 * @see OperationFacade#isStatic() 187 * @return boolean 188 */ 189 protected abstract boolean handleIsStatic(); 190 191 private boolean __static4a; 192 private boolean __static4aSet = false; 193 194 /** 195 * True is the operation is static (only a single instance can be instantiated). 196 * @return (boolean)handleIsStatic() 197 */ 198 public final boolean isStatic() 199 { 200 boolean static4a = this.__static4a; 201 if (!this.__static4aSet) 202 { 203 // static has no pre constraints 204 static4a = handleIsStatic(); 205 // static has no post constraints 206 this.__static4a = static4a; 207 if (isMetafacadePropertyCachingEnabled()) 208 { 209 this.__static4aSet = true; 210 } 211 } 212 return static4a; 213 } 214 215 /** 216 * @see OperationFacade#isAbstract() 217 * @return boolean 218 */ 219 protected abstract boolean handleIsAbstract(); 220 221 private boolean __abstract5a; 222 private boolean __abstract5aSet = false; 223 224 /** 225 * True is the operation is abstract. 226 * @return (boolean)handleIsAbstract() 227 */ 228 public final boolean isAbstract() 229 { 230 boolean abstract5a = this.__abstract5a; 231 if (!this.__abstract5aSet) 232 { 233 // abstract has no pre constraints 234 abstract5a = handleIsAbstract(); 235 // abstract has no post constraints 236 this.__abstract5a = abstract5a; 237 if (isMetafacadePropertyCachingEnabled()) 238 { 239 this.__abstract5aSet = true; 240 } 241 } 242 return abstract5a; 243 } 244 245 /** 246 * @see OperationFacade#getExceptionList() 247 * @return String 248 */ 249 protected abstract String handleGetExceptionList(); 250 251 private String __exceptionList6a; 252 private boolean __exceptionList6aSet = false; 253 254 /** 255 * A comma separated list containing all exceptions that this operation throws. Exceptions are 256 * determined through dependencies that have the target element stereotyped as <<Exception>>. 257 * @return (String)handleGetExceptionList() 258 */ 259 public final String getExceptionList() 260 { 261 String exceptionList6a = this.__exceptionList6a; 262 if (!this.__exceptionList6aSet) 263 { 264 // exceptionList has no pre constraints 265 exceptionList6a = handleGetExceptionList(); 266 // exceptionList has no post constraints 267 this.__exceptionList6a = exceptionList6a; 268 if (isMetafacadePropertyCachingEnabled()) 269 { 270 this.__exceptionList6aSet = true; 271 } 272 } 273 return exceptionList6a; 274 } 275 276 /** 277 * @see OperationFacade#getExceptions() 278 * @return Collection<ModelElementFacade> 279 */ 280 protected abstract Collection<ModelElementFacade> handleGetExceptions(); 281 282 private Collection<ModelElementFacade> __exceptions7a; 283 private boolean __exceptions7aSet = false; 284 285 /** 286 * A collection of all exceptions thrown by this operation. 287 * @return (Collection<ModelElementFacade>)handleGetExceptions() 288 */ 289 public final Collection<ModelElementFacade> getExceptions() 290 { 291 Collection<ModelElementFacade> exceptions7a = this.__exceptions7a; 292 if (!this.__exceptions7aSet) 293 { 294 // exceptions has no pre constraints 295 exceptions7a = handleGetExceptions(); 296 // exceptions has no post constraints 297 this.__exceptions7a = exceptions7a; 298 if (isMetafacadePropertyCachingEnabled()) 299 { 300 this.__exceptions7aSet = true; 301 } 302 } 303 return exceptions7a; 304 } 305 306 /** 307 * @see OperationFacade#isReturnTypePresent() 308 * @return boolean 309 */ 310 protected abstract boolean handleIsReturnTypePresent(); 311 312 private boolean __returnTypePresent8a; 313 private boolean __returnTypePresent8aSet = false; 314 315 /** 316 * True/false depending on whether or not the operation has a return type or not (i.e. a return 317 * type of something other than void). 318 * @return (boolean)handleIsReturnTypePresent() 319 */ 320 public final boolean isReturnTypePresent() 321 { 322 boolean returnTypePresent8a = this.__returnTypePresent8a; 323 if (!this.__returnTypePresent8aSet) 324 { 325 // returnTypePresent has no pre constraints 326 returnTypePresent8a = handleIsReturnTypePresent(); 327 // returnTypePresent has no post constraints 328 this.__returnTypePresent8a = returnTypePresent8a; 329 if (isMetafacadePropertyCachingEnabled()) 330 { 331 this.__returnTypePresent8aSet = true; 332 } 333 } 334 return returnTypePresent8a; 335 } 336 337 /** 338 * @see OperationFacade#isExceptionsPresent() 339 * @return boolean 340 */ 341 protected abstract boolean handleIsExceptionsPresent(); 342 343 private boolean __exceptionsPresent9a; 344 private boolean __exceptionsPresent9aSet = false; 345 346 /** 347 * True if the operation has (i.e. throws any exceptions) false otherwise. 348 * @return (boolean)handleIsExceptionsPresent() 349 */ 350 public final boolean isExceptionsPresent() 351 { 352 boolean exceptionsPresent9a = this.__exceptionsPresent9a; 353 if (!this.__exceptionsPresent9aSet) 354 { 355 // exceptionsPresent has no pre constraints 356 exceptionsPresent9a = handleIsExceptionsPresent(); 357 // exceptionsPresent has no post constraints 358 this.__exceptionsPresent9a = exceptionsPresent9a; 359 if (isMetafacadePropertyCachingEnabled()) 360 { 361 this.__exceptionsPresent9aSet = true; 362 } 363 } 364 return exceptionsPresent9a; 365 } 366 367 /** 368 * @see OperationFacade#getArgumentNames() 369 * @return String 370 */ 371 protected abstract String handleGetArgumentNames(); 372 373 private String __argumentNames10a; 374 private boolean __argumentNames10aSet = false; 375 376 /** 377 * A comma separated list of all argument names. 378 * @return (String)handleGetArgumentNames() 379 */ 380 public final String getArgumentNames() 381 { 382 String argumentNames10a = this.__argumentNames10a; 383 if (!this.__argumentNames10aSet) 384 { 385 // argumentNames has no pre constraints 386 argumentNames10a = handleGetArgumentNames(); 387 // argumentNames has no post constraints 388 this.__argumentNames10a = argumentNames10a; 389 if (isMetafacadePropertyCachingEnabled()) 390 { 391 this.__argumentNames10aSet = true; 392 } 393 } 394 return argumentNames10a; 395 } 396 397 /** 398 * @see OperationFacade#getArgumentTypeNames() 399 * @return String 400 */ 401 protected abstract String handleGetArgumentTypeNames(); 402 403 private String __argumentTypeNames11a; 404 private boolean __argumentTypeNames11aSet = false; 405 406 /** 407 * A comma separated list of all types of each argument, in order. 408 * @return (String)handleGetArgumentTypeNames() 409 */ 410 public final String getArgumentTypeNames() 411 { 412 String argumentTypeNames11a = this.__argumentTypeNames11a; 413 if (!this.__argumentTypeNames11aSet) 414 { 415 // argumentTypeNames has no pre constraints 416 argumentTypeNames11a = handleGetArgumentTypeNames(); 417 // argumentTypeNames has no post constraints 418 this.__argumentTypeNames11a = argumentTypeNames11a; 419 if (isMetafacadePropertyCachingEnabled()) 420 { 421 this.__argumentTypeNames11aSet = true; 422 } 423 } 424 return argumentTypeNames11a; 425 } 426 427 /** 428 * @see OperationFacade#isQuery() 429 * @return boolean 430 */ 431 protected abstract boolean handleIsQuery(); 432 433 private boolean __query12a; 434 private boolean __query12aSet = false; 435 436 /** 437 * Indicates whether or not this operation is a query operation. 438 * @return (boolean)handleIsQuery() 439 */ 440 public final boolean isQuery() 441 { 442 boolean query12a = this.__query12a; 443 if (!this.__query12aSet) 444 { 445 // query has no pre constraints 446 query12a = handleIsQuery(); 447 // query has no post constraints 448 this.__query12a = query12a; 449 if (isMetafacadePropertyCachingEnabled()) 450 { 451 this.__query12aSet = true; 452 } 453 } 454 return query12a; 455 } 456 457 /** 458 * @see OperationFacade#getConcurrency() 459 * @return String 460 */ 461 protected abstract String handleGetConcurrency(); 462 463 private String __concurrency13a; 464 private boolean __concurrency13aSet = false; 465 466 /** 467 * Returns the concurrency modifier for this operation (i.e. concurrent, guarded or sequential) 468 * of the model element, will attempt a lookup for these values in the language mappings (if 469 * any). 470 * @return (String)handleGetConcurrency() 471 */ 472 public final String getConcurrency() 473 { 474 String concurrency13a = this.__concurrency13a; 475 if (!this.__concurrency13aSet) 476 { 477 // concurrency has no pre constraints 478 concurrency13a = handleGetConcurrency(); 479 // concurrency has no post constraints 480 this.__concurrency13a = concurrency13a; 481 if (isMetafacadePropertyCachingEnabled()) 482 { 483 this.__concurrency13aSet = true; 484 } 485 } 486 return concurrency13a; 487 } 488 489 /** 490 * @see OperationFacade#getPreconditionName() 491 * @return String 492 */ 493 protected abstract String handleGetPreconditionName(); 494 495 private String __preconditionName14a; 496 private boolean __preconditionName14aSet = false; 497 498 /** 499 * The name of the operation that handles precondition constraints. 500 * @return (String)handleGetPreconditionName() 501 */ 502 public final String getPreconditionName() 503 { 504 String preconditionName14a = this.__preconditionName14a; 505 if (!this.__preconditionName14aSet) 506 { 507 // preconditionName has no pre constraints 508 preconditionName14a = handleGetPreconditionName(); 509 // preconditionName has no post constraints 510 this.__preconditionName14a = preconditionName14a; 511 if (isMetafacadePropertyCachingEnabled()) 512 { 513 this.__preconditionName14aSet = true; 514 } 515 } 516 return preconditionName14a; 517 } 518 519 /** 520 * @see OperationFacade#getPostconditionName() 521 * @return String 522 */ 523 protected abstract String handleGetPostconditionName(); 524 525 private String __postconditionName15a; 526 private boolean __postconditionName15aSet = false; 527 528 /** 529 * The name of the operation that handles postcondition constraints. 530 * @return (String)handleGetPostconditionName() 531 */ 532 public final String getPostconditionName() 533 { 534 String postconditionName15a = this.__postconditionName15a; 535 if (!this.__postconditionName15aSet) 536 { 537 // postconditionName has no pre constraints 538 postconditionName15a = handleGetPostconditionName(); 539 // postconditionName has no post constraints 540 this.__postconditionName15a = postconditionName15a; 541 if (isMetafacadePropertyCachingEnabled()) 542 { 543 this.__postconditionName15aSet = true; 544 } 545 } 546 return postconditionName15a; 547 } 548 549 /** 550 * @see OperationFacade#getPreconditionSignature() 551 * @return String 552 */ 553 protected abstract String handleGetPreconditionSignature(); 554 555 private String __preconditionSignature16a; 556 private boolean __preconditionSignature16aSet = false; 557 558 /** 559 * The signature of the precondition operation. 560 * @return (String)handleGetPreconditionSignature() 561 */ 562 public final String getPreconditionSignature() 563 { 564 String preconditionSignature16a = this.__preconditionSignature16a; 565 if (!this.__preconditionSignature16aSet) 566 { 567 // preconditionSignature has no pre constraints 568 preconditionSignature16a = handleGetPreconditionSignature(); 569 // preconditionSignature has no post constraints 570 this.__preconditionSignature16a = preconditionSignature16a; 571 if (isMetafacadePropertyCachingEnabled()) 572 { 573 this.__preconditionSignature16aSet = true; 574 } 575 } 576 return preconditionSignature16a; 577 } 578 579 /** 580 * @see OperationFacade#getPreconditionCall() 581 * @return String 582 */ 583 protected abstract String handleGetPreconditionCall(); 584 585 private String __preconditionCall17a; 586 private boolean __preconditionCall17aSet = false; 587 588 /** 589 * The call to the precondition operation. 590 * @return (String)handleGetPreconditionCall() 591 */ 592 public final String getPreconditionCall() 593 { 594 String preconditionCall17a = this.__preconditionCall17a; 595 if (!this.__preconditionCall17aSet) 596 { 597 // preconditionCall has no pre constraints 598 preconditionCall17a = handleGetPreconditionCall(); 599 // preconditionCall has no post constraints 600 this.__preconditionCall17a = preconditionCall17a; 601 if (isMetafacadePropertyCachingEnabled()) 602 { 603 this.__preconditionCall17aSet = true; 604 } 605 } 606 return preconditionCall17a; 607 } 608 609 /** 610 * @see OperationFacade#isPreconditionsPresent() 611 * @return boolean 612 */ 613 protected abstract boolean handleIsPreconditionsPresent(); 614 615 private boolean __preconditionsPresent18a; 616 private boolean __preconditionsPresent18aSet = false; 617 618 /** 619 * Whether any precondition constraints are present on this operation. 620 * @return (boolean)handleIsPreconditionsPresent() 621 */ 622 public final boolean isPreconditionsPresent() 623 { 624 boolean preconditionsPresent18a = this.__preconditionsPresent18a; 625 if (!this.__preconditionsPresent18aSet) 626 { 627 // preconditionsPresent has no pre constraints 628 preconditionsPresent18a = handleIsPreconditionsPresent(); 629 // preconditionsPresent has no post constraints 630 this.__preconditionsPresent18a = preconditionsPresent18a; 631 if (isMetafacadePropertyCachingEnabled()) 632 { 633 this.__preconditionsPresent18aSet = true; 634 } 635 } 636 return preconditionsPresent18a; 637 } 638 639 /** 640 * @see OperationFacade#isPostconditionsPresent() 641 * @return boolean 642 */ 643 protected abstract boolean handleIsPostconditionsPresent(); 644 645 private boolean __postconditionsPresent19a; 646 private boolean __postconditionsPresent19aSet = false; 647 648 /** 649 * Whether any postcondition constraints are present on this operation. 650 * @return (boolean)handleIsPostconditionsPresent() 651 */ 652 public final boolean isPostconditionsPresent() 653 { 654 boolean postconditionsPresent19a = this.__postconditionsPresent19a; 655 if (!this.__postconditionsPresent19aSet) 656 { 657 // postconditionsPresent has no pre constraints 658 postconditionsPresent19a = handleIsPostconditionsPresent(); 659 // postconditionsPresent has no post constraints 660 this.__postconditionsPresent19a = postconditionsPresent19a; 661 if (isMetafacadePropertyCachingEnabled()) 662 { 663 this.__postconditionsPresent19aSet = true; 664 } 665 } 666 return postconditionsPresent19a; 667 } 668 669 /** 670 * @see OperationFacade#getLower() 671 * @return int 672 */ 673 protected abstract int handleGetLower(); 674 675 private int __lower20a; 676 private boolean __lower20aSet = false; 677 678 /** 679 * the lower value for the multiplicity 680 * -only applicable for UML2 681 * @return (int)handleGetLower() 682 */ 683 public final int getLower() 684 { 685 int lower20a = this.__lower20a; 686 if (!this.__lower20aSet) 687 { 688 // lower has no pre constraints 689 lower20a = handleGetLower(); 690 // lower has no post constraints 691 this.__lower20a = lower20a; 692 if (isMetafacadePropertyCachingEnabled()) 693 { 694 this.__lower20aSet = true; 695 } 696 } 697 return lower20a; 698 } 699 700 /** 701 * @see OperationFacade#getUpper() 702 * @return int 703 */ 704 protected abstract int handleGetUpper(); 705 706 private int __upper21a; 707 private boolean __upper21aSet = false; 708 709 /** 710 * the upper value for the multiplicity (will be -1 for *) 711 * - only applicable for UML2 712 * @return (int)handleGetUpper() 713 */ 714 public final int getUpper() 715 { 716 int upper21a = this.__upper21a; 717 if (!this.__upper21aSet) 718 { 719 // upper has no pre constraints 720 upper21a = handleGetUpper(); 721 // upper has no post constraints 722 this.__upper21a = upper21a; 723 if (isMetafacadePropertyCachingEnabled()) 724 { 725 this.__upper21aSet = true; 726 } 727 } 728 return upper21a; 729 } 730 731 /** 732 * @see OperationFacade#getReturnParameter() 733 * @return ParameterFacade 734 */ 735 protected abstract ParameterFacade handleGetReturnParameter(); 736 737 private ParameterFacade __returnParameter22a; 738 private boolean __returnParameter22aSet = false; 739 740 /** 741 * (UML2 Only). Get the actual return parameter (which may have stereotypes etc). 742 * @return (ParameterFacade)handleGetReturnParameter() 743 */ 744 public final ParameterFacade getReturnParameter() 745 { 746 ParameterFacade returnParameter22a = this.__returnParameter22a; 747 if (!this.__returnParameter22aSet) 748 { 749 // returnParameter has no pre constraints 750 returnParameter22a = handleGetReturnParameter(); 751 // returnParameter has no post constraints 752 this.__returnParameter22a = returnParameter22a; 753 if (isMetafacadePropertyCachingEnabled()) 754 { 755 this.__returnParameter22aSet = true; 756 } 757 } 758 return returnParameter22a; 759 } 760 761 /** 762 * @see OperationFacade#isOverriding() 763 * @return boolean 764 */ 765 protected abstract boolean handleIsOverriding(); 766 767 private boolean __overriding23a; 768 private boolean __overriding23aSet = false; 769 770 /** 771 * True if this operation overrides an operation defined in an ancestor class. An operation 772 * overrides when the names of the operations as well as the types of the arguments are equal. 773 * The return type may be different and is, as well as any exceptions, ignored. 774 * @return (boolean)handleIsOverriding() 775 */ 776 public final boolean isOverriding() 777 { 778 boolean overriding23a = this.__overriding23a; 779 if (!this.__overriding23aSet) 780 { 781 // overriding has no pre constraints 782 overriding23a = handleIsOverriding(); 783 // overriding has no post constraints 784 this.__overriding23a = overriding23a; 785 if (isMetafacadePropertyCachingEnabled()) 786 { 787 this.__overriding23aSet = true; 788 } 789 } 790 return overriding23a; 791 } 792 793 /** 794 * @see OperationFacade#isOrdered() 795 * @return boolean 796 */ 797 protected abstract boolean handleIsOrdered(); 798 799 private boolean __ordered24a; 800 private boolean __ordered24aSet = false; 801 802 /** 803 * UML2 only: If isMany (Collection type returned), is the type unique within the collection. 804 * Unique+Ordered determines CollectionType implementation of return result. Default=false. 805 * @return (boolean)handleIsOrdered() 806 */ 807 public final boolean isOrdered() 808 { 809 boolean ordered24a = this.__ordered24a; 810 if (!this.__ordered24aSet) 811 { 812 // ordered has no pre constraints 813 ordered24a = handleIsOrdered(); 814 // ordered has no post constraints 815 this.__ordered24a = ordered24a; 816 if (isMetafacadePropertyCachingEnabled()) 817 { 818 this.__ordered24aSet = true; 819 } 820 } 821 return ordered24a; 822 } 823 824 /** 825 * @see OperationFacade#getGetterSetterReturnTypeName() 826 * @return String 827 */ 828 protected abstract String handleGetGetterSetterReturnTypeName(); 829 830 private String __getterSetterReturnTypeName25a; 831 private boolean __getterSetterReturnTypeName25aSet = false; 832 833 /** 834 * Return Type with multiplicity taken into account. UML14 does not allow multiplicity *. 835 * @return (String)handleGetGetterSetterReturnTypeName() 836 */ 837 public final String getGetterSetterReturnTypeName() 838 { 839 String getterSetterReturnTypeName25a = this.__getterSetterReturnTypeName25a; 840 if (!this.__getterSetterReturnTypeName25aSet) 841 { 842 // getterSetterReturnTypeName has no pre constraints 843 getterSetterReturnTypeName25a = handleGetGetterSetterReturnTypeName(); 844 // getterSetterReturnTypeName has no post constraints 845 this.__getterSetterReturnTypeName25a = getterSetterReturnTypeName25a; 846 if (isMetafacadePropertyCachingEnabled()) 847 { 848 this.__getterSetterReturnTypeName25aSet = true; 849 } 850 } 851 return getterSetterReturnTypeName25a; 852 } 853 854 /** 855 * @see OperationFacade#isMany() 856 * @return boolean 857 */ 858 protected abstract boolean handleIsMany(); 859 860 private boolean __many26a; 861 private boolean __many26aSet = false; 862 863 /** 864 * UML2 only. If the return type parameter multiplicity>1 OR the operation multiplicity>1. 865 * Default=false. 866 * @return (boolean)handleIsMany() 867 */ 868 public final boolean isMany() 869 { 870 boolean many26a = this.__many26a; 871 if (!this.__many26aSet) 872 { 873 // many has no pre constraints 874 many26a = handleIsMany(); 875 // many has no post constraints 876 this.__many26a = many26a; 877 if (isMetafacadePropertyCachingEnabled()) 878 { 879 this.__many26aSet = true; 880 } 881 } 882 return many26a; 883 } 884 885 /** 886 * @see OperationFacade#isUnique() 887 * @return boolean 888 */ 889 protected abstract boolean handleIsUnique(); 890 891 private boolean __unique27a; 892 private boolean __unique27aSet = false; 893 894 /** 895 * UML2 only: for Collection return type, is the type unique within the collection. 896 * Unique+Ordered determines the returned CollectionType. Default=false. 897 * @return (boolean)handleIsUnique() 898 */ 899 public final boolean isUnique() 900 { 901 boolean unique27a = this.__unique27a; 902 if (!this.__unique27aSet) 903 { 904 // unique has no pre constraints 905 unique27a = handleIsUnique(); 906 // unique has no post constraints 907 this.__unique27a = unique27a; 908 if (isMetafacadePropertyCachingEnabled()) 909 { 910 this.__unique27aSet = true; 911 } 912 } 913 return unique27a; 914 } 915 916 /** 917 * @see OperationFacade#isLeaf() 918 * @return boolean 919 */ 920 protected abstract boolean handleIsLeaf(); 921 922 private boolean __leaf28a; 923 private boolean __leaf28aSet = false; 924 925 /** 926 * IsLeaf property in the operation. If true, operation is final, cannot be extended or 927 * implemented by a descendant. Default=false. 928 * @return (boolean)handleIsLeaf() 929 */ 930 public final boolean isLeaf() 931 { 932 boolean leaf28a = this.__leaf28a; 933 if (!this.__leaf28aSet) 934 { 935 // leaf has no pre constraints 936 leaf28a = handleIsLeaf(); 937 // leaf has no post constraints 938 this.__leaf28a = leaf28a; 939 if (isMetafacadePropertyCachingEnabled()) 940 { 941 this.__leaf28aSet = true; 942 } 943 } 944 return leaf28a; 945 } 946 947 /** 948 * @see OperationFacade#getMethodBody() 949 * @return String 950 */ 951 protected abstract String handleGetMethodBody(); 952 953 private String __methodBody29a; 954 private boolean __methodBody29aSet = false; 955 956 /** 957 * Returns the operation method body determined from UML sequence diagrams or other UML sources. 958 * @return (String)handleGetMethodBody() 959 */ 960 public final String getMethodBody() 961 { 962 String methodBody29a = this.__methodBody29a; 963 if (!this.__methodBody29aSet) 964 { 965 // methodBody has no pre constraints 966 methodBody29a = handleGetMethodBody(); 967 // methodBody has no post constraints 968 this.__methodBody29a = methodBody29a; 969 if (isMetafacadePropertyCachingEnabled()) 970 { 971 this.__methodBody29aSet = true; 972 } 973 } 974 return methodBody29a; 975 } 976 977 // ---------------- business methods ---------------------- 978 979 /** 980 * Method to be implemented in descendants 981 * Searches the given feature for the specified tag. 982 * If the follow boolean is set to true then the search will continue from the class operation 983 * to the class itself and then up the class hierarchy. 984 * @param name 985 * @param follow 986 * @return Object 987 */ 988 protected abstract Object handleFindTaggedValue(String name, boolean follow); 989 990 /** 991 * Searches the given feature for the specified tag. 992 * If the follow boolean is set to true then the search will continue from the class operation 993 * to the class itself and then up the class hierarchy. 994 * @param name String 995 * The name of the tagged value to find. 996 * @param follow boolean 997 * TODO: Model Documentation for 998 * OperationFacade.findTaggedValue(follow) 999 * @return handleFindTaggedValue(name, follow) 1000 */ 1001 public Object findTaggedValue(String name, boolean follow) 1002 { 1003 // findTaggedValue has no pre constraints 1004 Object returnValue = handleFindTaggedValue(name, follow); 1005 // findTaggedValue has no post constraints 1006 return returnValue; 1007 } 1008 1009 /** 1010 * Method to be implemented in descendants 1011 * Returns a comma separated list of exceptions appended to the comma separated list of fully 1012 * qualified 'initialException' classes passed in to this method. 1013 * @param initialExceptions 1014 * @return String 1015 */ 1016 protected abstract String handleGetExceptionList(String initialExceptions); 1017 1018 /** 1019 * Returns a comma separated list of exceptions appended to the comma separated list of fully 1020 * qualified 'initialException' classes passed in to this method. 1021 * @param initialExceptions String 1022 * A comma separated list of fully qualified 'initialException' classes passed in to this 1023 * method. 1024 * @return handleGetExceptionList(initialExceptions) 1025 */ 1026 public String getExceptionList(String initialExceptions) 1027 { 1028 // getExceptionList has no pre constraints 1029 String returnValue = handleGetExceptionList(initialExceptions); 1030 // getExceptionList has no post constraints 1031 return returnValue; 1032 } 1033 1034 /** 1035 * Method to be implemented in descendants 1036 * Returns the signature of the operation and optionally appends the argument names (if 1037 * withArgumentNames is true), otherwise returns the signature with just the types alone in the 1038 * signature. 1039 * @param withArgumentNames 1040 * @return String 1041 */ 1042 protected abstract String handleGetSignature(boolean withArgumentNames); 1043 1044 /** 1045 * Returns the signature of the operation and optionally appends the argument names (if 1046 * withArgumentNames is true), otherwise returns the signature with just the types alone in the 1047 * signature. 1048 * @param withArgumentNames boolean 1049 * TODO: Model Documentation for 1050 * OperationFacade.getSignature(withArgumentNames) 1051 * @return handleGetSignature(withArgumentNames) 1052 */ 1053 public String getSignature(boolean withArgumentNames) 1054 { 1055 // getSignature has no pre constraints 1056 String returnValue = handleGetSignature(withArgumentNames); 1057 // getSignature has no post constraints 1058 return returnValue; 1059 } 1060 1061 /** 1062 * Method to be implemented in descendants 1063 * A comma-separated parameter list (type and name of each parameter) of an operation with an 1064 * optional modifier (i.e final) before each parameter. 1065 * @param modifier 1066 * @return String 1067 */ 1068 protected abstract String handleGetTypedArgumentList(String modifier); 1069 1070 /** 1071 * A comma-separated parameter list (type and name of each parameter) of an operation with an 1072 * optional modifier (i.e final) before each parameter. 1073 * @param modifier String 1074 * The modifier to prefix the arguments with (i.e. 'final') 1075 * @return handleGetTypedArgumentList(modifier) 1076 */ 1077 public String getTypedArgumentList(String modifier) 1078 { 1079 // getTypedArgumentList has no pre constraints 1080 String returnValue = handleGetTypedArgumentList(modifier); 1081 // getTypedArgumentList has no post constraints 1082 return returnValue; 1083 } 1084 1085 /** 1086 * Method to be implemented in descendants 1087 * Returns the signature of the operation and optionally appends the given 'argumentModifier' to 1088 * each argument. 1089 * @param argumentModifier 1090 * @return String 1091 */ 1092 protected abstract String handleGetSignature(String argumentModifier); 1093 1094 /** 1095 * Returns the signature of the operation and optionally appends the given 'argumentModifier' to 1096 * each argument. 1097 * @param argumentModifier String 1098 * The modifier to give the arguments (i.e. 'final'). 1099 * @return handleGetSignature(argumentModifier) 1100 */ 1101 public String getSignature(String argumentModifier) 1102 { 1103 // getSignature has no pre constraints 1104 String returnValue = handleGetSignature(argumentModifier); 1105 // getSignature has no post constraints 1106 return returnValue; 1107 } 1108 1109 /** 1110 * Method to be implemented in descendants 1111 * Finds the parameter on this operation having the given name, if no parameter is found, null 1112 * is returned instead. 1113 * @param name 1114 * @return ParameterFacade 1115 */ 1116 protected abstract ParameterFacade handleFindParameter(String name); 1117 1118 /** 1119 * Finds the parameter on this operation having the given name, if no parameter is found, null 1120 * is returned instead. 1121 * @param name String 1122 * The name of the parameter to find on the owner operation. 1123 * @return handleFindParameter(name) 1124 */ 1125 public ParameterFacade findParameter(String name) 1126 { 1127 // findParameter has no pre constraints 1128 ParameterFacade returnValue = handleFindParameter(name); 1129 // findParameter has no post constraints 1130 return returnValue; 1131 } 1132 1133 // ------------- associations ------------------ 1134 1135 /** 1136 * A behavioral feature of a classifier that specifies the name, type, parameters, and 1137 * constraints for 1138 * invoking an associated behavior. May invoke both the execution of method behaviors as well as 1139 * other 1140 * behavioral responses. 1141 * @return (Collection<ConstraintFacade>)handleGetPostconditions() 1142 */ 1143 public final Collection<ConstraintFacade> getPostconditions() 1144 { 1145 Collection<ConstraintFacade> getPostconditions1r = null; 1146 // operationFacade has no pre constraints 1147 Collection result = handleGetPostconditions(); 1148 List shieldedResult = this.shieldedElements(result); 1149 try 1150 { 1151 getPostconditions1r = (Collection<ConstraintFacade>)shieldedResult; 1152 } 1153 catch (ClassCastException ex) 1154 { 1155 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 1156 OperationFacadeLogic.logger.warn("incorrect metafacade cast for OperationFacadeLogic.getPostconditions Collection<ConstraintFacade> " + result + ": " + shieldedResult); 1157 } 1158 // operationFacade has no post constraints 1159 return getPostconditions1r; 1160 } 1161 1162 /** 1163 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type 1164 * @return Collection 1165 */ 1166 protected abstract Collection handleGetPostconditions(); 1167 1168 /** 1169 * A behavioral feature of a classifier that specifies the name, type, parameters, and 1170 * constraints for 1171 * invoking an associated behavior. May invoke both the execution of method behaviors as well as 1172 * other 1173 * behavioral responses. 1174 * @return (Collection<ParameterFacade>)handleGetArguments() 1175 */ 1176 public final Collection<ParameterFacade> getArguments() 1177 { 1178 Collection<ParameterFacade> getArguments2r = null; 1179 // operationFacade has no pre constraints 1180 Collection result = handleGetArguments(); 1181 List shieldedResult = this.shieldedElements(result); 1182 try 1183 { 1184 getArguments2r = (Collection<ParameterFacade>)shieldedResult; 1185 } 1186 catch (ClassCastException ex) 1187 { 1188 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 1189 OperationFacadeLogic.logger.warn("incorrect metafacade cast for OperationFacadeLogic.getArguments Collection<ParameterFacade> " + result + ": " + shieldedResult); 1190 } 1191 // operationFacade has no post constraints 1192 return getArguments2r; 1193 } 1194 1195 /** 1196 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type 1197 * @return Collection 1198 */ 1199 protected abstract Collection handleGetArguments(); 1200 1201 /** 1202 * The operations owned by this classifier. 1203 * @return (ClassifierFacade)handleGetOwner() 1204 */ 1205 public final ClassifierFacade getOwner() 1206 { 1207 ClassifierFacade getOwner3r = null; 1208 // operations has no pre constraints 1209 Object result = handleGetOwner(); 1210 MetafacadeBase shieldedResult = this.shieldedElement(result); 1211 try 1212 { 1213 getOwner3r = (ClassifierFacade)shieldedResult; 1214 } 1215 catch (ClassCastException ex) 1216 { 1217 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 1218 OperationFacadeLogic.logger.warn("incorrect metafacade cast for OperationFacadeLogic.getOwner ClassifierFacade " + result + ": " + shieldedResult); 1219 } 1220 // operations has no post constraints 1221 return getOwner3r; 1222 } 1223 1224 /** 1225 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type 1226 * @return Object 1227 */ 1228 protected abstract Object handleGetOwner(); 1229 1230 /** 1231 * If this parameter is located on an operation, this will represent that operation. 1232 * @return (Collection<ParameterFacade>)handleGetParameters() 1233 */ 1234 public final Collection<ParameterFacade> getParameters() 1235 { 1236 Collection<ParameterFacade> getParameters4r = null; 1237 // operation has no pre constraints 1238 Collection result = handleGetParameters(); 1239 List shieldedResult = this.shieldedElements(result); 1240 try 1241 { 1242 getParameters4r = (Collection<ParameterFacade>)shieldedResult; 1243 } 1244 catch (ClassCastException ex) 1245 { 1246 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 1247 OperationFacadeLogic.logger.warn("incorrect metafacade cast for OperationFacadeLogic.getParameters Collection<ParameterFacade> " + result + ": " + shieldedResult); 1248 } 1249 // operation has no post constraints 1250 return getParameters4r; 1251 } 1252 1253 /** 1254 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type 1255 * @return Collection 1256 */ 1257 protected abstract Collection handleGetParameters(); 1258 1259 /** 1260 * A behavioral feature of a classifier that specifies the name, type, parameters, and 1261 * constraints for 1262 * invoking an associated behavior. May invoke both the execution of method behaviors as well as 1263 * other 1264 * behavioral responses. 1265 * @return (ClassifierFacade)handleGetReturnType() 1266 */ 1267 public final ClassifierFacade getReturnType() 1268 { 1269 ClassifierFacade getReturnType5r = null; 1270 // operationFacade has no pre constraints 1271 Object result = handleGetReturnType(); 1272 MetafacadeBase shieldedResult = this.shieldedElement(result); 1273 try 1274 { 1275 getReturnType5r = (ClassifierFacade)shieldedResult; 1276 } 1277 catch (ClassCastException ex) 1278 { 1279 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 1280 OperationFacadeLogic.logger.warn("incorrect metafacade cast for OperationFacadeLogic.getReturnType ClassifierFacade " + result + ": " + shieldedResult); 1281 } 1282 // operationFacade has no post constraints 1283 return getReturnType5r; 1284 } 1285 1286 /** 1287 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type 1288 * @return Object 1289 */ 1290 protected abstract Object handleGetReturnType(); 1291 1292 /** 1293 * A behavioral feature of a classifier that specifies the name, type, parameters, and 1294 * constraints for 1295 * invoking an associated behavior. May invoke both the execution of method behaviors as well as 1296 * other 1297 * behavioral responses. 1298 * @return (Collection<ConstraintFacade>)handleGetPreconditions() 1299 */ 1300 public final Collection<ConstraintFacade> getPreconditions() 1301 { 1302 Collection<ConstraintFacade> getPreconditions6r = null; 1303 // operationFacade has no pre constraints 1304 Collection result = handleGetPreconditions(); 1305 List shieldedResult = this.shieldedElements(result); 1306 try 1307 { 1308 getPreconditions6r = (Collection<ConstraintFacade>)shieldedResult; 1309 } 1310 catch (ClassCastException ex) 1311 { 1312 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 1313 OperationFacadeLogic.logger.warn("incorrect metafacade cast for OperationFacadeLogic.getPreconditions Collection<ConstraintFacade> " + result + ": " + shieldedResult); 1314 } 1315 // operationFacade has no post constraints 1316 return getPreconditions6r; 1317 } 1318 1319 /** 1320 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type 1321 * @return Collection 1322 */ 1323 protected abstract Collection handleGetPreconditions(); 1324 1325 private OperationFacade __getOverriddenOperation7r; 1326 private boolean __getOverriddenOperation7rSet = false; 1327 1328 /** 1329 * A behavioral feature of a classifier that specifies the name, type, parameters, and 1330 * constraints for 1331 * invoking an associated behavior. May invoke both the execution of method behaviors as well as 1332 * other 1333 * behavioral responses. 1334 * @return (OperationFacade)handleGetOverriddenOperation() 1335 */ 1336 public final OperationFacade getOverriddenOperation() 1337 { 1338 OperationFacade getOverriddenOperation7r = this.__getOverriddenOperation7r; 1339 if (!this.__getOverriddenOperation7rSet) 1340 { 1341 // operationFacade has no pre constraints 1342 Object result = handleGetOverriddenOperation(); 1343 MetafacadeBase shieldedResult = this.shieldedElement(result); 1344 try 1345 { 1346 getOverriddenOperation7r = (OperationFacade)shieldedResult; 1347 } 1348 catch (ClassCastException ex) 1349 { 1350 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 1351 OperationFacadeLogic.logger.warn("incorrect metafacade cast for OperationFacadeLogic.getOverriddenOperation OperationFacade " + result + ": " + shieldedResult); 1352 } 1353 // operationFacade has no post constraints 1354 this.__getOverriddenOperation7r = getOverriddenOperation7r; 1355 if (isMetafacadePropertyCachingEnabled()) 1356 { 1357 this.__getOverriddenOperation7rSet = true; 1358 } 1359 } 1360 return getOverriddenOperation7r; 1361 } 1362 1363 /** 1364 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type 1365 * @return Object 1366 */ 1367 protected abstract Object handleGetOverriddenOperation(); 1368 1369 /** 1370 * <p><b>Constraint:</b> org::andromda::metafacades::uml::OperationFacade::operation needs a return type</p> 1371 * <p><b>Error:</b> Each operation needs a return type, you cannot leave the type unspecified, even if you want void you'll need to explicitly specify it.</p> 1372 * <p><b>OCL:</b> context OperationFacade 1373inv: returnType.name->notEmpty()</p> 1374 * <p><b>Constraint:</b> org::andromda::metafacades::uml::OperationFacade::operation must have a name</p> 1375 * <p><b>Error:</b> Each operation must have a non-empty name.</p> 1376 * <p><b>OCL:</b> context OperationFacade 1377inv: name -> notEmpty()</p> 1378 * <p><b>Constraint:</b> org::andromda::metafacades::uml::OperationFacade::primitive operation return cannot be used in a Collection</p> 1379 * <p><b>Error:</b> Primitive return parameters cannot be used in Collections (multiplicity > 1). Use the wrapped type or Array type instead.</p> 1380 * <p><b>OCL:</b> context OperationFacade inv: returnParameter.type.primitive implies (many = false)</p> 1381 * <p><b>Constraint:</b> org::andromda::metafacades::uml::OperationFacade::wrapped primitive operation return should not be required</p> 1382 * <p><b>Error:</b> Wrapped primitive operation return must have a multiplicity lower bound = 0 (must be optional). Use the unwrapped type, or change the multiplicity.</p> 1383 * <p><b>OCL:</b> context OperationFacade inv: returnParameter.type.wrappedPrimitive and many = false implies (lower = 0)</p> 1384 * <p><b>Constraint:</b> org::andromda::metafacades::uml::OperationFacade::primitive operation return must be required</p> 1385 * <p><b>Error:</b> Primitive operation return types must have a multiplicity lower bound > 0 (must be required). Use a wrapped type, or change the multiplicity.</p> 1386 * <p><b>OCL:</b> context OperationFacade inv: returnParameter.type.primitive implies (lower > 0)</p> 1387 * <p><b>Constraint:</b> org::andromda::metafacades::uml::OperationFacade::operation multiplicity must match return parameter multiplicity</p> 1388 * <p><b>Error:</b> Operation return parameter with multiplicity greater than 1 must match the operation multiplicity greater than 1.</p> 1389 * <p><b>OCL:</b> context OperationFacade 1390inv: many implies (returnParameter.many)</p> 1391 * @param validationMessages Collection<ModelValidationMessage> 1392 * @see ModelElementFacadeLogicImpl#validateInvariants(Collection validationMessages) 1393 */ 1394 @Override 1395 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 1396 { 1397 super.validateInvariants(validationMessages); 1398 try 1399 { 1400 final Object contextElement = this.THIS(); 1401 boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"returnType.name"))); 1402 if (!constraintValid) 1403 { 1404 validationMessages.add( 1405 new ModelValidationMessage( 1406 (MetafacadeBase)contextElement , 1407 "org::andromda::metafacades::uml::OperationFacade::operation needs a return type", 1408 "Each operation needs a return type, you cannot leave the type unspecified, even if you want void you'll need to explicitly specify it.")); 1409 } 1410 } 1411 catch (Throwable th) 1412 { 1413 Throwable cause = th.getCause(); 1414 int depth = 0; // Some throwables have infinite recursion 1415 while (cause != null && depth < 7) 1416 { 1417 th = cause; 1418 depth++; 1419 } 1420 logger.error("Error validating constraint 'org::andromda::metafacades::uml::OperationFacade::operation needs a return type' ON " 1421 + this.THIS().toString() + ": " + th.getMessage(), th); 1422 } 1423 try 1424 { 1425 final Object contextElement = this.THIS(); 1426 boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name"))); 1427 if (!constraintValid) 1428 { 1429 validationMessages.add( 1430 new ModelValidationMessage( 1431 (MetafacadeBase)contextElement , 1432 "org::andromda::metafacades::uml::OperationFacade::operation must have a name", 1433 "Each operation must have a non-empty name.")); 1434 } 1435 } 1436 catch (Throwable th) 1437 { 1438 Throwable cause = th.getCause(); 1439 int depth = 0; // Some throwables have infinite recursion 1440 while (cause != null && depth < 7) 1441 { 1442 th = cause; 1443 depth++; 1444 } 1445 logger.error("Error validating constraint 'org::andromda::metafacades::uml::OperationFacade::operation must have a name' ON " 1446 + this.THIS().toString() + ": " + th.getMessage(), th); 1447 } 1448 try 1449 { 1450 final Object contextElement = this.THIS(); 1451 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"returnParameter.type.primitive"))).booleanValue()?(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"many"),false)):true)); 1452 if (!constraintValid) 1453 { 1454 validationMessages.add( 1455 new ModelValidationMessage( 1456 (MetafacadeBase)contextElement , 1457 "org::andromda::metafacades::uml::OperationFacade::primitive operation return cannot be used in a Collection", 1458 "Primitive return parameters cannot be used in Collections (multiplicity > 1). Use the wrapped type or Array type instead.")); 1459 } 1460 } 1461 catch (Throwable th) 1462 { 1463 Throwable cause = th.getCause(); 1464 int depth = 0; // Some throwables have infinite recursion 1465 while (cause != null && depth < 7) 1466 { 1467 th = cause; 1468 depth++; 1469 } 1470 logger.error("Error validating constraint 'org::andromda::metafacades::uml::OperationFacade::primitive operation return cannot be used in a Collection' ON " 1471 + this.THIS().toString() + ": " + th.getMessage(), th); 1472 } 1473 try 1474 { 1475 final Object contextElement = this.THIS(); 1476 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"returnParameter.type.wrappedPrimitive"))).booleanValue()&&OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"many"),false))).booleanValue()?(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"lower"),0)):true)); 1477 if (!constraintValid) 1478 { 1479 validationMessages.add( 1480 new ModelValidationMessage( 1481 (MetafacadeBase)contextElement , 1482 "org::andromda::metafacades::uml::OperationFacade::wrapped primitive operation return should not be required", 1483 "Wrapped primitive operation return must have a multiplicity lower bound = 0 (must be optional). Use the unwrapped type, or change the multiplicity.")); 1484 } 1485 } 1486 catch (Throwable th) 1487 { 1488 Throwable cause = th.getCause(); 1489 int depth = 0; // Some throwables have infinite recursion 1490 while (cause != null && depth < 7) 1491 { 1492 th = cause; 1493 depth++; 1494 } 1495 logger.error("Error validating constraint 'org::andromda::metafacades::uml::OperationFacade::wrapped primitive operation return should not be required' ON " 1496 + this.THIS().toString() + ": " + th.getMessage(), th); 1497 } 1498 try 1499 { 1500 final Object contextElement = this.THIS(); 1501 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"returnParameter.type.primitive"))).booleanValue()?(OCLExpressions.greater(OCLIntrospector.invoke(contextElement,"lower"),0)):true)); 1502 if (!constraintValid) 1503 { 1504 validationMessages.add( 1505 new ModelValidationMessage( 1506 (MetafacadeBase)contextElement , 1507 "org::andromda::metafacades::uml::OperationFacade::primitive operation return must be required", 1508 "Primitive operation return types must have a multiplicity lower bound > 0 (must be required). Use a wrapped type, or change the multiplicity.")); 1509 } 1510 } 1511 catch (Throwable th) 1512 { 1513 Throwable cause = th.getCause(); 1514 int depth = 0; // Some throwables have infinite recursion 1515 while (cause != null && depth < 7) 1516 { 1517 th = cause; 1518 depth++; 1519 } 1520 logger.error("Error validating constraint 'org::andromda::metafacades::uml::OperationFacade::primitive operation return must be required' ON " 1521 + this.THIS().toString() + ": " + th.getMessage(), th); 1522 } 1523 try 1524 { 1525 final Object contextElement = this.THIS(); 1526 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"many"))).booleanValue()?(OCLIntrospector.invoke(contextElement,"returnParameter.many")):true)); 1527 if (!constraintValid) 1528 { 1529 validationMessages.add( 1530 new ModelValidationMessage( 1531 (MetafacadeBase)contextElement , 1532 "org::andromda::metafacades::uml::OperationFacade::operation multiplicity must match return parameter multiplicity", 1533 "Operation return parameter with multiplicity greater than 1 must match the operation multiplicity greater than 1.")); 1534 } 1535 } 1536 catch (Throwable th) 1537 { 1538 Throwable cause = th.getCause(); 1539 int depth = 0; // Some throwables have infinite recursion 1540 while (cause != null && depth < 7) 1541 { 1542 th = cause; 1543 depth++; 1544 } 1545 logger.error("Error validating constraint 'org::andromda::metafacades::uml::OperationFacade::operation multiplicity must match return parameter multiplicity' ON " 1546 + this.THIS().toString() + ": " + th.getMessage(), th); 1547 } 1548 } 1549}