001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.cartridges.meta.metafacades; 006 007import java.util.Collection; 008import org.andromda.core.common.Introspector; 009import org.andromda.core.metafacade.MetafacadeBase; 010import org.andromda.core.metafacade.MetafacadeFactory; 011import org.andromda.core.metafacade.ModelValidationMessage; 012import org.andromda.metafacades.uml.ClassifierFacade; 013import org.andromda.metafacades.uml.ConstraintFacade; 014import org.andromda.metafacades.uml.DependencyFacade; 015import org.andromda.metafacades.uml.ModelElementFacade; 016import org.andromda.metafacades.uml.ModelFacade; 017import org.andromda.metafacades.uml.OperationFacade; 018import org.andromda.metafacades.uml.PackageFacade; 019import org.andromda.metafacades.uml.ParameterFacade; 020import org.andromda.metafacades.uml.StateMachineFacade; 021import org.andromda.metafacades.uml.StereotypeFacade; 022import org.andromda.metafacades.uml.TaggedValueFacade; 023import org.andromda.metafacades.uml.TemplateParameterFacade; 024import org.andromda.metafacades.uml.TypeMappings; 025 026/** 027 * Represents a metafacade operation. 028 * MetafacadeLogic for MetafacadeOperation 029 * 030 * @see MetafacadeOperation 031 */ 032public abstract class MetafacadeOperationLogic 033 extends MetafacadeBase 034 implements MetafacadeOperation 035{ 036 /** 037 * The underlying UML object 038 * @see Object 039 */ 040 protected Object metaObject; 041 042 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 043 * @param metaObjectIn 044 * @param context 045 */ 046 protected MetafacadeOperationLogic(Object metaObjectIn, String context) 047 { 048 super(metaObjectIn, getContext(context)); 049 this.superOperationFacade = 050 (OperationFacade) 051 MetafacadeFactory.getInstance().createFacadeImpl( 052 "org.andromda.metafacades.uml.OperationFacade", 053 metaObjectIn, 054 getContext(context)); 055 this.metaObject = metaObjectIn; 056 } 057 058 /** 059 * Gets the context for this metafacade logic instance. 060 * @param context String. Set to MetafacadeOperation if null 061 * @return context String 062 */ 063 private static String getContext(String context) 064 { 065 if (context == null) 066 { 067 context = "org.andromda.cartridges.meta.metafacades.MetafacadeOperation"; 068 } 069 return context; 070 } 071 072 private OperationFacade superOperationFacade; 073 private boolean superOperationFacadeInitialized = false; 074 075 /** 076 * Gets the OperationFacade parent instance. 077 * @return this.superOperationFacade OperationFacade 078 */ 079 private OperationFacade getSuperOperationFacade() 080 { 081 if (!this.superOperationFacadeInitialized) 082 { 083 ((MetafacadeBase)this.superOperationFacade).setMetafacadeContext(this.getMetafacadeContext()); 084 this.superOperationFacadeInitialized = true; 085 } 086 return this.superOperationFacade; 087 } 088 089 /** Reset context only for non-root metafacades 090 * @param context 091 * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context) 092 */ 093 @Override 094 public void resetMetafacadeContext(String context) 095 { 096 if (!this.contextRoot) // reset context only for non-root metafacades 097 { 098 context = getContext(context); // to have same value as in original constructor call 099 setMetafacadeContext (context); 100 if (this.superOperationFacadeInitialized) 101 { 102 ((MetafacadeBase)this.superOperationFacade).resetMetafacadeContext(context); 103 } 104 } 105 } 106 107 /** 108 * @return boolean true always 109 * @see MetafacadeOperation 110 */ 111 public boolean isMetafacadeOperationMetaType() 112 { 113 return true; 114 } 115 116 // --------------- attributes --------------------- 117 118 /** 119 * @see org.andromda.cartridges.meta.metafacades.MetafacadeOperation#getImplementationName() 120 * @return String 121 */ 122 protected abstract String handleGetImplementationName(); 123 124 private String __implementationName1a; 125 private boolean __implementationName1aSet = false; 126 127 /** 128 * The implementation name for the operation that handles the logic of the operation. 129 * @return (String)handleGetImplementationName() 130 */ 131 public final String getImplementationName() 132 { 133 String implementationName1a = this.__implementationName1a; 134 if (!this.__implementationName1aSet) 135 { 136 // implementationName has no pre constraints 137 implementationName1a = handleGetImplementationName(); 138 // implementationName has no post constraints 139 this.__implementationName1a = implementationName1a; 140 if (isMetafacadePropertyCachingEnabled()) 141 { 142 this.__implementationName1aSet = true; 143 } 144 } 145 return implementationName1a; 146 } 147 148 /** 149 * @return true 150 * @see OperationFacade 151 */ 152 public boolean isOperationFacadeMetaType() 153 { 154 return true; 155 } 156 157 /** 158 * @return true 159 * @see ModelElementFacade 160 */ 161 public boolean isModelElementFacadeMetaType() 162 { 163 return true; 164 } 165 166 // ----------- delegates to OperationFacade ------------ 167 /** 168 * Copies all tagged values from the given ModelElementFacade to this model element facade. 169 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element) 170 */ 171 public void copyTaggedValues(ModelElementFacade element) 172 { 173 this.getSuperOperationFacade().copyTaggedValues(element); 174 } 175 176 /** 177 * Finds the tagged value with the specified 'tagName'. In case there are more values the first 178 * one found will be returned. 179 * @see ModelElementFacade#findTaggedValue(String tagName) 180 */ 181 public Object findTaggedValue(String tagName) 182 { 183 return this.getSuperOperationFacade().findTaggedValue(tagName); 184 } 185 186 /** 187 * Returns all the values for the tagged value with the specified name. The returned collection 188 * will contains only String instances, or will be empty. Never null. 189 * @see ModelElementFacade#findTaggedValues(String tagName) 190 */ 191 public Collection<Object> findTaggedValues(String tagName) 192 { 193 return this.getSuperOperationFacade().findTaggedValues(tagName); 194 } 195 196 /** 197 * Returns the fully qualified name of the model element. The fully qualified name includes 198 * complete package qualified name of the underlying model element. The templates parameter will 199 * be replaced by the correct one given the binding relation of the parameter to this element. 200 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement) 201 */ 202 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement) 203 { 204 return this.getSuperOperationFacade().getBindedFullyQualifiedName(bindedElement); 205 } 206 207 /** 208 * Gets all constraints belonging to the model element. 209 * @see ModelElementFacade#getConstraints() 210 */ 211 public Collection<ConstraintFacade> getConstraints() 212 { 213 return this.getSuperOperationFacade().getConstraints(); 214 } 215 216 /** 217 * Returns the constraints of the argument kind that have been placed onto this model. Typical 218 * kinds are "inv", "pre" and "post". Other kinds are possible. 219 * @see ModelElementFacade#getConstraints(String kind) 220 */ 221 public Collection<ConstraintFacade> getConstraints(String kind) 222 { 223 return this.getSuperOperationFacade().getConstraints(kind); 224 } 225 226 /** 227 * Gets the documentation for the model element, The indent argument is prefixed to each line. 228 * By default this method wraps lines after 64 characters. 229 * This method is equivalent to <code>getDocumentation(indent, 64)</code>. 230 * @see ModelElementFacade#getDocumentation(String indent) 231 */ 232 public String getDocumentation(String indent) 233 { 234 return this.getSuperOperationFacade().getDocumentation(indent); 235 } 236 237 /** 238 * This method returns the documentation for this model element, with the lines wrapped after 239 * the specified number of characters, values of less than 1 will indicate no line wrapping is 240 * required. By default paragraphs are returned as HTML. 241 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>. 242 * @see ModelElementFacade#getDocumentation(String indent, int lineLength) 243 */ 244 public String getDocumentation(String indent, int lineLength) 245 { 246 return this.getSuperOperationFacade().getDocumentation(indent, lineLength); 247 } 248 249 /** 250 * This method returns the documentation for this model element, with the lines wrapped after 251 * the specified number of characters, values of less than 1 will indicate no line wrapping is 252 * required. HTML style determines if HTML Escaping is applied. 253 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle) 254 */ 255 public String getDocumentation(String indent, int lineLength, boolean htmlStyle) 256 { 257 return this.getSuperOperationFacade().getDocumentation(indent, lineLength, htmlStyle); 258 } 259 260 /** 261 * The fully qualified name of this model element. 262 * @see ModelElementFacade#getFullyQualifiedName() 263 */ 264 public String getFullyQualifiedName() 265 { 266 return this.getSuperOperationFacade().getFullyQualifiedName(); 267 } 268 269 /** 270 * Returns the fully qualified name of the model element. The fully qualified name includes 271 * complete package qualified name of the underlying model element. If modelName is true, then 272 * the original name of the model element (the name contained within the model) will be the name 273 * returned, otherwise a name from a language mapping will be returned. 274 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName) 275 */ 276 public String getFullyQualifiedName(boolean modelName) 277 { 278 return this.getSuperOperationFacade().getFullyQualifiedName(modelName); 279 } 280 281 /** 282 * Returns the fully qualified name as a path, the returned value always starts with out a slash 283 * '/'. 284 * @see ModelElementFacade#getFullyQualifiedNamePath() 285 */ 286 public String getFullyQualifiedNamePath() 287 { 288 return this.getSuperOperationFacade().getFullyQualifiedNamePath(); 289 } 290 291 /** 292 * Gets the unique identifier of the underlying model element. 293 * @see ModelElementFacade#getId() 294 */ 295 public String getId() 296 { 297 return this.getSuperOperationFacade().getId(); 298 } 299 300 /** 301 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which 302 * are not represented by other properties, i.e. native, transient, volatile, synchronized, 303 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings: 304 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require 305 * JDK5 compiler level. 306 * @see ModelElementFacade#getKeywords() 307 */ 308 public Collection<String> getKeywords() 309 { 310 return this.getSuperOperationFacade().getKeywords(); 311 } 312 313 /** 314 * UML2: Retrieves a localized label for this named element. 315 * @see ModelElementFacade#getLabel() 316 */ 317 public String getLabel() 318 { 319 return this.getSuperOperationFacade().getLabel(); 320 } 321 322 /** 323 * The language mappings that have been set for this model element. 324 * @see ModelElementFacade#getLanguageMappings() 325 */ 326 public TypeMappings getLanguageMappings() 327 { 328 return this.getSuperOperationFacade().getLanguageMappings(); 329 } 330 331 /** 332 * Return the model containing this model element (multiple models may be loaded and processed 333 * at the same time). 334 * @see ModelElementFacade#getModel() 335 */ 336 public ModelFacade getModel() 337 { 338 return this.getSuperOperationFacade().getModel(); 339 } 340 341 /** 342 * The name of the model element. 343 * @see ModelElementFacade#getName() 344 */ 345 public String getName() 346 { 347 return this.getSuperOperationFacade().getName(); 348 } 349 350 /** 351 * Gets the package to which this model element belongs. 352 * @see ModelElementFacade#getPackage() 353 */ 354 public ModelElementFacade getPackage() 355 { 356 return this.getSuperOperationFacade().getPackage(); 357 } 358 359 /** 360 * The name of this model element's package. 361 * @see ModelElementFacade#getPackageName() 362 */ 363 public String getPackageName() 364 { 365 return this.getSuperOperationFacade().getPackageName(); 366 } 367 368 /** 369 * Gets the package name (optionally providing the ability to retrieve the model name and not 370 * the mapped name). 371 * @see ModelElementFacade#getPackageName(boolean modelName) 372 */ 373 public String getPackageName(boolean modelName) 374 { 375 return this.getSuperOperationFacade().getPackageName(modelName); 376 } 377 378 /** 379 * Returns the package as a path, the returned value always starts with out a slash '/'. 380 * @see ModelElementFacade#getPackagePath() 381 */ 382 public String getPackagePath() 383 { 384 return this.getSuperOperationFacade().getPackagePath(); 385 } 386 387 /** 388 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the 389 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from 390 * the names of the containing namespaces starting at the root of the hierarchy and ending with 391 * the name of the NamedElement itself. 392 * @see ModelElementFacade#getQualifiedName() 393 */ 394 public String getQualifiedName() 395 { 396 return this.getSuperOperationFacade().getQualifiedName(); 397 } 398 399 /** 400 * Gets the root package for the model element. 401 * @see ModelElementFacade#getRootPackage() 402 */ 403 public PackageFacade getRootPackage() 404 { 405 return this.getSuperOperationFacade().getRootPackage(); 406 } 407 408 /** 409 * Gets the dependencies for which this model element is the source. 410 * @see ModelElementFacade#getSourceDependencies() 411 */ 412 public Collection<DependencyFacade> getSourceDependencies() 413 { 414 return this.getSuperOperationFacade().getSourceDependencies(); 415 } 416 417 /** 418 * If this model element is the context of an activity graph, this represents that activity 419 * graph. 420 * @see ModelElementFacade#getStateMachineContext() 421 */ 422 public StateMachineFacade getStateMachineContext() 423 { 424 return this.getSuperOperationFacade().getStateMachineContext(); 425 } 426 427 /** 428 * The collection of ALL stereotype names for this model element. 429 * @see ModelElementFacade#getStereotypeNames() 430 */ 431 public Collection<String> getStereotypeNames() 432 { 433 return this.getSuperOperationFacade().getStereotypeNames(); 434 } 435 436 /** 437 * Gets all stereotypes for this model element. 438 * @see ModelElementFacade#getStereotypes() 439 */ 440 public Collection<StereotypeFacade> getStereotypes() 441 { 442 return this.getSuperOperationFacade().getStereotypes(); 443 } 444 445 /** 446 * Return the TaggedValues associated with this model element, under all stereotypes. 447 * @see ModelElementFacade#getTaggedValues() 448 */ 449 public Collection<TaggedValueFacade> getTaggedValues() 450 { 451 return this.getSuperOperationFacade().getTaggedValues(); 452 } 453 454 /** 455 * Gets the dependencies for which this model element is the target. 456 * @see ModelElementFacade#getTargetDependencies() 457 */ 458 public Collection<DependencyFacade> getTargetDependencies() 459 { 460 return this.getSuperOperationFacade().getTargetDependencies(); 461 } 462 463 /** 464 * Get the template parameter for this model element having the parameterName 465 * @see ModelElementFacade#getTemplateParameter(String parameterName) 466 */ 467 public Object getTemplateParameter(String parameterName) 468 { 469 return this.getSuperOperationFacade().getTemplateParameter(parameterName); 470 } 471 472 /** 473 * Get the template parameters for this model element 474 * @see ModelElementFacade#getTemplateParameters() 475 */ 476 public Collection<TemplateParameterFacade> getTemplateParameters() 477 { 478 return this.getSuperOperationFacade().getTemplateParameters(); 479 } 480 481 /** 482 * The visibility (i.e. public, private, protected or package) of the model element, will 483 * attempt a lookup for these values in the language mappings (if any). 484 * @see ModelElementFacade#getVisibility() 485 */ 486 public String getVisibility() 487 { 488 return this.getSuperOperationFacade().getVisibility(); 489 } 490 491 /** 492 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance 493 * is taken into account when searching for the stereotype), false otherwise. 494 * @see ModelElementFacade#hasExactStereotype(String stereotypeName) 495 */ 496 public boolean hasExactStereotype(String stereotypeName) 497 { 498 return this.getSuperOperationFacade().hasExactStereotype(stereotypeName); 499 } 500 501 /** 502 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, 503 * pipe, semicolon, or << >> 504 * @see ModelElementFacade#hasKeyword(String keywordName) 505 */ 506 public boolean hasKeyword(String keywordName) 507 { 508 return this.getSuperOperationFacade().hasKeyword(keywordName); 509 } 510 511 /** 512 * Returns true if the model element has the specified stereotype. If the stereotype itself 513 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if 514 * one of the stereotype's ancestors has a matching name this method will return true, false 515 * otherwise. 516 * For example, if we have a certain stereotype called <<exception>> and a model element has a 517 * stereotype called <<applicationException>> which extends <<exception>>, when calling this 518 * method with 'stereotypeName' defined as 'exception' the method would return true since 519 * <<applicationException>> inherits from <<exception>>. If you want to check if the model 520 * element has the exact stereotype, then use the method 'hasExactStereotype' instead. 521 * @see ModelElementFacade#hasStereotype(String stereotypeName) 522 */ 523 public boolean hasStereotype(String stereotypeName) 524 { 525 return this.getSuperOperationFacade().hasStereotype(stereotypeName); 526 } 527 528 /** 529 * True if there are target dependencies from this element that are instances of BindingFacade. 530 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies. 531 * @see ModelElementFacade#isBindingDependenciesPresent() 532 */ 533 public boolean isBindingDependenciesPresent() 534 { 535 return this.getSuperOperationFacade().isBindingDependenciesPresent(); 536 } 537 538 /** 539 * Indicates if any constraints are present on this model element. 540 * @see ModelElementFacade#isConstraintsPresent() 541 */ 542 public boolean isConstraintsPresent() 543 { 544 return this.getSuperOperationFacade().isConstraintsPresent(); 545 } 546 547 /** 548 * Indicates if any documentation is present on this model element. 549 * @see ModelElementFacade#isDocumentationPresent() 550 */ 551 public boolean isDocumentationPresent() 552 { 553 return this.getSuperOperationFacade().isDocumentationPresent(); 554 } 555 556 /** 557 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript. 558 * @see ModelElementFacade#isReservedWord() 559 */ 560 public boolean isReservedWord() 561 { 562 return this.getSuperOperationFacade().isReservedWord(); 563 } 564 565 /** 566 * True is there are template parameters on this model element. For UML2, applies to Class, 567 * Operation, Property, and Parameter. 568 * @see ModelElementFacade#isTemplateParametersPresent() 569 */ 570 public boolean isTemplateParametersPresent() 571 { 572 return this.getSuperOperationFacade().isTemplateParametersPresent(); 573 } 574 575 /** 576 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++, 577 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on 578 * Enumerations and Interfaces, optionally applies on other model elements. 579 * @see ModelElementFacade#isValidIdentifierName() 580 */ 581 public boolean isValidIdentifierName() 582 { 583 return this.getSuperOperationFacade().isValidIdentifierName(); 584 } 585 586 /** 587 * Searches for the constraint with the specified 'name' on this model element, and if found 588 * translates it using the specified 'translation' from a translation library discovered by the 589 * framework. 590 * @see ModelElementFacade#translateConstraint(String name, String translation) 591 */ 592 public String translateConstraint(String name, String translation) 593 { 594 return this.getSuperOperationFacade().translateConstraint(name, translation); 595 } 596 597 /** 598 * Translates all constraints belonging to this model element with the given 'translation'. 599 * @see ModelElementFacade#translateConstraints(String translation) 600 */ 601 public String[] translateConstraints(String translation) 602 { 603 return this.getSuperOperationFacade().translateConstraints(translation); 604 } 605 606 /** 607 * Translates the constraints of the specified 'kind' belonging to this model element. 608 * @see ModelElementFacade#translateConstraints(String kind, String translation) 609 */ 610 public String[] translateConstraints(String kind, String translation) 611 { 612 return this.getSuperOperationFacade().translateConstraints(kind, translation); 613 } 614 615 /** 616 * Finds the parameter on this operation having the given name, if no parameter is found, null 617 * is returned instead. 618 * @see OperationFacade#findParameter(String name) 619 */ 620 public ParameterFacade findParameter(String name) 621 { 622 return this.getSuperOperationFacade().findParameter(name); 623 } 624 625 /** 626 * Searches the given feature for the specified tag. 627 * If the follow boolean is set to true then the search will continue from the class operation 628 * to the class itself and then up the class hierarchy. 629 * @see OperationFacade#findTaggedValue(String name, boolean follow) 630 */ 631 public Object findTaggedValue(String name, boolean follow) 632 { 633 return this.getSuperOperationFacade().findTaggedValue(name, follow); 634 } 635 636 /** 637 * A comma separated list of all argument names. 638 * @see OperationFacade#getArgumentNames() 639 */ 640 public String getArgumentNames() 641 { 642 return this.getSuperOperationFacade().getArgumentNames(); 643 } 644 645 /** 646 * A comma separated list of all types of each argument, in order. 647 * @see OperationFacade#getArgumentTypeNames() 648 */ 649 public String getArgumentTypeNames() 650 { 651 return this.getSuperOperationFacade().getArgumentTypeNames(); 652 } 653 654 /** 655 * Specification of an argument used to pass information into or out of an invocation of a 656 * behavioral 657 * feature. Parameters are allowed to be treated as connectable elements. Parameters have 658 * support for 659 * streaming, exceptions, and parameter sets. 660 * @see OperationFacade#getArguments() 661 */ 662 public Collection<ParameterFacade> getArguments() 663 { 664 return this.getSuperOperationFacade().getArguments(); 665 } 666 667 /** 668 * Constructs the operation call with the operation name 669 * @see OperationFacade#getCall() 670 */ 671 public String getCall() 672 { 673 return this.getSuperOperationFacade().getCall(); 674 } 675 676 /** 677 * Returns the concurrency modifier for this operation (i.e. concurrent, guarded or sequential) 678 * of the model element, will attempt a lookup for these values in the language mappings (if 679 * any). 680 * @see OperationFacade#getConcurrency() 681 */ 682 public String getConcurrency() 683 { 684 return this.getSuperOperationFacade().getConcurrency(); 685 } 686 687 /** 688 * A comma separated list containing all exceptions that this operation throws. Exceptions are 689 * determined through dependencies that have the target element stereotyped as <<Exception>>. 690 * @see OperationFacade#getExceptionList() 691 */ 692 public String getExceptionList() 693 { 694 return this.getSuperOperationFacade().getExceptionList(); 695 } 696 697 /** 698 * Returns a comma separated list of exceptions appended to the comma separated list of fully 699 * qualified 'initialException' classes passed in to this method. 700 * @see OperationFacade#getExceptionList(String initialExceptions) 701 */ 702 public String getExceptionList(String initialExceptions) 703 { 704 return this.getSuperOperationFacade().getExceptionList(initialExceptions); 705 } 706 707 /** 708 * A collection of all exceptions thrown by this operation. 709 * @see OperationFacade#getExceptions() 710 */ 711 public Collection<ModelElementFacade> getExceptions() 712 { 713 return this.getSuperOperationFacade().getExceptions(); 714 } 715 716 /** 717 * Return Type with multiplicity taken into account. UML14 does not allow multiplicity *. 718 * @see OperationFacade#getGetterSetterReturnTypeName() 719 */ 720 public String getGetterSetterReturnTypeName() 721 { 722 return this.getSuperOperationFacade().getGetterSetterReturnTypeName(); 723 } 724 725 /** 726 * the lower value for the multiplicity 727 * -only applicable for UML2 728 * @see OperationFacade#getLower() 729 */ 730 public int getLower() 731 { 732 return this.getSuperOperationFacade().getLower(); 733 } 734 735 /** 736 * Returns the operation method body determined from UML sequence diagrams or other UML sources. 737 * @see OperationFacade#getMethodBody() 738 */ 739 public String getMethodBody() 740 { 741 return this.getSuperOperationFacade().getMethodBody(); 742 } 743 744 /** 745 * The operation this operation overrides, null if this operation is not overriding. 746 * @see OperationFacade#getOverriddenOperation() 747 */ 748 public OperationFacade getOverriddenOperation() 749 { 750 return this.getSuperOperationFacade().getOverriddenOperation(); 751 } 752 753 /** 754 * Gets the owner of this operation 755 * @see OperationFacade#getOwner() 756 */ 757 public ClassifierFacade getOwner() 758 { 759 return this.getSuperOperationFacade().getOwner(); 760 } 761 762 /** 763 * Return all parameters for the operation, including the return parameter. 764 * @see OperationFacade#getParameters() 765 */ 766 public Collection<ParameterFacade> getParameters() 767 { 768 return this.getSuperOperationFacade().getParameters(); 769 } 770 771 /** 772 * The name of the operation that handles postcondition constraints. 773 * @see OperationFacade#getPostconditionName() 774 */ 775 public String getPostconditionName() 776 { 777 return this.getSuperOperationFacade().getPostconditionName(); 778 } 779 780 /** 781 * The postcondition constraints belonging to this operation. 782 * @see OperationFacade#getPostconditions() 783 */ 784 public Collection<ConstraintFacade> getPostconditions() 785 { 786 return this.getSuperOperationFacade().getPostconditions(); 787 } 788 789 /** 790 * The call to the precondition operation. 791 * @see OperationFacade#getPreconditionCall() 792 */ 793 public String getPreconditionCall() 794 { 795 return this.getSuperOperationFacade().getPreconditionCall(); 796 } 797 798 /** 799 * The name of the operation that handles precondition constraints. 800 * @see OperationFacade#getPreconditionName() 801 */ 802 public String getPreconditionName() 803 { 804 return this.getSuperOperationFacade().getPreconditionName(); 805 } 806 807 /** 808 * The signature of the precondition operation. 809 * @see OperationFacade#getPreconditionSignature() 810 */ 811 public String getPreconditionSignature() 812 { 813 return this.getSuperOperationFacade().getPreconditionSignature(); 814 } 815 816 /** 817 * The precondition constraints belonging to this operation. 818 * @see OperationFacade#getPreconditions() 819 */ 820 public Collection<ConstraintFacade> getPreconditions() 821 { 822 return this.getSuperOperationFacade().getPreconditions(); 823 } 824 825 /** 826 * (UML2 Only). Get the actual return parameter (which may have stereotypes etc). 827 * @see OperationFacade#getReturnParameter() 828 */ 829 public ParameterFacade getReturnParameter() 830 { 831 return this.getSuperOperationFacade().getReturnParameter(); 832 } 833 834 /** 835 * The operation return type parameter. 836 * @see OperationFacade#getReturnType() 837 */ 838 public ClassifierFacade getReturnType() 839 { 840 return this.getSuperOperationFacade().getReturnType(); 841 } 842 843 /** 844 * Return the operation signature, including public/protested abstract returnType name plus 845 * argument type and name 846 * @see OperationFacade#getSignature() 847 */ 848 public String getSignature() 849 { 850 return this.getSuperOperationFacade().getSignature(); 851 } 852 853 /** 854 * Returns the signature of the operation and optionally appends the argument names (if 855 * withArgumentNames is true), otherwise returns the signature with just the types alone in the 856 * signature. 857 * @see OperationFacade#getSignature(boolean withArgumentNames) 858 */ 859 public String getSignature(boolean withArgumentNames) 860 { 861 return this.getSuperOperationFacade().getSignature(withArgumentNames); 862 } 863 864 /** 865 * Returns the signature of the operation and optionally appends the given 'argumentModifier' to 866 * each argument. 867 * @see OperationFacade#getSignature(String argumentModifier) 868 */ 869 public String getSignature(String argumentModifier) 870 { 871 return this.getSuperOperationFacade().getSignature(argumentModifier); 872 } 873 874 /** 875 * A comma-separated parameter list (type and name of each parameter) of an operation. 876 * @see OperationFacade#getTypedArgumentList() 877 */ 878 public String getTypedArgumentList() 879 { 880 return this.getSuperOperationFacade().getTypedArgumentList(); 881 } 882 883 /** 884 * A comma-separated parameter list (type and name of each parameter) of an operation with an 885 * optional modifier (i.e final) before each parameter. 886 * @see OperationFacade#getTypedArgumentList(String modifier) 887 */ 888 public String getTypedArgumentList(String modifier) 889 { 890 return this.getSuperOperationFacade().getTypedArgumentList(modifier); 891 } 892 893 /** 894 * the upper value for the multiplicity (will be -1 for *) 895 * - only applicable for UML2 896 * @see OperationFacade#getUpper() 897 */ 898 public int getUpper() 899 { 900 return this.getSuperOperationFacade().getUpper(); 901 } 902 903 /** 904 * True is the operation is abstract. 905 * @see OperationFacade#isAbstract() 906 */ 907 public boolean isAbstract() 908 { 909 return this.getSuperOperationFacade().isAbstract(); 910 } 911 912 /** 913 * True if the operation has (i.e. throws any exceptions) false otherwise. 914 * @see OperationFacade#isExceptionsPresent() 915 */ 916 public boolean isExceptionsPresent() 917 { 918 return this.getSuperOperationFacade().isExceptionsPresent(); 919 } 920 921 /** 922 * IsLeaf property in the operation. If true, operation is final, cannot be extended or 923 * implemented by a descendant. Default=false. 924 * @see OperationFacade#isLeaf() 925 */ 926 public boolean isLeaf() 927 { 928 return this.getSuperOperationFacade().isLeaf(); 929 } 930 931 /** 932 * UML2 only. If the return type parameter multiplicity>1 OR the operation multiplicity>1. 933 * Default=false. 934 * @see OperationFacade#isMany() 935 */ 936 public boolean isMany() 937 { 938 return this.getSuperOperationFacade().isMany(); 939 } 940 941 /** 942 * UML2 only: If isMany (Collection type returned), is the type unique within the collection. 943 * Unique+Ordered determines CollectionType implementation of return result. Default=false. 944 * @see OperationFacade#isOrdered() 945 */ 946 public boolean isOrdered() 947 { 948 return this.getSuperOperationFacade().isOrdered(); 949 } 950 951 /** 952 * True if this operation overrides an operation defined in an ancestor class. An operation 953 * overrides when the names of the operations as well as the types of the arguments are equal. 954 * The return type may be different and is, as well as any exceptions, ignored. 955 * @see OperationFacade#isOverriding() 956 */ 957 public boolean isOverriding() 958 { 959 return this.getSuperOperationFacade().isOverriding(); 960 } 961 962 /** 963 * Whether any postcondition constraints are present on this operation. 964 * @see OperationFacade#isPostconditionsPresent() 965 */ 966 public boolean isPostconditionsPresent() 967 { 968 return this.getSuperOperationFacade().isPostconditionsPresent(); 969 } 970 971 /** 972 * Whether any precondition constraints are present on this operation. 973 * @see OperationFacade#isPreconditionsPresent() 974 */ 975 public boolean isPreconditionsPresent() 976 { 977 return this.getSuperOperationFacade().isPreconditionsPresent(); 978 } 979 980 /** 981 * Indicates whether or not this operation is a query operation. 982 * @see OperationFacade#isQuery() 983 */ 984 public boolean isQuery() 985 { 986 return this.getSuperOperationFacade().isQuery(); 987 } 988 989 /** 990 * True/false depending on whether or not the operation has a return type or not (i.e. a return 991 * type of something other than void). 992 * @see OperationFacade#isReturnTypePresent() 993 */ 994 public boolean isReturnTypePresent() 995 { 996 return this.getSuperOperationFacade().isReturnTypePresent(); 997 } 998 999 /** 1000 * True is the operation is static (only a single instance can be instantiated). 1001 * @see OperationFacade#isStatic() 1002 */ 1003 public boolean isStatic() 1004 { 1005 return this.getSuperOperationFacade().isStatic(); 1006 } 1007 1008 /** 1009 * UML2 only: for Collection return type, is the type unique within the collection. 1010 * Unique+Ordered determines the returned CollectionType. Default=false. 1011 * @see OperationFacade#isUnique() 1012 */ 1013 public boolean isUnique() 1014 { 1015 return this.getSuperOperationFacade().isUnique(); 1016 } 1017 1018 /** 1019 * @see org.andromda.core.metafacade.MetafacadeBase#initialize() 1020 */ 1021 @Override 1022 public void initialize() 1023 { 1024 this.getSuperOperationFacade().initialize(); 1025 } 1026 1027 /** 1028 * @return Object getSuperOperationFacade().getValidationOwner() 1029 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner() 1030 */ 1031 @Override 1032 public Object getValidationOwner() 1033 { 1034 Object owner = this.getSuperOperationFacade().getValidationOwner(); 1035 return owner; 1036 } 1037 1038 /** 1039 * @return String getSuperOperationFacade().getValidationName() 1040 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName() 1041 */ 1042 @Override 1043 public String getValidationName() 1044 { 1045 String name = this.getSuperOperationFacade().getValidationName(); 1046 return name; 1047 } 1048 1049 /** 1050 * @param validationMessages Collection<ModelValidationMessage> 1051 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages) 1052 */ 1053 @Override 1054 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 1055 { 1056 this.getSuperOperationFacade().validateInvariants(validationMessages); 1057 } 1058 1059 /** 1060 * The property that stores the name of the metafacade. 1061 */ 1062 private static final String NAME_PROPERTY = "name"; 1063 private static final String FQNAME_PROPERTY = "fullyQualifiedName"; 1064 1065 /** 1066 * @see Object#toString() 1067 */ 1068 @Override 1069 public String toString() 1070 { 1071 final StringBuilder toString = new StringBuilder(this.getClass().getName()); 1072 toString.append("["); 1073 try 1074 { 1075 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY)); 1076 } 1077 catch (final Throwable tryAgain) 1078 { 1079 try 1080 { 1081 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY)); 1082 } 1083 catch (final Throwable ignore) 1084 { 1085 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property 1086 } 1087 } 1088 toString.append("]"); 1089 return toString.toString(); 1090 } 1091}