001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.cartridges.jsf.metafacades; 006 007import java.util.Collection; 008import java.util.List; 009import java.util.Map; 010import org.andromda.core.common.Introspector; 011import org.andromda.core.metafacade.MetafacadeBase; 012import org.andromda.core.metafacade.MetafacadeFactory; 013import org.andromda.core.metafacade.ModelValidationMessage; 014import org.andromda.metafacades.uml.ActionFacade; 015import org.andromda.metafacades.uml.ConstraintFacade; 016import org.andromda.metafacades.uml.DependencyFacade; 017import org.andromda.metafacades.uml.EventFacade; 018import org.andromda.metafacades.uml.FrontEndAction; 019import org.andromda.metafacades.uml.FrontEndActivityGraph; 020import org.andromda.metafacades.uml.FrontEndControllerOperation; 021import org.andromda.metafacades.uml.FrontEndEvent; 022import org.andromda.metafacades.uml.FrontEndForward; 023import org.andromda.metafacades.uml.FrontEndParameter; 024import org.andromda.metafacades.uml.FrontEndUseCase; 025import org.andromda.metafacades.uml.GuardFacade; 026import org.andromda.metafacades.uml.ModelElementFacade; 027import org.andromda.metafacades.uml.ModelFacade; 028import org.andromda.metafacades.uml.PackageFacade; 029import org.andromda.metafacades.uml.StateMachineFacade; 030import org.andromda.metafacades.uml.StateVertexFacade; 031import org.andromda.metafacades.uml.StereotypeFacade; 032import org.andromda.metafacades.uml.TaggedValueFacade; 033import org.andromda.metafacades.uml.TemplateParameterFacade; 034import org.andromda.metafacades.uml.TypeMappings; 035import org.andromda.translation.ocl.validation.OCLCollections; 036import org.andromda.translation.ocl.validation.OCLIntrospector; 037import org.andromda.translation.ocl.validation.OCLResultEnsurer; 038import org.apache.log4j.Logger; 039 040/** 041 * Represents a forward within a JSF activity graph. 042 * MetafacadeLogic for JSFForward 043 * 044 * @see JSFForward 045 */ 046public abstract class JSFForwardLogic 047 extends MetafacadeBase 048 implements JSFForward 049{ 050 /** 051 * The underlying UML object 052 * @see Object 053 */ 054 protected Object metaObject; 055 056 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 057 * @param metaObjectIn 058 * @param context 059 */ 060 protected JSFForwardLogic(Object metaObjectIn, String context) 061 { 062 super(metaObjectIn, getContext(context)); 063 this.superFrontEndForward = 064 (FrontEndForward) 065 MetafacadeFactory.getInstance().createFacadeImpl( 066 "org.andromda.metafacades.uml.FrontEndForward", 067 metaObjectIn, 068 getContext(context)); 069 this.metaObject = metaObjectIn; 070 } 071 072 /** 073 * The logger instance. 074 */ 075 private static final Logger logger = Logger.getLogger(JSFForwardLogic.class); 076 077 /** 078 * Gets the context for this metafacade logic instance. 079 * @param context String. Set to JSFForward if null 080 * @return context String 081 */ 082 private static String getContext(String context) 083 { 084 if (context == null) 085 { 086 context = "org.andromda.cartridges.jsf.metafacades.JSFForward"; 087 } 088 return context; 089 } 090 091 private FrontEndForward superFrontEndForward; 092 private boolean superFrontEndForwardInitialized = false; 093 094 /** 095 * Gets the FrontEndForward parent instance. 096 * @return this.superFrontEndForward FrontEndForward 097 */ 098 private FrontEndForward getSuperFrontEndForward() 099 { 100 if (!this.superFrontEndForwardInitialized) 101 { 102 ((MetafacadeBase)this.superFrontEndForward).setMetafacadeContext(this.getMetafacadeContext()); 103 this.superFrontEndForwardInitialized = true; 104 } 105 return this.superFrontEndForward; 106 } 107 108 /** Reset context only for non-root metafacades 109 * @param context 110 * @see MetafacadeBase#resetMetafacadeContext(String context) 111 */ 112 @Override 113 public void resetMetafacadeContext(String context) 114 { 115 if (!this.contextRoot) // reset context only for non-root metafacades 116 { 117 context = getContext(context); // to have same value as in original constructor call 118 setMetafacadeContext (context); 119 if (this.superFrontEndForwardInitialized) 120 { 121 ((MetafacadeBase)this.superFrontEndForward).resetMetafacadeContext(context); 122 } 123 } 124 } 125 126 /** 127 * @return boolean true always 128 * @see JSFForward 129 */ 130 public boolean isJSFForwardMetaType() 131 { 132 return true; 133 } 134 135 // --------------- attributes --------------------- 136 137 /** 138 * @see org.andromda.cartridges.jsf.metafacades.JSFForward#getPath() 139 * @return String 140 */ 141 protected abstract String handleGetPath(); 142 143 private String __path1a; 144 private boolean __path1aSet = false; 145 146 /** 147 * The path to which this forward points. 148 * @return (String)handleGetPath() 149 */ 150 public final String getPath() 151 { 152 String path1a = this.__path1a; 153 if (!this.__path1aSet) 154 { 155 // path has no pre constraints 156 path1a = handleGetPath(); 157 // path has no post constraints 158 this.__path1a = path1a; 159 if (isMetafacadePropertyCachingEnabled()) 160 { 161 this.__path1aSet = true; 162 } 163 } 164 return path1a; 165 } 166 167 /** 168 * @see org.andromda.cartridges.jsf.metafacades.JSFForward#isFinalStateTarget() 169 * @return boolean 170 */ 171 protected abstract boolean handleIsFinalStateTarget(); 172 173 private boolean __finalStateTarget2a; 174 private boolean __finalStateTarget2aSet = false; 175 176 /** 177 * Indicates whether or not a final state is the target of this forward. 178 * @return (boolean)handleIsFinalStateTarget() 179 */ 180 public final boolean isFinalStateTarget() 181 { 182 boolean finalStateTarget2a = this.__finalStateTarget2a; 183 if (!this.__finalStateTarget2aSet) 184 { 185 // finalStateTarget has no pre constraints 186 finalStateTarget2a = handleIsFinalStateTarget(); 187 // finalStateTarget has no post constraints 188 this.__finalStateTarget2a = finalStateTarget2a; 189 if (isMetafacadePropertyCachingEnabled()) 190 { 191 this.__finalStateTarget2aSet = true; 192 } 193 } 194 return finalStateTarget2a; 195 } 196 197 /** 198 * @see org.andromda.cartridges.jsf.metafacades.JSFForward#getFromOutcome() 199 * @return String 200 */ 201 protected abstract String handleGetFromOutcome(); 202 203 private String __fromOutcome3a; 204 private boolean __fromOutcome3aSet = false; 205 206 /** 207 * The name that corresponds to the from-outcome in an navigational rule. 208 * @return (String)handleGetFromOutcome() 209 */ 210 public final String getFromOutcome() 211 { 212 String fromOutcome3a = this.__fromOutcome3a; 213 if (!this.__fromOutcome3aSet) 214 { 215 // fromOutcome has no pre constraints 216 fromOutcome3a = handleGetFromOutcome(); 217 // fromOutcome has no post constraints 218 this.__fromOutcome3a = fromOutcome3a; 219 if (isMetafacadePropertyCachingEnabled()) 220 { 221 this.__fromOutcome3aSet = true; 222 } 223 } 224 return fromOutcome3a; 225 } 226 227 /** 228 * @see org.andromda.cartridges.jsf.metafacades.JSFForward#getSuccessMessages() 229 * @return Map 230 */ 231 protected abstract Map handleGetSuccessMessages(); 232 233 private Map __successMessages4a; 234 private boolean __successMessages4aSet = false; 235 236 /** 237 * Messages used to indicate successful execution. 238 * @return (Map)handleGetSuccessMessages() 239 */ 240 public final Map getSuccessMessages() 241 { 242 Map successMessages4a = this.__successMessages4a; 243 if (!this.__successMessages4aSet) 244 { 245 // successMessages has no pre constraints 246 successMessages4a = handleGetSuccessMessages(); 247 // successMessages has no post constraints 248 this.__successMessages4a = successMessages4a; 249 if (isMetafacadePropertyCachingEnabled()) 250 { 251 this.__successMessages4aSet = true; 252 } 253 } 254 return successMessages4a; 255 } 256 257 /** 258 * @see org.andromda.cartridges.jsf.metafacades.JSFForward#isSuccessMessagesPresent() 259 * @return boolean 260 */ 261 protected abstract boolean handleIsSuccessMessagesPresent(); 262 263 private boolean __successMessagesPresent5a; 264 private boolean __successMessagesPresent5aSet = false; 265 266 /** 267 * Indicates whether or not any success messags are present. 268 * @return (boolean)handleIsSuccessMessagesPresent() 269 */ 270 public final boolean isSuccessMessagesPresent() 271 { 272 boolean successMessagesPresent5a = this.__successMessagesPresent5a; 273 if (!this.__successMessagesPresent5aSet) 274 { 275 // successMessagesPresent has no pre constraints 276 successMessagesPresent5a = handleIsSuccessMessagesPresent(); 277 // successMessagesPresent has no post constraints 278 this.__successMessagesPresent5a = successMessagesPresent5a; 279 if (isMetafacadePropertyCachingEnabled()) 280 { 281 this.__successMessagesPresent5aSet = true; 282 } 283 } 284 return successMessagesPresent5a; 285 } 286 287 /** 288 * @see org.andromda.cartridges.jsf.metafacades.JSFForward#getWarningMessages() 289 * @return Map 290 */ 291 protected abstract Map handleGetWarningMessages(); 292 293 private Map __warningMessages6a; 294 private boolean __warningMessages6aSet = false; 295 296 /** 297 * Any messages used to indicate a warning. 298 * @return (Map)handleGetWarningMessages() 299 */ 300 public final Map getWarningMessages() 301 { 302 Map warningMessages6a = this.__warningMessages6a; 303 if (!this.__warningMessages6aSet) 304 { 305 // warningMessages has no pre constraints 306 warningMessages6a = handleGetWarningMessages(); 307 // warningMessages has no post constraints 308 this.__warningMessages6a = warningMessages6a; 309 if (isMetafacadePropertyCachingEnabled()) 310 { 311 this.__warningMessages6aSet = true; 312 } 313 } 314 return warningMessages6a; 315 } 316 317 /** 318 * @see org.andromda.cartridges.jsf.metafacades.JSFForward#isWarningMessagesPresent() 319 * @return boolean 320 */ 321 protected abstract boolean handleIsWarningMessagesPresent(); 322 323 private boolean __warningMessagesPresent7a; 324 private boolean __warningMessagesPresent7aSet = false; 325 326 /** 327 * Whether or not any warning messages are present. 328 * @return (boolean)handleIsWarningMessagesPresent() 329 */ 330 public final boolean isWarningMessagesPresent() 331 { 332 boolean warningMessagesPresent7a = this.__warningMessagesPresent7a; 333 if (!this.__warningMessagesPresent7aSet) 334 { 335 // warningMessagesPresent has no pre constraints 336 warningMessagesPresent7a = handleIsWarningMessagesPresent(); 337 // warningMessagesPresent has no post constraints 338 this.__warningMessagesPresent7a = warningMessagesPresent7a; 339 if (isMetafacadePropertyCachingEnabled()) 340 { 341 this.__warningMessagesPresent7aSet = true; 342 } 343 } 344 return warningMessagesPresent7a; 345 } 346 347 // ------------- associations ------------------ 348 349 /** 350 * @return true 351 * @see FrontEndForward 352 */ 353 public boolean isFrontEndForwardMetaType() 354 { 355 return true; 356 } 357 358 /** 359 * @return true 360 * @see org.andromda.metafacades.uml.TransitionFacade 361 */ 362 public boolean isTransitionFacadeMetaType() 363 { 364 return true; 365 } 366 367 /** 368 * @return true 369 * @see ModelElementFacade 370 */ 371 public boolean isModelElementFacadeMetaType() 372 { 373 return true; 374 } 375 376 // ----------- delegates to FrontEndForward ------------ 377 /** 378 * The method name used to delegate to this forward. 379 * @see FrontEndForward#getActionMethodName() 380 */ 381 public String getActionMethodName() 382 { 383 return this.getSuperFrontEndForward().getActionMethodName(); 384 } 385 386 /** 387 * The front-end actions directly containing this front-end forward. 388 * @see FrontEndForward#getActions() 389 */ 390 public List<FrontEndAction> getActions() 391 { 392 return this.getSuperFrontEndForward().getActions(); 393 } 394 395 /** 396 * The trigger for this front-end forward. 397 * @see FrontEndForward#getDecisionTrigger() 398 */ 399 public FrontEndEvent getDecisionTrigger() 400 { 401 return this.getSuperFrontEndForward().getDecisionTrigger(); 402 } 403 404 /** 405 * Tthe set of parameter used during transport in this forward. 406 * @see FrontEndForward#getForwardParameters() 407 */ 408 public List<FrontEndParameter> getForwardParameters() 409 { 410 return this.getSuperFrontEndForward().getForwardParameters(); 411 } 412 413 /** 414 * The activity graph which holds this forward if the graph is contained in a FrontEndUseCase. 415 * @see FrontEndForward#getFrontEndActivityGraph() 416 */ 417 public FrontEndActivityGraph getFrontEndActivityGraph() 418 { 419 return this.getSuperFrontEndForward().getFrontEndActivityGraph(); 420 } 421 422 /** 423 * The operation to which is called during execution of this front-end forward. 424 * @see FrontEndForward#getOperationCall() 425 */ 426 public FrontEndControllerOperation getOperationCall() 427 { 428 return this.getSuperFrontEndForward().getOperationCall(); 429 } 430 431 /** 432 * The use case in which this forward is contained. 433 * @see FrontEndForward#getUseCase() 434 */ 435 public FrontEndUseCase getUseCase() 436 { 437 return this.getSuperFrontEndForward().getUseCase(); 438 } 439 440 /** 441 * Indicates if this forward is contained in a FrontEndUseCase. 442 * @see FrontEndForward#isContainedInFrontEndUseCase() 443 */ 444 public boolean isContainedInFrontEndUseCase() 445 { 446 return this.getSuperFrontEndForward().isContainedInFrontEndUseCase(); 447 } 448 449 /** 450 * Indicates if this action directly targets a "front-end" view, false otherwise. 451 * @see FrontEndForward#isEnteringView() 452 */ 453 public boolean isEnteringView() 454 { 455 return this.getSuperFrontEndForward().isEnteringView(); 456 } 457 458 /** 459 * Indicates if this forward (transition) is coming out of a front-end view. 460 * @see FrontEndForward#isExitingView() 461 */ 462 public boolean isExitingView() 463 { 464 return this.getSuperFrontEndForward().isExitingView(); 465 } 466 467 /** 468 * Copies all tagged values from the given ModelElementFacade to this model element facade. 469 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element) 470 */ 471 public void copyTaggedValues(ModelElementFacade element) 472 { 473 this.getSuperFrontEndForward().copyTaggedValues(element); 474 } 475 476 /** 477 * Finds the tagged value with the specified 'tagName'. In case there are more values the first 478 * one found will be returned. 479 * @see ModelElementFacade#findTaggedValue(String tagName) 480 */ 481 public Object findTaggedValue(String tagName) 482 { 483 return this.getSuperFrontEndForward().findTaggedValue(tagName); 484 } 485 486 /** 487 * Returns all the values for the tagged value with the specified name. The returned collection 488 * will contains only String instances, or will be empty. Never null. 489 * @see ModelElementFacade#findTaggedValues(String tagName) 490 */ 491 public Collection<Object> findTaggedValues(String tagName) 492 { 493 return this.getSuperFrontEndForward().findTaggedValues(tagName); 494 } 495 496 /** 497 * Returns the fully qualified name of the model element. The fully qualified name includes 498 * complete package qualified name of the underlying model element. The templates parameter will 499 * be replaced by the correct one given the binding relation of the parameter to this element. 500 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement) 501 */ 502 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement) 503 { 504 return this.getSuperFrontEndForward().getBindedFullyQualifiedName(bindedElement); 505 } 506 507 /** 508 * Gets all constraints belonging to the model element. 509 * @see ModelElementFacade#getConstraints() 510 */ 511 public Collection<ConstraintFacade> getConstraints() 512 { 513 return this.getSuperFrontEndForward().getConstraints(); 514 } 515 516 /** 517 * Returns the constraints of the argument kind that have been placed onto this model. Typical 518 * kinds are "inv", "pre" and "post". Other kinds are possible. 519 * @see ModelElementFacade#getConstraints(String kind) 520 */ 521 public Collection<ConstraintFacade> getConstraints(String kind) 522 { 523 return this.getSuperFrontEndForward().getConstraints(kind); 524 } 525 526 /** 527 * Gets the documentation for the model element, The indent argument is prefixed to each line. 528 * By default this method wraps lines after 64 characters. 529 * This method is equivalent to <code>getDocumentation(indent, 64)</code>. 530 * @see ModelElementFacade#getDocumentation(String indent) 531 */ 532 public String getDocumentation(String indent) 533 { 534 return this.getSuperFrontEndForward().getDocumentation(indent); 535 } 536 537 /** 538 * This method returns the documentation for this model element, with the lines wrapped after 539 * the specified number of characters, values of less than 1 will indicate no line wrapping is 540 * required. By default paragraphs are returned as HTML. 541 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>. 542 * @see ModelElementFacade#getDocumentation(String indent, int lineLength) 543 */ 544 public String getDocumentation(String indent, int lineLength) 545 { 546 return this.getSuperFrontEndForward().getDocumentation(indent, lineLength); 547 } 548 549 /** 550 * This method returns the documentation for this model element, with the lines wrapped after 551 * the specified number of characters, values of less than 1 will indicate no line wrapping is 552 * required. HTML style determines if HTML Escaping is applied. 553 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle) 554 */ 555 public String getDocumentation(String indent, int lineLength, boolean htmlStyle) 556 { 557 return this.getSuperFrontEndForward().getDocumentation(indent, lineLength, htmlStyle); 558 } 559 560 /** 561 * The fully qualified name of this model element. 562 * @see ModelElementFacade#getFullyQualifiedName() 563 */ 564 public String getFullyQualifiedName() 565 { 566 return this.getSuperFrontEndForward().getFullyQualifiedName(); 567 } 568 569 /** 570 * Returns the fully qualified name of the model element. The fully qualified name includes 571 * complete package qualified name of the underlying model element. If modelName is true, then 572 * the original name of the model element (the name contained within the model) will be the name 573 * returned, otherwise a name from a language mapping will be returned. 574 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName) 575 */ 576 public String getFullyQualifiedName(boolean modelName) 577 { 578 return this.getSuperFrontEndForward().getFullyQualifiedName(modelName); 579 } 580 581 /** 582 * Returns the fully qualified name as a path, the returned value always starts with out a slash 583 * '/'. 584 * @see ModelElementFacade#getFullyQualifiedNamePath() 585 */ 586 public String getFullyQualifiedNamePath() 587 { 588 return this.getSuperFrontEndForward().getFullyQualifiedNamePath(); 589 } 590 591 /** 592 * Gets the unique identifier of the underlying model element. 593 * @see ModelElementFacade#getId() 594 */ 595 public String getId() 596 { 597 return this.getSuperFrontEndForward().getId(); 598 } 599 600 /** 601 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which 602 * are not represented by other properties, i.e. native, transient, volatile, synchronized, 603 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings: 604 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require 605 * JDK5 compiler level. 606 * @see ModelElementFacade#getKeywords() 607 */ 608 public Collection<String> getKeywords() 609 { 610 return this.getSuperFrontEndForward().getKeywords(); 611 } 612 613 /** 614 * UML2: Retrieves a localized label for this named element. 615 * @see ModelElementFacade#getLabel() 616 */ 617 public String getLabel() 618 { 619 return this.getSuperFrontEndForward().getLabel(); 620 } 621 622 /** 623 * The language mappings that have been set for this model element. 624 * @see ModelElementFacade#getLanguageMappings() 625 */ 626 public TypeMappings getLanguageMappings() 627 { 628 return this.getSuperFrontEndForward().getLanguageMappings(); 629 } 630 631 /** 632 * Return the model containing this model element (multiple models may be loaded and processed 633 * at the same time). 634 * @see ModelElementFacade#getModel() 635 */ 636 public ModelFacade getModel() 637 { 638 return this.getSuperFrontEndForward().getModel(); 639 } 640 641 /** 642 * The name of the model element. 643 * @see ModelElementFacade#getName() 644 */ 645 public String getName() 646 { 647 return this.getSuperFrontEndForward().getName(); 648 } 649 650 /** 651 * Gets the package to which this model element belongs. 652 * @see ModelElementFacade#getPackage() 653 */ 654 public ModelElementFacade getPackage() 655 { 656 return this.getSuperFrontEndForward().getPackage(); 657 } 658 659 /** 660 * The name of this model element's package. 661 * @see ModelElementFacade#getPackageName() 662 */ 663 public String getPackageName() 664 { 665 return this.getSuperFrontEndForward().getPackageName(); 666 } 667 668 /** 669 * Gets the package name (optionally providing the ability to retrieve the model name and not 670 * the mapped name). 671 * @see ModelElementFacade#getPackageName(boolean modelName) 672 */ 673 public String getPackageName(boolean modelName) 674 { 675 return this.getSuperFrontEndForward().getPackageName(modelName); 676 } 677 678 /** 679 * Returns the package as a path, the returned value always starts with out a slash '/'. 680 * @see ModelElementFacade#getPackagePath() 681 */ 682 public String getPackagePath() 683 { 684 return this.getSuperFrontEndForward().getPackagePath(); 685 } 686 687 /** 688 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the 689 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from 690 * the names of the containing namespaces starting at the root of the hierarchy and ending with 691 * the name of the NamedElement itself. 692 * @see ModelElementFacade#getQualifiedName() 693 */ 694 public String getQualifiedName() 695 { 696 return this.getSuperFrontEndForward().getQualifiedName(); 697 } 698 699 /** 700 * Gets the root package for the model element. 701 * @see ModelElementFacade#getRootPackage() 702 */ 703 public PackageFacade getRootPackage() 704 { 705 return this.getSuperFrontEndForward().getRootPackage(); 706 } 707 708 /** 709 * Gets the dependencies for which this model element is the source. 710 * @see ModelElementFacade#getSourceDependencies() 711 */ 712 public Collection<DependencyFacade> getSourceDependencies() 713 { 714 return this.getSuperFrontEndForward().getSourceDependencies(); 715 } 716 717 /** 718 * If this model element is the context of an activity graph, this represents that activity 719 * graph. 720 * @see ModelElementFacade#getStateMachineContext() 721 */ 722 public StateMachineFacade getStateMachineContext() 723 { 724 return this.getSuperFrontEndForward().getStateMachineContext(); 725 } 726 727 /** 728 * The collection of ALL stereotype names for this model element. 729 * @see ModelElementFacade#getStereotypeNames() 730 */ 731 public Collection<String> getStereotypeNames() 732 { 733 return this.getSuperFrontEndForward().getStereotypeNames(); 734 } 735 736 /** 737 * Gets all stereotypes for this model element. 738 * @see ModelElementFacade#getStereotypes() 739 */ 740 public Collection<StereotypeFacade> getStereotypes() 741 { 742 return this.getSuperFrontEndForward().getStereotypes(); 743 } 744 745 /** 746 * Return the TaggedValues associated with this model element, under all stereotypes. 747 * @see ModelElementFacade#getTaggedValues() 748 */ 749 public Collection<TaggedValueFacade> getTaggedValues() 750 { 751 return this.getSuperFrontEndForward().getTaggedValues(); 752 } 753 754 /** 755 * Gets the dependencies for which this model element is the target. 756 * @see ModelElementFacade#getTargetDependencies() 757 */ 758 public Collection<DependencyFacade> getTargetDependencies() 759 { 760 return this.getSuperFrontEndForward().getTargetDependencies(); 761 } 762 763 /** 764 * Get the template parameter for this model element having the parameterName 765 * @see ModelElementFacade#getTemplateParameter(String parameterName) 766 */ 767 public Object getTemplateParameter(String parameterName) 768 { 769 return this.getSuperFrontEndForward().getTemplateParameter(parameterName); 770 } 771 772 /** 773 * Get the template parameters for this model element 774 * @see ModelElementFacade#getTemplateParameters() 775 */ 776 public Collection<TemplateParameterFacade> getTemplateParameters() 777 { 778 return this.getSuperFrontEndForward().getTemplateParameters(); 779 } 780 781 /** 782 * The visibility (i.e. public, private, protected or package) of the model element, will 783 * attempt a lookup for these values in the language mappings (if any). 784 * @see ModelElementFacade#getVisibility() 785 */ 786 public String getVisibility() 787 { 788 return this.getSuperFrontEndForward().getVisibility(); 789 } 790 791 /** 792 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance 793 * is taken into account when searching for the stereotype), false otherwise. 794 * @see ModelElementFacade#hasExactStereotype(String stereotypeName) 795 */ 796 public boolean hasExactStereotype(String stereotypeName) 797 { 798 return this.getSuperFrontEndForward().hasExactStereotype(stereotypeName); 799 } 800 801 /** 802 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, 803 * pipe, semicolon, or << >> 804 * @see ModelElementFacade#hasKeyword(String keywordName) 805 */ 806 public boolean hasKeyword(String keywordName) 807 { 808 return this.getSuperFrontEndForward().hasKeyword(keywordName); 809 } 810 811 /** 812 * Returns true if the model element has the specified stereotype. If the stereotype itself 813 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if 814 * one of the stereotype's ancestors has a matching name this method will return true, false 815 * otherwise. 816 * For example, if we have a certain stereotype called <<exception>> and a model element has a 817 * stereotype called <<applicationException>> which extends <<exception>>, when calling this 818 * method with 'stereotypeName' defined as 'exception' the method would return true since 819 * <<applicationException>> inherits from <<exception>>. If you want to check if the model 820 * element has the exact stereotype, then use the method 'hasExactStereotype' instead. 821 * @see ModelElementFacade#hasStereotype(String stereotypeName) 822 */ 823 public boolean hasStereotype(String stereotypeName) 824 { 825 return this.getSuperFrontEndForward().hasStereotype(stereotypeName); 826 } 827 828 /** 829 * True if there are target dependencies from this element that are instances of BindingFacade. 830 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies. 831 * @see ModelElementFacade#isBindingDependenciesPresent() 832 */ 833 public boolean isBindingDependenciesPresent() 834 { 835 return this.getSuperFrontEndForward().isBindingDependenciesPresent(); 836 } 837 838 /** 839 * Indicates if any constraints are present on this model element. 840 * @see ModelElementFacade#isConstraintsPresent() 841 */ 842 public boolean isConstraintsPresent() 843 { 844 return this.getSuperFrontEndForward().isConstraintsPresent(); 845 } 846 847 /** 848 * Indicates if any documentation is present on this model element. 849 * @see ModelElementFacade#isDocumentationPresent() 850 */ 851 public boolean isDocumentationPresent() 852 { 853 return this.getSuperFrontEndForward().isDocumentationPresent(); 854 } 855 856 /** 857 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript. 858 * @see ModelElementFacade#isReservedWord() 859 */ 860 public boolean isReservedWord() 861 { 862 return this.getSuperFrontEndForward().isReservedWord(); 863 } 864 865 /** 866 * True is there are template parameters on this model element. For UML2, applies to Class, 867 * Operation, Property, and Parameter. 868 * @see ModelElementFacade#isTemplateParametersPresent() 869 */ 870 public boolean isTemplateParametersPresent() 871 { 872 return this.getSuperFrontEndForward().isTemplateParametersPresent(); 873 } 874 875 /** 876 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++, 877 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on 878 * Enumerations and Interfaces, optionally applies on other model elements. 879 * @see ModelElementFacade#isValidIdentifierName() 880 */ 881 public boolean isValidIdentifierName() 882 { 883 return this.getSuperFrontEndForward().isValidIdentifierName(); 884 } 885 886 /** 887 * Searches for the constraint with the specified 'name' on this model element, and if found 888 * translates it using the specified 'translation' from a translation library discovered by the 889 * framework. 890 * @see ModelElementFacade#translateConstraint(String name, String translation) 891 */ 892 public String translateConstraint(String name, String translation) 893 { 894 return this.getSuperFrontEndForward().translateConstraint(name, translation); 895 } 896 897 /** 898 * Translates all constraints belonging to this model element with the given 'translation'. 899 * @see ModelElementFacade#translateConstraints(String translation) 900 */ 901 public String[] translateConstraints(String translation) 902 { 903 return this.getSuperFrontEndForward().translateConstraints(translation); 904 } 905 906 /** 907 * Translates the constraints of the specified 'kind' belonging to this model element. 908 * @see ModelElementFacade#translateConstraints(String kind, String translation) 909 */ 910 public String[] translateConstraints(String kind, String translation) 911 { 912 return this.getSuperFrontEndForward().translateConstraints(kind, translation); 913 } 914 915 /** 916 * An action is a named element that is the fundamental unit of executable functionality. The 917 * execution 918 * of an action represents some transformation or processing in the modeled system, be it a 919 * computer 920 * system or otherwise. An action represents a single step within an activity, that is, one that 921 * is not 922 * further decomposed within the activity. An action has pre- and post-conditions. 923 * @see org.andromda.metafacades.uml.TransitionFacade#getEffect() 924 */ 925 public ActionFacade getEffect() 926 { 927 return this.getSuperFrontEndForward().getEffect(); 928 } 929 930 /** 931 * A representation of the model object 'Constraint'. A condition or restriction expressed in 932 * natural 933 * language text or in a machine readable language for the purpose of declaring some of the 934 * semantics 935 * of an element. 936 * @see org.andromda.metafacades.uml.TransitionFacade#getGuard() 937 */ 938 public GuardFacade getGuard() 939 { 940 return this.getSuperFrontEndForward().getGuard(); 941 } 942 943 /** 944 * A representation of the model object 'Vertex'. An abstraction of a node in a state machine 945 * graph. In 946 * general, it can be the source or destination of any number of transitions. 947 * @see org.andromda.metafacades.uml.TransitionFacade#getSource() 948 */ 949 public StateVertexFacade getSource() 950 { 951 return this.getSuperFrontEndForward().getSource(); 952 } 953 954 /** 955 * A representation of the model object 'Vertex'. An abstraction of a node in a state machine 956 * graph. In 957 * general, it can be the source or destination of any number of transitions. 958 * @see org.andromda.metafacades.uml.TransitionFacade#getTarget() 959 */ 960 public StateVertexFacade getTarget() 961 { 962 return this.getSuperFrontEndForward().getTarget(); 963 } 964 965 /** 966 * If a trigger is present on this transition, this event represents that trigger. 967 * @see org.andromda.metafacades.uml.TransitionFacade#getTrigger() 968 */ 969 public EventFacade getTrigger() 970 { 971 return this.getSuperFrontEndForward().getTrigger(); 972 } 973 974 /** 975 * TODO: Model Documentation for 976 * org.andromda.metafacades.uml.TransitionFacade.enteringActionState 977 * @see org.andromda.metafacades.uml.TransitionFacade#isEnteringActionState() 978 */ 979 public boolean isEnteringActionState() 980 { 981 return this.getSuperFrontEndForward().isEnteringActionState(); 982 } 983 984 /** 985 * TODO: Model Documentation for 986 * org.andromda.metafacades.uml.TransitionFacade.enteringDecisionPoint 987 * @see org.andromda.metafacades.uml.TransitionFacade#isEnteringDecisionPoint() 988 */ 989 public boolean isEnteringDecisionPoint() 990 { 991 return this.getSuperFrontEndForward().isEnteringDecisionPoint(); 992 } 993 994 /** 995 * TODO: Model Documentation for 996 * org.andromda.metafacades.uml.TransitionFacade.enteringFinalState 997 * @see org.andromda.metafacades.uml.TransitionFacade#isEnteringFinalState() 998 */ 999 public boolean isEnteringFinalState() 1000 { 1001 return this.getSuperFrontEndForward().isEnteringFinalState(); 1002 } 1003 1004 /** 1005 * TODO: Model Documentation for 1006 * org.andromda.metafacades.uml.TransitionFacade.exitingActionState 1007 * @see org.andromda.metafacades.uml.TransitionFacade#isExitingActionState() 1008 */ 1009 public boolean isExitingActionState() 1010 { 1011 return this.getSuperFrontEndForward().isExitingActionState(); 1012 } 1013 1014 /** 1015 * TODO: Model Documentation for 1016 * org.andromda.metafacades.uml.TransitionFacade.exitingDecisionPoint 1017 * @see org.andromda.metafacades.uml.TransitionFacade#isExitingDecisionPoint() 1018 */ 1019 public boolean isExitingDecisionPoint() 1020 { 1021 return this.getSuperFrontEndForward().isExitingDecisionPoint(); 1022 } 1023 1024 /** 1025 * TODO: Model Documentation for 1026 * org.andromda.metafacades.uml.TransitionFacade.exitingInitialState 1027 * @see org.andromda.metafacades.uml.TransitionFacade#isExitingInitialState() 1028 */ 1029 public boolean isExitingInitialState() 1030 { 1031 return this.getSuperFrontEndForward().isExitingInitialState(); 1032 } 1033 1034 /** 1035 * TODO: Model Documentation for org.andromda.metafacades.uml.TransitionFacade.triggerPresent 1036 * @see org.andromda.metafacades.uml.TransitionFacade#isTriggerPresent() 1037 */ 1038 public boolean isTriggerPresent() 1039 { 1040 return this.getSuperFrontEndForward().isTriggerPresent(); 1041 } 1042 1043 /** 1044 * @see MetafacadeBase#initialize() 1045 */ 1046 @Override 1047 public void initialize() 1048 { 1049 this.getSuperFrontEndForward().initialize(); 1050 } 1051 1052 /** 1053 * @return Object getSuperFrontEndForward().getValidationOwner() 1054 * @see MetafacadeBase#getValidationOwner() 1055 */ 1056 @Override 1057 public Object getValidationOwner() 1058 { 1059 Object owner = this.getSuperFrontEndForward().getValidationOwner(); 1060 return owner; 1061 } 1062 1063 /** 1064 * @return String getSuperFrontEndForward().getValidationName() 1065 * @see MetafacadeBase#getValidationName() 1066 */ 1067 @Override 1068 public String getValidationName() 1069 { 1070 String name = this.getSuperFrontEndForward().getValidationName(); 1071 return name; 1072 } 1073 1074 /** 1075 * <p><b>Constraint:</b> org::andromda::cartridges::jsf::metafacades::JSFForward::decision forwards need a controller operation with a non-void return type</p> 1076 * <p><b>Error:</b> If a transition is going into a decision point you will need to defer to an operation with a non-void return type. You will need to model this on the transition's trigger.</p> 1077 * <p><b>OCL:</b> context JSFForward inv: enteringDecisionPoint implies (decisionTrigger->notEmpty() and operationCall->notEmpty() and operationCall.returnTypePresent)</p> 1078 * @param validationMessages Collection<ModelValidationMessage> 1079 * @see MetafacadeBase#validateInvariants(Collection validationMessages) 1080 */ 1081 @Override 1082 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 1083 { 1084 this.getSuperFrontEndForward().validateInvariants(validationMessages); 1085 try 1086 { 1087 final Object contextElement = this.THIS(); 1088 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"enteringDecisionPoint"))).booleanValue()?(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"decisionTrigger"))&&OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"operationCall"))&&Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"operationCall.returnTypePresent"))).booleanValue()):true)); 1089 if (!constraintValid) 1090 { 1091 validationMessages.add( 1092 new ModelValidationMessage( 1093 (MetafacadeBase)contextElement , 1094 "org::andromda::cartridges::jsf::metafacades::JSFForward::decision forwards need a controller operation with a non-void return type", 1095 "If a transition is going into a decision point you will need to defer to an operation with a non-void return type. You will need to model this on the transition's trigger.")); 1096 } 1097 } 1098 catch (Throwable th) 1099 { 1100 Throwable cause = th.getCause(); 1101 int depth = 0; // Some throwables have infinite recursion 1102 while (cause != null && depth < 7) 1103 { 1104 th = cause; 1105 depth++; 1106 } 1107 logger.error("Error validating constraint 'org::andromda::cartridges::jsf::metafacades::JSFForward::decision forwards need a controller operation with a non-void return type' ON " 1108 + this.THIS().toString() + ": " + th.getMessage(), th); 1109 } 1110 } 1111 1112 /** 1113 * The property that stores the name of the metafacade. 1114 */ 1115 private static final String NAME_PROPERTY = "name"; 1116 private static final String FQNAME_PROPERTY = "fullyQualifiedName"; 1117 1118 /** 1119 * @see Object#toString() 1120 */ 1121 @Override 1122 public String toString() 1123 { 1124 final StringBuilder toString = new StringBuilder(this.getClass().getName()); 1125 toString.append("["); 1126 try 1127 { 1128 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY)); 1129 } 1130 catch (final Throwable tryAgain) 1131 { 1132 try 1133 { 1134 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY)); 1135 } 1136 catch (final Throwable ignore) 1137 { 1138 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property 1139 } 1140 } 1141 toString.append("]"); 1142 return toString.toString(); 1143 } 1144}