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 org.andromda.core.common.Introspector; 010import org.andromda.core.metafacade.MetafacadeBase; 011import org.andromda.core.metafacade.MetafacadeFactory; 012import org.andromda.core.metafacade.ModelValidationMessage; 013import org.andromda.metafacades.uml.AssociationEndFacade; 014import org.andromda.metafacades.uml.AttributeFacade; 015import org.andromda.metafacades.uml.ClassifierFacade; 016import org.andromda.metafacades.uml.ConstraintFacade; 017import org.andromda.metafacades.uml.DependencyFacade; 018import org.andromda.metafacades.uml.GeneralizableElementFacade; 019import org.andromda.metafacades.uml.GeneralizationFacade; 020import org.andromda.metafacades.uml.ModelElementFacade; 021import org.andromda.metafacades.uml.ModelFacade; 022import org.andromda.metafacades.uml.OperationFacade; 023import org.andromda.metafacades.uml.PackageFacade; 024import org.andromda.metafacades.uml.StateMachineFacade; 025import org.andromda.metafacades.uml.StereotypeFacade; 026import org.andromda.metafacades.uml.TaggedValueFacade; 027import org.andromda.metafacades.uml.TemplateParameterFacade; 028import org.andromda.metafacades.uml.TypeMappings; 029import org.apache.log4j.Logger; 030 031/** 032 * Represents the portlet preferences for a given use case (assuming the JSF application being 033 * generated is a portlet). 034 * MetafacadeLogic for JSFPortletPreferences 035 * 036 * @see JSFPortletPreferences 037 */ 038public abstract class JSFPortletPreferencesLogic 039 extends MetafacadeBase 040 implements JSFPortletPreferences 041{ 042 /** 043 * The underlying UML object 044 * @see Object 045 */ 046 protected Object metaObject; 047 048 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 049 * @param metaObjectIn 050 * @param context 051 */ 052 protected JSFPortletPreferencesLogic(Object metaObjectIn, String context) 053 { 054 super(metaObjectIn, getContext(context)); 055 this.superClassifierFacade = 056 (ClassifierFacade) 057 MetafacadeFactory.getInstance().createFacadeImpl( 058 "org.andromda.metafacades.uml.ClassifierFacade", 059 metaObjectIn, 060 getContext(context)); 061 this.metaObject = metaObjectIn; 062 } 063 064 /** 065 * The logger instance. 066 */ 067 private static final Logger logger = Logger.getLogger(JSFPortletPreferencesLogic.class); 068 069 /** 070 * Gets the context for this metafacade logic instance. 071 * @param context String. Set to JSFPortletPreferences if null 072 * @return context String 073 */ 074 private static String getContext(String context) 075 { 076 if (context == null) 077 { 078 context = "org.andromda.cartridges.jsf.metafacades.JSFPortletPreferences"; 079 } 080 return context; 081 } 082 083 private ClassifierFacade superClassifierFacade; 084 private boolean superClassifierFacadeInitialized = false; 085 086 /** 087 * Gets the ClassifierFacade parent instance. 088 * @return this.superClassifierFacade ClassifierFacade 089 */ 090 private ClassifierFacade getSuperClassifierFacade() 091 { 092 if (!this.superClassifierFacadeInitialized) 093 { 094 ((MetafacadeBase)this.superClassifierFacade).setMetafacadeContext(this.getMetafacadeContext()); 095 this.superClassifierFacadeInitialized = true; 096 } 097 return this.superClassifierFacade; 098 } 099 100 /** Reset context only for non-root metafacades 101 * @param context 102 * @see MetafacadeBase#resetMetafacadeContext(String context) 103 */ 104 @Override 105 public void resetMetafacadeContext(String context) 106 { 107 if (!this.contextRoot) // reset context only for non-root metafacades 108 { 109 context = getContext(context); // to have same value as in original constructor call 110 setMetafacadeContext (context); 111 if (this.superClassifierFacadeInitialized) 112 { 113 ((MetafacadeBase)this.superClassifierFacade).resetMetafacadeContext(context); 114 } 115 } 116 } 117 118 /** 119 * @return boolean true always 120 * @see JSFPortletPreferences 121 */ 122 public boolean isJSFPortletPreferencesMetaType() 123 { 124 return true; 125 } 126 127 // ------------- associations ------------------ 128 129 private JSFUseCase __getUseCase1r; 130 private boolean __getUseCase1rSet = false; 131 132 /** 133 * Any portlet preferences associated to this use case. 134 * @return (JSFUseCase)handleGetUseCase() 135 */ 136 public final JSFUseCase getUseCase() 137 { 138 JSFUseCase getUseCase1r = this.__getUseCase1r; 139 if (!this.__getUseCase1rSet) 140 { 141 // preferences has no pre constraints 142 Object result = handleGetUseCase(); 143 MetafacadeBase shieldedResult = this.shieldedElement(result); 144 try 145 { 146 getUseCase1r = (JSFUseCase)shieldedResult; 147 } 148 catch (ClassCastException ex) 149 { 150 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 151 JSFPortletPreferencesLogic.logger.warn("incorrect metafacade cast for JSFPortletPreferencesLogic.getUseCase JSFUseCase " + result + ": " + shieldedResult); 152 } 153 // preferences has no post constraints 154 this.__getUseCase1r = getUseCase1r; 155 if (isMetafacadePropertyCachingEnabled()) 156 { 157 this.__getUseCase1rSet = true; 158 } 159 } 160 return getUseCase1r; 161 } 162 163 /** 164 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type 165 * @return Object 166 */ 167 protected abstract Object handleGetUseCase(); 168 169 /** 170 * @return true 171 * @see ClassifierFacade 172 */ 173 public boolean isClassifierFacadeMetaType() 174 { 175 return true; 176 } 177 178 /** 179 * @return true 180 * @see GeneralizableElementFacade 181 */ 182 public boolean isGeneralizableElementFacadeMetaType() 183 { 184 return true; 185 } 186 187 /** 188 * @return true 189 * @see ModelElementFacade 190 */ 191 public boolean isModelElementFacadeMetaType() 192 { 193 return true; 194 } 195 196 // ----------- delegates to ClassifierFacade ------------ 197 /** 198 * Return the attribute which name matches the parameter 199 * @see ClassifierFacade#findAttribute(String name) 200 */ 201 public AttributeFacade findAttribute(String name) 202 { 203 return this.getSuperClassifierFacade().findAttribute(name); 204 } 205 206 /** 207 * Those abstraction dependencies for which this classifier is the client. 208 * @see ClassifierFacade#getAbstractions() 209 */ 210 public Collection<ClassifierFacade> getAbstractions() 211 { 212 return this.getSuperClassifierFacade().getAbstractions(); 213 } 214 215 /** 216 * Lists all classes associated to this one and any ancestor classes (through generalization). 217 * There will be no duplicates. The order of the elements is predictable. 218 * @see ClassifierFacade#getAllAssociatedClasses() 219 */ 220 public Collection<ClassifierFacade> getAllAssociatedClasses() 221 { 222 return this.getSuperClassifierFacade().getAllAssociatedClasses(); 223 } 224 225 /** 226 * A collection containing all 'properties' of the classifier and its ancestors. Properties are 227 * any attributes and navigable connecting association ends. 228 * @see ClassifierFacade#getAllProperties() 229 */ 230 public Collection<ModelElementFacade> getAllProperties() 231 { 232 return this.getSuperClassifierFacade().getAllProperties(); 233 } 234 235 /** 236 * A collection containing all required and/or read-only 'properties' of the classifier and its 237 * ancestors. Properties are any attributes and navigable connecting association ends. 238 * @see ClassifierFacade#getAllRequiredConstructorParameters() 239 */ 240 public Collection<ModelElementFacade> getAllRequiredConstructorParameters() 241 { 242 return this.getSuperClassifierFacade().getAllRequiredConstructorParameters(); 243 } 244 245 /** 246 * Gets the array type for this classifier. If this classifier already represents an array, it 247 * just returns itself. 248 * @see ClassifierFacade#getArray() 249 */ 250 public ClassifierFacade getArray() 251 { 252 return this.getSuperClassifierFacade().getArray(); 253 } 254 255 /** 256 * The name of the classifier as an array. 257 * @see ClassifierFacade#getArrayName() 258 */ 259 public String getArrayName() 260 { 261 return this.getSuperClassifierFacade().getArrayName(); 262 } 263 264 /** 265 * Lists the classes associated to this one, there is no repitition of classes. The order of the 266 * elements is predictable. 267 * @see ClassifierFacade#getAssociatedClasses() 268 */ 269 public Collection<ClassifierFacade> getAssociatedClasses() 270 { 271 return this.getSuperClassifierFacade().getAssociatedClasses(); 272 } 273 274 /** 275 * Gets the association ends belonging to a classifier. 276 * @see ClassifierFacade#getAssociationEnds() 277 */ 278 public List<AssociationEndFacade> getAssociationEnds() 279 { 280 return this.getSuperClassifierFacade().getAssociationEnds(); 281 } 282 283 /** 284 * Gets the attributes that belong to the classifier. 285 * @see ClassifierFacade#getAttributes() 286 */ 287 public List<AttributeFacade> getAttributes() 288 { 289 return this.getSuperClassifierFacade().getAttributes(); 290 } 291 292 /** 293 * Gets all attributes for the classifier and if 'follow' is true goes up the inheritance 294 * hierarchy and gets the attributes from the super classes as well. 295 * @see ClassifierFacade#getAttributes(boolean follow) 296 */ 297 public List<AttributeFacade> getAttributes(boolean follow) 298 { 299 return this.getSuperClassifierFacade().getAttributes(follow); 300 } 301 302 /** 303 * The fully qualified name of the classifier as an array. 304 * @see ClassifierFacade#getFullyQualifiedArrayName() 305 */ 306 public String getFullyQualifiedArrayName() 307 { 308 return this.getSuperClassifierFacade().getFullyQualifiedArrayName(); 309 } 310 311 /** 312 * Returns all those operations that could be implemented at this classifier's level. This means 313 * the operations owned by this classifier as well as any realized interface's operations 314 * (recursively) in case this classifier itself is not already an interface, or generalized when 315 * this classifier is an interface. 316 * @see ClassifierFacade#getImplementationOperations() 317 */ 318 public Collection<OperationFacade> getImplementationOperations() 319 { 320 return this.getSuperClassifierFacade().getImplementationOperations(); 321 } 322 323 /** 324 * A comma separated list of the fully qualified names of all implemented interfaces. 325 * @see ClassifierFacade#getImplementedInterfaceList() 326 */ 327 public String getImplementedInterfaceList() 328 { 329 return this.getSuperClassifierFacade().getImplementedInterfaceList(); 330 } 331 332 /** 333 * Those attributes that are scoped to an instance of this class. 334 * @see ClassifierFacade#getInstanceAttributes() 335 */ 336 public Collection<AttributeFacade> getInstanceAttributes() 337 { 338 return this.getSuperClassifierFacade().getInstanceAttributes(); 339 } 340 341 /** 342 * Those operations that are scoped to an instance of this class. 343 * @see ClassifierFacade#getInstanceOperations() 344 */ 345 public List<OperationFacade> getInstanceOperations() 346 { 347 return this.getSuperClassifierFacade().getInstanceOperations(); 348 } 349 350 /** 351 * Those interfaces that are abstractions of this classifier, this basically means this 352 * classifier realizes them. 353 * @see ClassifierFacade#getInterfaceAbstractions() 354 */ 355 public Collection<ClassifierFacade> getInterfaceAbstractions() 356 { 357 return this.getSuperClassifierFacade().getInterfaceAbstractions(); 358 } 359 360 /** 361 * A String representing a new Constructor declaration for this classifier type to be used in a 362 * Java environment. 363 * @see ClassifierFacade#getJavaNewString() 364 */ 365 public String getJavaNewString() 366 { 367 return this.getSuperClassifierFacade().getJavaNewString(); 368 } 369 370 /** 371 * A String representing the null-value for this classifier type to be used in a Java 372 * environment. 373 * @see ClassifierFacade#getJavaNullString() 374 */ 375 public String getJavaNullString() 376 { 377 return this.getSuperClassifierFacade().getJavaNullString(); 378 } 379 380 /** 381 * The other ends of this classifier's association ends which are navigable. 382 * @see ClassifierFacade#getNavigableConnectingEnds() 383 */ 384 public Collection<AssociationEndFacade> getNavigableConnectingEnds() 385 { 386 return this.getSuperClassifierFacade().getNavigableConnectingEnds(); 387 } 388 389 /** 390 * Get the other ends of this classifier's association ends which are navigable and if 'follow' 391 * is true goes up the inheritance hierarchy and gets the super association ends as well. 392 * @see ClassifierFacade#getNavigableConnectingEnds(boolean follow) 393 */ 394 public List<AssociationEndFacade> getNavigableConnectingEnds(boolean follow) 395 { 396 return this.getSuperClassifierFacade().getNavigableConnectingEnds(follow); 397 } 398 399 /** 400 * Assuming that the classifier is an array, this will return the non array type of the 401 * classifier from 402 * the model. If the classifier is NOT an array, it will just return itself. 403 * @see ClassifierFacade#getNonArray() 404 */ 405 public ClassifierFacade getNonArray() 406 { 407 return this.getSuperClassifierFacade().getNonArray(); 408 } 409 410 /** 411 * The attributes from this classifier in the form of an operation call (this example would be 412 * in Java): '(String attributeOne, String attributeTwo). If there were no attributes on the 413 * classifier, the result would be an empty '()'. 414 * @see ClassifierFacade#getOperationCallFromAttributes() 415 */ 416 public String getOperationCallFromAttributes() 417 { 418 return this.getSuperClassifierFacade().getOperationCallFromAttributes(); 419 } 420 421 /** 422 * The operations owned by this classifier. 423 * @see ClassifierFacade#getOperations() 424 */ 425 public List<OperationFacade> getOperations() 426 { 427 return this.getSuperClassifierFacade().getOperations(); 428 } 429 430 /** 431 * A collection containing all 'properties' of the classifier. Properties are any attributes 432 * and navigable connecting association ends. 433 * @see ClassifierFacade#getProperties() 434 */ 435 public List<ModelElementFacade> getProperties() 436 { 437 return this.getSuperClassifierFacade().getProperties(); 438 } 439 440 /** 441 * Gets all properties (attributes and navigable association ends) for the classifier and if 442 * 'follow' is true goes up the inheritance hierarchy and gets the properties from the super 443 * classes as well. 444 * @see ClassifierFacade#getProperties(boolean follow) 445 */ 446 public List getProperties(boolean follow) 447 { 448 return this.getSuperClassifierFacade().getProperties(follow); 449 } 450 451 /** 452 * A collection containing all required and/or read-only 'properties' of the classifier. 453 * Properties are any attributes and navigable connecting association ends. 454 * @see ClassifierFacade#getRequiredConstructorParameters() 455 */ 456 public Collection<ModelElementFacade> getRequiredConstructorParameters() 457 { 458 return this.getSuperClassifierFacade().getRequiredConstructorParameters(); 459 } 460 461 /** 462 * Returns the serial version UID of the underlying model element. 463 * @see ClassifierFacade#getSerialVersionUID() 464 */ 465 public long getSerialVersionUID() 466 { 467 return this.getSuperClassifierFacade().getSerialVersionUID(); 468 } 469 470 /** 471 * Those attributes that are scoped to the definition of this class. 472 * @see ClassifierFacade#getStaticAttributes() 473 */ 474 public Collection<AttributeFacade> getStaticAttributes() 475 { 476 return this.getSuperClassifierFacade().getStaticAttributes(); 477 } 478 479 /** 480 * Those operations that are scoped to the definition of this class. 481 * @see ClassifierFacade#getStaticOperations() 482 */ 483 public List<OperationFacade> getStaticOperations() 484 { 485 return this.getSuperClassifierFacade().getStaticOperations(); 486 } 487 488 /** 489 * This class' superclass, returns the generalization if it is a ClassifierFacade, null 490 * otherwise. 491 * @see ClassifierFacade#getSuperClass() 492 */ 493 public ClassifierFacade getSuperClass() 494 { 495 return this.getSuperClassifierFacade().getSuperClass(); 496 } 497 498 /** 499 * The wrapper name for this classifier if a mapped type has a defined wrapper class (ie. 'long' 500 * maps to 'Long'). If the classifier doesn't have a wrapper defined for it, this method will 501 * return a null. Note that wrapper mappings must be defined for the namespace by defining the 502 * 'wrapperMappingsUri', this property must point to the location of the mappings file which 503 * maps the primitives to wrapper types. 504 * @see ClassifierFacade#getWrapperName() 505 */ 506 public String getWrapperName() 507 { 508 return this.getSuperClassifierFacade().getWrapperName(); 509 } 510 511 /** 512 * Indicates if this classifier is 'abstract'. 513 * @see ClassifierFacade#isAbstract() 514 */ 515 public boolean isAbstract() 516 { 517 return this.getSuperClassifierFacade().isAbstract(); 518 } 519 520 /** 521 * True if this classifier represents an array type. False otherwise. 522 * @see ClassifierFacade#isArrayType() 523 */ 524 public boolean isArrayType() 525 { 526 return this.getSuperClassifierFacade().isArrayType(); 527 } 528 529 /** 530 * True if the ClassifierFacade is an AssociationClass. 531 * @see ClassifierFacade#isAssociationClass() 532 */ 533 public boolean isAssociationClass() 534 { 535 return this.getSuperClassifierFacade().isAssociationClass(); 536 } 537 538 /** 539 * Returns true if this type represents a Blob type. 540 * @see ClassifierFacade#isBlobType() 541 */ 542 public boolean isBlobType() 543 { 544 return this.getSuperClassifierFacade().isBlobType(); 545 } 546 547 /** 548 * Indicates if this type represents a boolean type or not. 549 * @see ClassifierFacade#isBooleanType() 550 */ 551 public boolean isBooleanType() 552 { 553 return this.getSuperClassifierFacade().isBooleanType(); 554 } 555 556 /** 557 * Indicates if this type represents a char, Character, or java.lang.Character type or not. 558 * @see ClassifierFacade#isCharacterType() 559 */ 560 public boolean isCharacterType() 561 { 562 return this.getSuperClassifierFacade().isCharacterType(); 563 } 564 565 /** 566 * Returns true if this type represents a Clob type. 567 * @see ClassifierFacade#isClobType() 568 */ 569 public boolean isClobType() 570 { 571 return this.getSuperClassifierFacade().isClobType(); 572 } 573 574 /** 575 * True if this classifier represents a collection type. False otherwise. 576 * @see ClassifierFacade#isCollectionType() 577 */ 578 public boolean isCollectionType() 579 { 580 return this.getSuperClassifierFacade().isCollectionType(); 581 } 582 583 /** 584 * True/false depending on whether or not this classifier represents a datatype. A data type is 585 * a type whose instances are identified only by their value. A data type may contain attributes 586 * to support the modeling of structured data types. 587 * @see ClassifierFacade#isDataType() 588 */ 589 public boolean isDataType() 590 { 591 return this.getSuperClassifierFacade().isDataType(); 592 } 593 594 /** 595 * True when this classifier is a date type. 596 * @see ClassifierFacade#isDateType() 597 */ 598 public boolean isDateType() 599 { 600 return this.getSuperClassifierFacade().isDateType(); 601 } 602 603 /** 604 * Indicates if this type represents a Double type or not. 605 * @see ClassifierFacade#isDoubleType() 606 */ 607 public boolean isDoubleType() 608 { 609 return this.getSuperClassifierFacade().isDoubleType(); 610 } 611 612 /** 613 * Indicates whether or not this classifier represents an "EmbeddedValue'. 614 * @see ClassifierFacade#isEmbeddedValue() 615 */ 616 public boolean isEmbeddedValue() 617 { 618 return this.getSuperClassifierFacade().isEmbeddedValue(); 619 } 620 621 /** 622 * True if this classifier is in fact marked as an enumeration. 623 * @see ClassifierFacade#isEnumeration() 624 */ 625 public boolean isEnumeration() 626 { 627 return this.getSuperClassifierFacade().isEnumeration(); 628 } 629 630 /** 631 * Returns true if this type represents a 'file' type. 632 * @see ClassifierFacade#isFileType() 633 */ 634 public boolean isFileType() 635 { 636 return this.getSuperClassifierFacade().isFileType(); 637 } 638 639 /** 640 * Indicates if this type represents a Float type or not. 641 * @see ClassifierFacade#isFloatType() 642 */ 643 public boolean isFloatType() 644 { 645 return this.getSuperClassifierFacade().isFloatType(); 646 } 647 648 /** 649 * Indicates if this type represents an int or Integer or java.lang.Integer type or not. 650 * @see ClassifierFacade#isIntegerType() 651 */ 652 public boolean isIntegerType() 653 { 654 return this.getSuperClassifierFacade().isIntegerType(); 655 } 656 657 /** 658 * True/false depending on whether or not this Classifier represents an interface. 659 * @see ClassifierFacade#isInterface() 660 */ 661 public boolean isInterface() 662 { 663 return this.getSuperClassifierFacade().isInterface(); 664 } 665 666 /** 667 * True if this classifier cannot be extended and represent a leaf in the inheritance tree. 668 * @see ClassifierFacade#isLeaf() 669 */ 670 public boolean isLeaf() 671 { 672 return this.getSuperClassifierFacade().isLeaf(); 673 } 674 675 /** 676 * True if this classifier represents a list type. False otherwise. 677 * @see ClassifierFacade#isListType() 678 */ 679 public boolean isListType() 680 { 681 return this.getSuperClassifierFacade().isListType(); 682 } 683 684 /** 685 * Indicates if this type represents a Long type or not. 686 * @see ClassifierFacade#isLongType() 687 */ 688 public boolean isLongType() 689 { 690 return this.getSuperClassifierFacade().isLongType(); 691 } 692 693 /** 694 * Indicates whether or not this classifier represents a Map type. 695 * @see ClassifierFacade#isMapType() 696 */ 697 public boolean isMapType() 698 { 699 return this.getSuperClassifierFacade().isMapType(); 700 } 701 702 /** 703 * Indicates whether or not this classifier represents a primitive type. 704 * @see ClassifierFacade#isPrimitive() 705 */ 706 public boolean isPrimitive() 707 { 708 return this.getSuperClassifierFacade().isPrimitive(); 709 } 710 711 /** 712 * True if this classifier represents a set type. False otherwise. 713 * @see ClassifierFacade#isSetType() 714 */ 715 public boolean isSetType() 716 { 717 return this.getSuperClassifierFacade().isSetType(); 718 } 719 720 /** 721 * Indicates whether or not this classifier represents a string type. 722 * @see ClassifierFacade#isStringType() 723 */ 724 public boolean isStringType() 725 { 726 return this.getSuperClassifierFacade().isStringType(); 727 } 728 729 /** 730 * Indicates whether or not this classifier represents a time type. 731 * @see ClassifierFacade#isTimeType() 732 */ 733 public boolean isTimeType() 734 { 735 return this.getSuperClassifierFacade().isTimeType(); 736 } 737 738 /** 739 * Returns true if this type is a wrapped primitive type. 740 * @see ClassifierFacade#isWrappedPrimitive() 741 */ 742 public boolean isWrappedPrimitive() 743 { 744 return this.getSuperClassifierFacade().isWrappedPrimitive(); 745 } 746 747 /** 748 * Finds the tagged value optional searching the entire inheritance hierarchy if 'follow' is set 749 * to true. 750 * @see GeneralizableElementFacade#findTaggedValue(String tagName, boolean follow) 751 */ 752 public Object findTaggedValue(String tagName, boolean follow) 753 { 754 return this.getSuperClassifierFacade().findTaggedValue(tagName, follow); 755 } 756 757 /** 758 * All generalizations for this generalizable element, goes up the inheritance tree. 759 * @see GeneralizableElementFacade#getAllGeneralizations() 760 */ 761 public Collection<GeneralizableElementFacade> getAllGeneralizations() 762 { 763 return this.getSuperClassifierFacade().getAllGeneralizations(); 764 } 765 766 /** 767 * All specializations (travels down the inheritance hierarchy). 768 * @see GeneralizableElementFacade#getAllSpecializations() 769 */ 770 public Collection<GeneralizableElementFacade> getAllSpecializations() 771 { 772 return this.getSuperClassifierFacade().getAllSpecializations(); 773 } 774 775 /** 776 * Gets the direct generalization for this generalizable element. 777 * @see GeneralizableElementFacade#getGeneralization() 778 */ 779 public GeneralizableElementFacade getGeneralization() 780 { 781 return this.getSuperClassifierFacade().getGeneralization(); 782 } 783 784 /** 785 * Gets the actual links that this generalization element is part of (it plays either the 786 * specialization or generalization). 787 * @see GeneralizableElementFacade#getGeneralizationLinks() 788 */ 789 public Collection<GeneralizationFacade> getGeneralizationLinks() 790 { 791 return this.getSuperClassifierFacade().getGeneralizationLinks(); 792 } 793 794 /** 795 * A comma separated list of the fully qualified names of all generalizations. 796 * @see GeneralizableElementFacade#getGeneralizationList() 797 */ 798 public String getGeneralizationList() 799 { 800 return this.getSuperClassifierFacade().getGeneralizationList(); 801 } 802 803 /** 804 * The element found when you recursively follow the generalization path up to the root. If an 805 * element has no generalization itself will be considered the root. 806 * @see GeneralizableElementFacade#getGeneralizationRoot() 807 */ 808 public GeneralizableElementFacade getGeneralizationRoot() 809 { 810 return this.getSuperClassifierFacade().getGeneralizationRoot(); 811 } 812 813 /** 814 * Return all generalizations (ancestors) from this generalizable element. 815 * @see GeneralizableElementFacade#getGeneralizations() 816 */ 817 public Collection<GeneralizableElementFacade> getGeneralizations() 818 { 819 return this.getSuperClassifierFacade().getGeneralizations(); 820 } 821 822 /** 823 * Gets the direct specializations (i.e. sub elements) for this generalizatble element. 824 * @see GeneralizableElementFacade#getSpecializations() 825 */ 826 public Collection<GeneralizableElementFacade> getSpecializations() 827 { 828 return this.getSuperClassifierFacade().getSpecializations(); 829 } 830 831 /** 832 * Copies all tagged values from the given ModelElementFacade to this model element facade. 833 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element) 834 */ 835 public void copyTaggedValues(ModelElementFacade element) 836 { 837 this.getSuperClassifierFacade().copyTaggedValues(element); 838 } 839 840 /** 841 * Finds the tagged value with the specified 'tagName'. In case there are more values the first 842 * one found will be returned. 843 * @see ModelElementFacade#findTaggedValue(String tagName) 844 */ 845 public Object findTaggedValue(String tagName) 846 { 847 return this.getSuperClassifierFacade().findTaggedValue(tagName); 848 } 849 850 /** 851 * Returns all the values for the tagged value with the specified name. The returned collection 852 * will contains only String instances, or will be empty. Never null. 853 * @see ModelElementFacade#findTaggedValues(String tagName) 854 */ 855 public Collection<Object> findTaggedValues(String tagName) 856 { 857 return this.getSuperClassifierFacade().findTaggedValues(tagName); 858 } 859 860 /** 861 * Returns the fully qualified name of the model element. The fully qualified name includes 862 * complete package qualified name of the underlying model element. The templates parameter will 863 * be replaced by the correct one given the binding relation of the parameter to this element. 864 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement) 865 */ 866 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement) 867 { 868 return this.getSuperClassifierFacade().getBindedFullyQualifiedName(bindedElement); 869 } 870 871 /** 872 * Gets all constraints belonging to the model element. 873 * @see ModelElementFacade#getConstraints() 874 */ 875 public Collection<ConstraintFacade> getConstraints() 876 { 877 return this.getSuperClassifierFacade().getConstraints(); 878 } 879 880 /** 881 * Returns the constraints of the argument kind that have been placed onto this model. Typical 882 * kinds are "inv", "pre" and "post". Other kinds are possible. 883 * @see ModelElementFacade#getConstraints(String kind) 884 */ 885 public Collection<ConstraintFacade> getConstraints(String kind) 886 { 887 return this.getSuperClassifierFacade().getConstraints(kind); 888 } 889 890 /** 891 * Gets the documentation for the model element, The indent argument is prefixed to each line. 892 * By default this method wraps lines after 64 characters. 893 * This method is equivalent to <code>getDocumentation(indent, 64)</code>. 894 * @see ModelElementFacade#getDocumentation(String indent) 895 */ 896 public String getDocumentation(String indent) 897 { 898 return this.getSuperClassifierFacade().getDocumentation(indent); 899 } 900 901 /** 902 * This method returns the documentation for this model element, with the lines wrapped after 903 * the specified number of characters, values of less than 1 will indicate no line wrapping is 904 * required. By default paragraphs are returned as HTML. 905 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>. 906 * @see ModelElementFacade#getDocumentation(String indent, int lineLength) 907 */ 908 public String getDocumentation(String indent, int lineLength) 909 { 910 return this.getSuperClassifierFacade().getDocumentation(indent, lineLength); 911 } 912 913 /** 914 * This method returns the documentation for this model element, with the lines wrapped after 915 * the specified number of characters, values of less than 1 will indicate no line wrapping is 916 * required. HTML style determines if HTML Escaping is applied. 917 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle) 918 */ 919 public String getDocumentation(String indent, int lineLength, boolean htmlStyle) 920 { 921 return this.getSuperClassifierFacade().getDocumentation(indent, lineLength, htmlStyle); 922 } 923 924 /** 925 * The fully qualified name of this model element. 926 * @see ModelElementFacade#getFullyQualifiedName() 927 */ 928 public String getFullyQualifiedName() 929 { 930 return this.getSuperClassifierFacade().getFullyQualifiedName(); 931 } 932 933 /** 934 * Returns the fully qualified name of the model element. The fully qualified name includes 935 * complete package qualified name of the underlying model element. If modelName is true, then 936 * the original name of the model element (the name contained within the model) will be the name 937 * returned, otherwise a name from a language mapping will be returned. 938 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName) 939 */ 940 public String getFullyQualifiedName(boolean modelName) 941 { 942 return this.getSuperClassifierFacade().getFullyQualifiedName(modelName); 943 } 944 945 /** 946 * Returns the fully qualified name as a path, the returned value always starts with out a slash 947 * '/'. 948 * @see ModelElementFacade#getFullyQualifiedNamePath() 949 */ 950 public String getFullyQualifiedNamePath() 951 { 952 return this.getSuperClassifierFacade().getFullyQualifiedNamePath(); 953 } 954 955 /** 956 * Gets the unique identifier of the underlying model element. 957 * @see ModelElementFacade#getId() 958 */ 959 public String getId() 960 { 961 return this.getSuperClassifierFacade().getId(); 962 } 963 964 /** 965 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which 966 * are not represented by other properties, i.e. native, transient, volatile, synchronized, 967 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings: 968 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require 969 * JDK5 compiler level. 970 * @see ModelElementFacade#getKeywords() 971 */ 972 public Collection<String> getKeywords() 973 { 974 return this.getSuperClassifierFacade().getKeywords(); 975 } 976 977 /** 978 * UML2: Retrieves a localized label for this named element. 979 * @see ModelElementFacade#getLabel() 980 */ 981 public String getLabel() 982 { 983 return this.getSuperClassifierFacade().getLabel(); 984 } 985 986 /** 987 * The language mappings that have been set for this model element. 988 * @see ModelElementFacade#getLanguageMappings() 989 */ 990 public TypeMappings getLanguageMappings() 991 { 992 return this.getSuperClassifierFacade().getLanguageMappings(); 993 } 994 995 /** 996 * Return the model containing this model element (multiple models may be loaded and processed 997 * at the same time). 998 * @see ModelElementFacade#getModel() 999 */ 1000 public ModelFacade getModel() 1001 { 1002 return this.getSuperClassifierFacade().getModel(); 1003 } 1004 1005 /** 1006 * The name of the model element. 1007 * @see ModelElementFacade#getName() 1008 */ 1009 public String getName() 1010 { 1011 return this.getSuperClassifierFacade().getName(); 1012 } 1013 1014 /** 1015 * Gets the package to which this model element belongs. 1016 * @see ModelElementFacade#getPackage() 1017 */ 1018 public ModelElementFacade getPackage() 1019 { 1020 return this.getSuperClassifierFacade().getPackage(); 1021 } 1022 1023 /** 1024 * The name of this model element's package. 1025 * @see ModelElementFacade#getPackageName() 1026 */ 1027 public String getPackageName() 1028 { 1029 return this.getSuperClassifierFacade().getPackageName(); 1030 } 1031 1032 /** 1033 * Gets the package name (optionally providing the ability to retrieve the model name and not 1034 * the mapped name). 1035 * @see ModelElementFacade#getPackageName(boolean modelName) 1036 */ 1037 public String getPackageName(boolean modelName) 1038 { 1039 return this.getSuperClassifierFacade().getPackageName(modelName); 1040 } 1041 1042 /** 1043 * Returns the package as a path, the returned value always starts with out a slash '/'. 1044 * @see ModelElementFacade#getPackagePath() 1045 */ 1046 public String getPackagePath() 1047 { 1048 return this.getSuperClassifierFacade().getPackagePath(); 1049 } 1050 1051 /** 1052 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the 1053 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from 1054 * the names of the containing namespaces starting at the root of the hierarchy and ending with 1055 * the name of the NamedElement itself. 1056 * @see ModelElementFacade#getQualifiedName() 1057 */ 1058 public String getQualifiedName() 1059 { 1060 return this.getSuperClassifierFacade().getQualifiedName(); 1061 } 1062 1063 /** 1064 * Gets the root package for the model element. 1065 * @see ModelElementFacade#getRootPackage() 1066 */ 1067 public PackageFacade getRootPackage() 1068 { 1069 return this.getSuperClassifierFacade().getRootPackage(); 1070 } 1071 1072 /** 1073 * Gets the dependencies for which this model element is the source. 1074 * @see ModelElementFacade#getSourceDependencies() 1075 */ 1076 public Collection<DependencyFacade> getSourceDependencies() 1077 { 1078 return this.getSuperClassifierFacade().getSourceDependencies(); 1079 } 1080 1081 /** 1082 * If this model element is the context of an activity graph, this represents that activity 1083 * graph. 1084 * @see ModelElementFacade#getStateMachineContext() 1085 */ 1086 public StateMachineFacade getStateMachineContext() 1087 { 1088 return this.getSuperClassifierFacade().getStateMachineContext(); 1089 } 1090 1091 /** 1092 * The collection of ALL stereotype names for this model element. 1093 * @see ModelElementFacade#getStereotypeNames() 1094 */ 1095 public Collection<String> getStereotypeNames() 1096 { 1097 return this.getSuperClassifierFacade().getStereotypeNames(); 1098 } 1099 1100 /** 1101 * Gets all stereotypes for this model element. 1102 * @see ModelElementFacade#getStereotypes() 1103 */ 1104 public Collection<StereotypeFacade> getStereotypes() 1105 { 1106 return this.getSuperClassifierFacade().getStereotypes(); 1107 } 1108 1109 /** 1110 * Return the TaggedValues associated with this model element, under all stereotypes. 1111 * @see ModelElementFacade#getTaggedValues() 1112 */ 1113 public Collection<TaggedValueFacade> getTaggedValues() 1114 { 1115 return this.getSuperClassifierFacade().getTaggedValues(); 1116 } 1117 1118 /** 1119 * Gets the dependencies for which this model element is the target. 1120 * @see ModelElementFacade#getTargetDependencies() 1121 */ 1122 public Collection<DependencyFacade> getTargetDependencies() 1123 { 1124 return this.getSuperClassifierFacade().getTargetDependencies(); 1125 } 1126 1127 /** 1128 * Get the template parameter for this model element having the parameterName 1129 * @see ModelElementFacade#getTemplateParameter(String parameterName) 1130 */ 1131 public Object getTemplateParameter(String parameterName) 1132 { 1133 return this.getSuperClassifierFacade().getTemplateParameter(parameterName); 1134 } 1135 1136 /** 1137 * Get the template parameters for this model element 1138 * @see ModelElementFacade#getTemplateParameters() 1139 */ 1140 public Collection<TemplateParameterFacade> getTemplateParameters() 1141 { 1142 return this.getSuperClassifierFacade().getTemplateParameters(); 1143 } 1144 1145 /** 1146 * The visibility (i.e. public, private, protected or package) of the model element, will 1147 * attempt a lookup for these values in the language mappings (if any). 1148 * @see ModelElementFacade#getVisibility() 1149 */ 1150 public String getVisibility() 1151 { 1152 return this.getSuperClassifierFacade().getVisibility(); 1153 } 1154 1155 /** 1156 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance 1157 * is taken into account when searching for the stereotype), false otherwise. 1158 * @see ModelElementFacade#hasExactStereotype(String stereotypeName) 1159 */ 1160 public boolean hasExactStereotype(String stereotypeName) 1161 { 1162 return this.getSuperClassifierFacade().hasExactStereotype(stereotypeName); 1163 } 1164 1165 /** 1166 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, 1167 * pipe, semicolon, or << >> 1168 * @see ModelElementFacade#hasKeyword(String keywordName) 1169 */ 1170 public boolean hasKeyword(String keywordName) 1171 { 1172 return this.getSuperClassifierFacade().hasKeyword(keywordName); 1173 } 1174 1175 /** 1176 * Returns true if the model element has the specified stereotype. If the stereotype itself 1177 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if 1178 * one of the stereotype's ancestors has a matching name this method will return true, false 1179 * otherwise. 1180 * For example, if we have a certain stereotype called <<exception>> and a model element has a 1181 * stereotype called <<applicationException>> which extends <<exception>>, when calling this 1182 * method with 'stereotypeName' defined as 'exception' the method would return true since 1183 * <<applicationException>> inherits from <<exception>>. If you want to check if the model 1184 * element has the exact stereotype, then use the method 'hasExactStereotype' instead. 1185 * @see ModelElementFacade#hasStereotype(String stereotypeName) 1186 */ 1187 public boolean hasStereotype(String stereotypeName) 1188 { 1189 return this.getSuperClassifierFacade().hasStereotype(stereotypeName); 1190 } 1191 1192 /** 1193 * True if there are target dependencies from this element that are instances of BindingFacade. 1194 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies. 1195 * @see ModelElementFacade#isBindingDependenciesPresent() 1196 */ 1197 public boolean isBindingDependenciesPresent() 1198 { 1199 return this.getSuperClassifierFacade().isBindingDependenciesPresent(); 1200 } 1201 1202 /** 1203 * Indicates if any constraints are present on this model element. 1204 * @see ModelElementFacade#isConstraintsPresent() 1205 */ 1206 public boolean isConstraintsPresent() 1207 { 1208 return this.getSuperClassifierFacade().isConstraintsPresent(); 1209 } 1210 1211 /** 1212 * Indicates if any documentation is present on this model element. 1213 * @see ModelElementFacade#isDocumentationPresent() 1214 */ 1215 public boolean isDocumentationPresent() 1216 { 1217 return this.getSuperClassifierFacade().isDocumentationPresent(); 1218 } 1219 1220 /** 1221 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript. 1222 * @see ModelElementFacade#isReservedWord() 1223 */ 1224 public boolean isReservedWord() 1225 { 1226 return this.getSuperClassifierFacade().isReservedWord(); 1227 } 1228 1229 /** 1230 * True is there are template parameters on this model element. For UML2, applies to Class, 1231 * Operation, Property, and Parameter. 1232 * @see ModelElementFacade#isTemplateParametersPresent() 1233 */ 1234 public boolean isTemplateParametersPresent() 1235 { 1236 return this.getSuperClassifierFacade().isTemplateParametersPresent(); 1237 } 1238 1239 /** 1240 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++, 1241 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on 1242 * Enumerations and Interfaces, optionally applies on other model elements. 1243 * @see ModelElementFacade#isValidIdentifierName() 1244 */ 1245 public boolean isValidIdentifierName() 1246 { 1247 return this.getSuperClassifierFacade().isValidIdentifierName(); 1248 } 1249 1250 /** 1251 * Searches for the constraint with the specified 'name' on this model element, and if found 1252 * translates it using the specified 'translation' from a translation library discovered by the 1253 * framework. 1254 * @see ModelElementFacade#translateConstraint(String name, String translation) 1255 */ 1256 public String translateConstraint(String name, String translation) 1257 { 1258 return this.getSuperClassifierFacade().translateConstraint(name, translation); 1259 } 1260 1261 /** 1262 * Translates all constraints belonging to this model element with the given 'translation'. 1263 * @see ModelElementFacade#translateConstraints(String translation) 1264 */ 1265 public String[] translateConstraints(String translation) 1266 { 1267 return this.getSuperClassifierFacade().translateConstraints(translation); 1268 } 1269 1270 /** 1271 * Translates the constraints of the specified 'kind' belonging to this model element. 1272 * @see ModelElementFacade#translateConstraints(String kind, String translation) 1273 */ 1274 public String[] translateConstraints(String kind, String translation) 1275 { 1276 return this.getSuperClassifierFacade().translateConstraints(kind, translation); 1277 } 1278 1279 /** 1280 * @see MetafacadeBase#initialize() 1281 */ 1282 @Override 1283 public void initialize() 1284 { 1285 this.getSuperClassifierFacade().initialize(); 1286 } 1287 1288 /** 1289 * @return Object getSuperClassifierFacade().getValidationOwner() 1290 * @see MetafacadeBase#getValidationOwner() 1291 */ 1292 @Override 1293 public Object getValidationOwner() 1294 { 1295 Object owner = this.getSuperClassifierFacade().getValidationOwner(); 1296 return owner; 1297 } 1298 1299 /** 1300 * @return String getSuperClassifierFacade().getValidationName() 1301 * @see MetafacadeBase#getValidationName() 1302 */ 1303 @Override 1304 public String getValidationName() 1305 { 1306 String name = this.getSuperClassifierFacade().getValidationName(); 1307 return name; 1308 } 1309 1310 /** 1311 * @param validationMessages Collection<ModelValidationMessage> 1312 * @see MetafacadeBase#validateInvariants(Collection validationMessages) 1313 */ 1314 @Override 1315 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 1316 { 1317 this.getSuperClassifierFacade().validateInvariants(validationMessages); 1318 } 1319 1320 /** 1321 * The property that stores the name of the metafacade. 1322 */ 1323 private static final String NAME_PROPERTY = "name"; 1324 private static final String FQNAME_PROPERTY = "fullyQualifiedName"; 1325 1326 /** 1327 * @see Object#toString() 1328 */ 1329 @Override 1330 public String toString() 1331 { 1332 final StringBuilder toString = new StringBuilder(this.getClass().getName()); 1333 toString.append("["); 1334 try 1335 { 1336 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY)); 1337 } 1338 catch (final Throwable tryAgain) 1339 { 1340 try 1341 { 1342 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY)); 1343 } 1344 catch (final Throwable ignore) 1345 { 1346 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property 1347 } 1348 } 1349 toString.append("]"); 1350 return toString.toString(); 1351 } 1352}