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.AttributeFacade; 013import org.andromda.metafacades.uml.ClassifierFacade; 014import org.andromda.metafacades.uml.ConstraintFacade; 015import org.andromda.metafacades.uml.DependencyFacade; 016import org.andromda.metafacades.uml.EnumerationFacade; 017import org.andromda.metafacades.uml.ModelElementFacade; 018import org.andromda.metafacades.uml.ModelFacade; 019import org.andromda.metafacades.uml.PackageFacade; 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 an attribute of a metafacade. 028 * MetafacadeLogic for MetafacadeAttribute 029 * 030 * @see MetafacadeAttribute 031 */ 032public abstract class MetafacadeAttributeLogic 033 extends MetafacadeBase 034 implements MetafacadeAttribute 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 MetafacadeAttributeLogic(Object metaObjectIn, String context) 047 { 048 super(metaObjectIn, getContext(context)); 049 this.superAttributeFacade = 050 (AttributeFacade) 051 MetafacadeFactory.getInstance().createFacadeImpl( 052 "org.andromda.metafacades.uml.AttributeFacade", 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 MetafacadeAttribute 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.MetafacadeAttribute"; 068 } 069 return context; 070 } 071 072 private AttributeFacade superAttributeFacade; 073 private boolean superAttributeFacadeInitialized = false; 074 075 /** 076 * Gets the AttributeFacade parent instance. 077 * @return this.superAttributeFacade AttributeFacade 078 */ 079 private AttributeFacade getSuperAttributeFacade() 080 { 081 if (!this.superAttributeFacadeInitialized) 082 { 083 ((MetafacadeBase)this.superAttributeFacade).setMetafacadeContext(this.getMetafacadeContext()); 084 this.superAttributeFacadeInitialized = true; 085 } 086 return this.superAttributeFacade; 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.superAttributeFacadeInitialized) 101 { 102 ((MetafacadeBase)this.superAttributeFacade).resetMetafacadeContext(context); 103 } 104 } 105 } 106 107 /** 108 * @return boolean true always 109 * @see MetafacadeAttribute 110 */ 111 public boolean isMetafacadeAttributeMetaType() 112 { 113 return true; 114 } 115 116 // --------------- attributes --------------------- 117 118 /** 119 * @see org.andromda.cartridges.meta.metafacades.MetafacadeAttribute#getImplementationOperationName() 120 * @return String 121 */ 122 protected abstract String handleGetImplementationOperationName(); 123 124 private String __implementationOperationName1a; 125 private boolean __implementationOperationName1aSet = false; 126 127 /** 128 * The implementation name for the operation that handles the logic of the attribute retrieval. 129 * @return (String)handleGetImplementationOperationName() 130 */ 131 public final String getImplementationOperationName() 132 { 133 String implementationOperationName1a = this.__implementationOperationName1a; 134 if (!this.__implementationOperationName1aSet) 135 { 136 // implementationOperationName has no pre constraints 137 implementationOperationName1a = handleGetImplementationOperationName(); 138 // implementationOperationName has no post constraints 139 this.__implementationOperationName1a = implementationOperationName1a; 140 if (isMetafacadePropertyCachingEnabled()) 141 { 142 this.__implementationOperationName1aSet = true; 143 } 144 } 145 return implementationOperationName1a; 146 } 147 148 /** 149 * @return true 150 * @see AttributeFacade 151 */ 152 public boolean isAttributeFacadeMetaType() 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 AttributeFacade ------------ 167 /** 168 * Searches the given feature for the specified tag. 169 * If the follow boolean is set to true then the search will continue from the class attribute 170 * to the class itself and then up the class hierarchy. 171 * @see AttributeFacade#findTaggedValue(String name, boolean follow) 172 */ 173 public Object findTaggedValue(String name, boolean follow) 174 { 175 return this.getSuperAttributeFacade().findTaggedValue(name, follow); 176 } 177 178 /** 179 * The default value of the attribute. This is the value given if no value is defined. 180 * @see AttributeFacade#getDefaultValue() 181 */ 182 public String getDefaultValue() 183 { 184 return this.getSuperAttributeFacade().getDefaultValue(); 185 } 186 187 /** 188 * If the attribute is an enumeration literal this represents the owning enumeration. Can be 189 * empty. 190 * @see AttributeFacade#getEnumeration() 191 */ 192 public EnumerationFacade getEnumeration() 193 { 194 return this.getSuperAttributeFacade().getEnumeration(); 195 } 196 197 /** 198 * Returns the enumeration literal parameters defined by tagged value as a comma separated list. 199 * @see AttributeFacade#getEnumerationLiteralParameters() 200 */ 201 public String getEnumerationLiteralParameters() 202 { 203 return this.getSuperAttributeFacade().getEnumerationLiteralParameters(); 204 } 205 206 /** 207 * The value for this attribute if it is an enumeration literal, null otherwise. The default 208 * value is returned as a String if it has been specified, if it's not specified this 209 * attribute's name is assumed. 210 * @see AttributeFacade#getEnumerationValue() 211 */ 212 public String getEnumerationValue() 213 { 214 return this.getSuperAttributeFacade().getEnumerationValue(); 215 } 216 217 /** 218 * The name of the accessor operation that would retrieve this attribute's value. 219 * @see AttributeFacade#getGetterName() 220 */ 221 public String getGetterName() 222 { 223 return this.getSuperAttributeFacade().getGetterName(); 224 } 225 226 /** 227 * The name of the type that is returned on the accessor and mutator operations, determined in 228 * part by the multiplicity. 229 * @see AttributeFacade#getGetterSetterTypeName() 230 */ 231 public String getGetterSetterTypeName() 232 { 233 return this.getSuperAttributeFacade().getGetterSetterTypeName(); 234 } 235 236 /** 237 * the lower value for the multiplicity 238 * -only applicable for UML2 239 * @see AttributeFacade#getLower() 240 */ 241 public int getLower() 242 { 243 return this.getSuperAttributeFacade().getLower(); 244 } 245 246 /** 247 * Gets the classifier who is the owner of the attributes. 248 * @see AttributeFacade#getOwner() 249 */ 250 public ClassifierFacade getOwner() 251 { 252 return this.getSuperAttributeFacade().getOwner(); 253 } 254 255 /** 256 * The name of the mutator operation that would retrieve this attribute's value. 257 * @see AttributeFacade#getSetterName() 258 */ 259 public String getSetterName() 260 { 261 return this.getSuperAttributeFacade().getSetterName(); 262 } 263 264 /** 265 * The classifier owning this attribute. 266 * @see AttributeFacade#getType() 267 */ 268 public ClassifierFacade getType() 269 { 270 return this.getSuperAttributeFacade().getType(); 271 } 272 273 /** 274 * the upper value for the multiplicity (will be -1 for *) 275 * -only applicable for UML2 276 * @see AttributeFacade#getUpper() 277 */ 278 public int getUpper() 279 { 280 return this.getSuperAttributeFacade().getUpper(); 281 } 282 283 /** 284 * True if this attribute can only be set. 285 * @see AttributeFacade#isAddOnly() 286 */ 287 public boolean isAddOnly() 288 { 289 return this.getSuperAttributeFacade().isAddOnly(); 290 } 291 292 /** 293 * True if this attribute can be modified. 294 * @see AttributeFacade#isChangeable() 295 */ 296 public boolean isChangeable() 297 { 298 return this.getSuperAttributeFacade().isChangeable(); 299 } 300 301 /** 302 * Indicates if the default value is present. 303 * @see AttributeFacade#isDefaultValuePresent() 304 */ 305 public boolean isDefaultValuePresent() 306 { 307 return this.getSuperAttributeFacade().isDefaultValuePresent(); 308 } 309 310 /** 311 * If the attribute is derived (its value is computed). UML2 only. UML14 always returns false. 312 * Default=false. 313 * @see AttributeFacade#isDerived() 314 */ 315 public boolean isDerived() 316 { 317 return this.getSuperAttributeFacade().isDerived(); 318 } 319 320 /** 321 * True if this attribute is owned by an enumeration. 322 * @see AttributeFacade#isEnumerationLiteral() 323 */ 324 public boolean isEnumerationLiteral() 325 { 326 return this.getSuperAttributeFacade().isEnumerationLiteral(); 327 } 328 329 /** 330 * Returns true if enumeration literal parameters exist (defined by tagged value) for the 331 * literal. 332 * @see AttributeFacade#isEnumerationLiteralParametersExist() 333 */ 334 public boolean isEnumerationLiteralParametersExist() 335 { 336 return this.getSuperAttributeFacade().isEnumerationLiteralParametersExist(); 337 } 338 339 /** 340 * True if this attribute is owned by an enumeration but is defined as a member variable (NOT a 341 * literal). 342 * @see AttributeFacade#isEnumerationMember() 343 */ 344 public boolean isEnumerationMember() 345 { 346 return this.getSuperAttributeFacade().isEnumerationMember(); 347 } 348 349 /** 350 * IsLeaf property in the operation. If true, operation is final, cannot be extended or 351 * implemented by a descendant. 352 * @see AttributeFacade#isLeaf() 353 */ 354 public boolean isLeaf() 355 { 356 return this.getSuperAttributeFacade().isLeaf(); 357 } 358 359 /** 360 * Whether or not this attribute has a multiplicity greater than 1. 361 * @see AttributeFacade#isMany() 362 */ 363 public boolean isMany() 364 { 365 return this.getSuperAttributeFacade().isMany(); 366 } 367 368 /** 369 * Indicates whether or not the attributes are ordered (if multiplicity is greater than 1). 370 * @see AttributeFacade#isOrdered() 371 */ 372 public boolean isOrdered() 373 { 374 return this.getSuperAttributeFacade().isOrdered(); 375 } 376 377 /** 378 * Whether or not this attribute can be modified. 379 * @see AttributeFacade#isReadOnly() 380 */ 381 public boolean isReadOnly() 382 { 383 return this.getSuperAttributeFacade().isReadOnly(); 384 } 385 386 /** 387 * Whether or not the multiplicity of this attribute is 1. 388 * @see AttributeFacade#isRequired() 389 */ 390 public boolean isRequired() 391 { 392 return this.getSuperAttributeFacade().isRequired(); 393 } 394 395 /** 396 * Indicates if this attribute is 'static', meaning it has a classifier scope. 397 * @see AttributeFacade#isStatic() 398 */ 399 public boolean isStatic() 400 { 401 return this.getSuperAttributeFacade().isStatic(); 402 } 403 404 /** 405 * If the attribute is unique within the Collection type. UML2 only. UML14 always returns false. 406 * Unique+Ordered determines the implementation Collection type. Default=false. 407 * @see AttributeFacade#isUnique() 408 */ 409 public boolean isUnique() 410 { 411 return this.getSuperAttributeFacade().isUnique(); 412 } 413 414 /** 415 * Copies all tagged values from the given ModelElementFacade to this model element facade. 416 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element) 417 */ 418 public void copyTaggedValues(ModelElementFacade element) 419 { 420 this.getSuperAttributeFacade().copyTaggedValues(element); 421 } 422 423 /** 424 * Finds the tagged value with the specified 'tagName'. In case there are more values the first 425 * one found will be returned. 426 * @see ModelElementFacade#findTaggedValue(String tagName) 427 */ 428 public Object findTaggedValue(String tagName) 429 { 430 return this.getSuperAttributeFacade().findTaggedValue(tagName); 431 } 432 433 /** 434 * Returns all the values for the tagged value with the specified name. The returned collection 435 * will contains only String instances, or will be empty. Never null. 436 * @see ModelElementFacade#findTaggedValues(String tagName) 437 */ 438 public Collection<Object> findTaggedValues(String tagName) 439 { 440 return this.getSuperAttributeFacade().findTaggedValues(tagName); 441 } 442 443 /** 444 * Returns the fully qualified name of the model element. The fully qualified name includes 445 * complete package qualified name of the underlying model element. The templates parameter will 446 * be replaced by the correct one given the binding relation of the parameter to this element. 447 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement) 448 */ 449 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement) 450 { 451 return this.getSuperAttributeFacade().getBindedFullyQualifiedName(bindedElement); 452 } 453 454 /** 455 * Gets all constraints belonging to the model element. 456 * @see ModelElementFacade#getConstraints() 457 */ 458 public Collection<ConstraintFacade> getConstraints() 459 { 460 return this.getSuperAttributeFacade().getConstraints(); 461 } 462 463 /** 464 * Returns the constraints of the argument kind that have been placed onto this model. Typical 465 * kinds are "inv", "pre" and "post". Other kinds are possible. 466 * @see ModelElementFacade#getConstraints(String kind) 467 */ 468 public Collection<ConstraintFacade> getConstraints(String kind) 469 { 470 return this.getSuperAttributeFacade().getConstraints(kind); 471 } 472 473 /** 474 * Gets the documentation for the model element, The indent argument is prefixed to each line. 475 * By default this method wraps lines after 64 characters. 476 * This method is equivalent to <code>getDocumentation(indent, 64)</code>. 477 * @see ModelElementFacade#getDocumentation(String indent) 478 */ 479 public String getDocumentation(String indent) 480 { 481 return this.getSuperAttributeFacade().getDocumentation(indent); 482 } 483 484 /** 485 * This method returns the documentation for this model element, with the lines wrapped after 486 * the specified number of characters, values of less than 1 will indicate no line wrapping is 487 * required. By default paragraphs are returned as HTML. 488 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>. 489 * @see ModelElementFacade#getDocumentation(String indent, int lineLength) 490 */ 491 public String getDocumentation(String indent, int lineLength) 492 { 493 return this.getSuperAttributeFacade().getDocumentation(indent, lineLength); 494 } 495 496 /** 497 * This method returns the documentation for this model element, with the lines wrapped after 498 * the specified number of characters, values of less than 1 will indicate no line wrapping is 499 * required. HTML style determines if HTML Escaping is applied. 500 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle) 501 */ 502 public String getDocumentation(String indent, int lineLength, boolean htmlStyle) 503 { 504 return this.getSuperAttributeFacade().getDocumentation(indent, lineLength, htmlStyle); 505 } 506 507 /** 508 * The fully qualified name of this model element. 509 * @see ModelElementFacade#getFullyQualifiedName() 510 */ 511 public String getFullyQualifiedName() 512 { 513 return this.getSuperAttributeFacade().getFullyQualifiedName(); 514 } 515 516 /** 517 * Returns the fully qualified name of the model element. The fully qualified name includes 518 * complete package qualified name of the underlying model element. If modelName is true, then 519 * the original name of the model element (the name contained within the model) will be the name 520 * returned, otherwise a name from a language mapping will be returned. 521 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName) 522 */ 523 public String getFullyQualifiedName(boolean modelName) 524 { 525 return this.getSuperAttributeFacade().getFullyQualifiedName(modelName); 526 } 527 528 /** 529 * Returns the fully qualified name as a path, the returned value always starts with out a slash 530 * '/'. 531 * @see ModelElementFacade#getFullyQualifiedNamePath() 532 */ 533 public String getFullyQualifiedNamePath() 534 { 535 return this.getSuperAttributeFacade().getFullyQualifiedNamePath(); 536 } 537 538 /** 539 * Gets the unique identifier of the underlying model element. 540 * @see ModelElementFacade#getId() 541 */ 542 public String getId() 543 { 544 return this.getSuperAttributeFacade().getId(); 545 } 546 547 /** 548 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which 549 * are not represented by other properties, i.e. native, transient, volatile, synchronized, 550 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings: 551 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require 552 * JDK5 compiler level. 553 * @see ModelElementFacade#getKeywords() 554 */ 555 public Collection<String> getKeywords() 556 { 557 return this.getSuperAttributeFacade().getKeywords(); 558 } 559 560 /** 561 * UML2: Retrieves a localized label for this named element. 562 * @see ModelElementFacade#getLabel() 563 */ 564 public String getLabel() 565 { 566 return this.getSuperAttributeFacade().getLabel(); 567 } 568 569 /** 570 * The language mappings that have been set for this model element. 571 * @see ModelElementFacade#getLanguageMappings() 572 */ 573 public TypeMappings getLanguageMappings() 574 { 575 return this.getSuperAttributeFacade().getLanguageMappings(); 576 } 577 578 /** 579 * Return the model containing this model element (multiple models may be loaded and processed 580 * at the same time). 581 * @see ModelElementFacade#getModel() 582 */ 583 public ModelFacade getModel() 584 { 585 return this.getSuperAttributeFacade().getModel(); 586 } 587 588 /** 589 * The name of the model element. 590 * @see ModelElementFacade#getName() 591 */ 592 public String getName() 593 { 594 return this.getSuperAttributeFacade().getName(); 595 } 596 597 /** 598 * Gets the package to which this model element belongs. 599 * @see ModelElementFacade#getPackage() 600 */ 601 public ModelElementFacade getPackage() 602 { 603 return this.getSuperAttributeFacade().getPackage(); 604 } 605 606 /** 607 * The name of this model element's package. 608 * @see ModelElementFacade#getPackageName() 609 */ 610 public String getPackageName() 611 { 612 return this.getSuperAttributeFacade().getPackageName(); 613 } 614 615 /** 616 * Gets the package name (optionally providing the ability to retrieve the model name and not 617 * the mapped name). 618 * @see ModelElementFacade#getPackageName(boolean modelName) 619 */ 620 public String getPackageName(boolean modelName) 621 { 622 return this.getSuperAttributeFacade().getPackageName(modelName); 623 } 624 625 /** 626 * Returns the package as a path, the returned value always starts with out a slash '/'. 627 * @see ModelElementFacade#getPackagePath() 628 */ 629 public String getPackagePath() 630 { 631 return this.getSuperAttributeFacade().getPackagePath(); 632 } 633 634 /** 635 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the 636 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from 637 * the names of the containing namespaces starting at the root of the hierarchy and ending with 638 * the name of the NamedElement itself. 639 * @see ModelElementFacade#getQualifiedName() 640 */ 641 public String getQualifiedName() 642 { 643 return this.getSuperAttributeFacade().getQualifiedName(); 644 } 645 646 /** 647 * Gets the root package for the model element. 648 * @see ModelElementFacade#getRootPackage() 649 */ 650 public PackageFacade getRootPackage() 651 { 652 return this.getSuperAttributeFacade().getRootPackage(); 653 } 654 655 /** 656 * Gets the dependencies for which this model element is the source. 657 * @see ModelElementFacade#getSourceDependencies() 658 */ 659 public Collection<DependencyFacade> getSourceDependencies() 660 { 661 return this.getSuperAttributeFacade().getSourceDependencies(); 662 } 663 664 /** 665 * If this model element is the context of an activity graph, this represents that activity 666 * graph. 667 * @see ModelElementFacade#getStateMachineContext() 668 */ 669 public StateMachineFacade getStateMachineContext() 670 { 671 return this.getSuperAttributeFacade().getStateMachineContext(); 672 } 673 674 /** 675 * The collection of ALL stereotype names for this model element. 676 * @see ModelElementFacade#getStereotypeNames() 677 */ 678 public Collection<String> getStereotypeNames() 679 { 680 return this.getSuperAttributeFacade().getStereotypeNames(); 681 } 682 683 /** 684 * Gets all stereotypes for this model element. 685 * @see ModelElementFacade#getStereotypes() 686 */ 687 public Collection<StereotypeFacade> getStereotypes() 688 { 689 return this.getSuperAttributeFacade().getStereotypes(); 690 } 691 692 /** 693 * Return the TaggedValues associated with this model element, under all stereotypes. 694 * @see ModelElementFacade#getTaggedValues() 695 */ 696 public Collection<TaggedValueFacade> getTaggedValues() 697 { 698 return this.getSuperAttributeFacade().getTaggedValues(); 699 } 700 701 /** 702 * Gets the dependencies for which this model element is the target. 703 * @see ModelElementFacade#getTargetDependencies() 704 */ 705 public Collection<DependencyFacade> getTargetDependencies() 706 { 707 return this.getSuperAttributeFacade().getTargetDependencies(); 708 } 709 710 /** 711 * Get the template parameter for this model element having the parameterName 712 * @see ModelElementFacade#getTemplateParameter(String parameterName) 713 */ 714 public Object getTemplateParameter(String parameterName) 715 { 716 return this.getSuperAttributeFacade().getTemplateParameter(parameterName); 717 } 718 719 /** 720 * Get the template parameters for this model element 721 * @see ModelElementFacade#getTemplateParameters() 722 */ 723 public Collection<TemplateParameterFacade> getTemplateParameters() 724 { 725 return this.getSuperAttributeFacade().getTemplateParameters(); 726 } 727 728 /** 729 * The visibility (i.e. public, private, protected or package) of the model element, will 730 * attempt a lookup for these values in the language mappings (if any). 731 * @see ModelElementFacade#getVisibility() 732 */ 733 public String getVisibility() 734 { 735 return this.getSuperAttributeFacade().getVisibility(); 736 } 737 738 /** 739 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance 740 * is taken into account when searching for the stereotype), false otherwise. 741 * @see ModelElementFacade#hasExactStereotype(String stereotypeName) 742 */ 743 public boolean hasExactStereotype(String stereotypeName) 744 { 745 return this.getSuperAttributeFacade().hasExactStereotype(stereotypeName); 746 } 747 748 /** 749 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, 750 * pipe, semicolon, or << >> 751 * @see ModelElementFacade#hasKeyword(String keywordName) 752 */ 753 public boolean hasKeyword(String keywordName) 754 { 755 return this.getSuperAttributeFacade().hasKeyword(keywordName); 756 } 757 758 /** 759 * Returns true if the model element has the specified stereotype. If the stereotype itself 760 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if 761 * one of the stereotype's ancestors has a matching name this method will return true, false 762 * otherwise. 763 * For example, if we have a certain stereotype called <<exception>> and a model element has a 764 * stereotype called <<applicationException>> which extends <<exception>>, when calling this 765 * method with 'stereotypeName' defined as 'exception' the method would return true since 766 * <<applicationException>> inherits from <<exception>>. If you want to check if the model 767 * element has the exact stereotype, then use the method 'hasExactStereotype' instead. 768 * @see ModelElementFacade#hasStereotype(String stereotypeName) 769 */ 770 public boolean hasStereotype(String stereotypeName) 771 { 772 return this.getSuperAttributeFacade().hasStereotype(stereotypeName); 773 } 774 775 /** 776 * True if there are target dependencies from this element that are instances of BindingFacade. 777 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies. 778 * @see ModelElementFacade#isBindingDependenciesPresent() 779 */ 780 public boolean isBindingDependenciesPresent() 781 { 782 return this.getSuperAttributeFacade().isBindingDependenciesPresent(); 783 } 784 785 /** 786 * Indicates if any constraints are present on this model element. 787 * @see ModelElementFacade#isConstraintsPresent() 788 */ 789 public boolean isConstraintsPresent() 790 { 791 return this.getSuperAttributeFacade().isConstraintsPresent(); 792 } 793 794 /** 795 * Indicates if any documentation is present on this model element. 796 * @see ModelElementFacade#isDocumentationPresent() 797 */ 798 public boolean isDocumentationPresent() 799 { 800 return this.getSuperAttributeFacade().isDocumentationPresent(); 801 } 802 803 /** 804 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript. 805 * @see ModelElementFacade#isReservedWord() 806 */ 807 public boolean isReservedWord() 808 { 809 return this.getSuperAttributeFacade().isReservedWord(); 810 } 811 812 /** 813 * True is there are template parameters on this model element. For UML2, applies to Class, 814 * Operation, Property, and Parameter. 815 * @see ModelElementFacade#isTemplateParametersPresent() 816 */ 817 public boolean isTemplateParametersPresent() 818 { 819 return this.getSuperAttributeFacade().isTemplateParametersPresent(); 820 } 821 822 /** 823 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++, 824 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on 825 * Enumerations and Interfaces, optionally applies on other model elements. 826 * @see ModelElementFacade#isValidIdentifierName() 827 */ 828 public boolean isValidIdentifierName() 829 { 830 return this.getSuperAttributeFacade().isValidIdentifierName(); 831 } 832 833 /** 834 * Searches for the constraint with the specified 'name' on this model element, and if found 835 * translates it using the specified 'translation' from a translation library discovered by the 836 * framework. 837 * @see ModelElementFacade#translateConstraint(String name, String translation) 838 */ 839 public String translateConstraint(String name, String translation) 840 { 841 return this.getSuperAttributeFacade().translateConstraint(name, translation); 842 } 843 844 /** 845 * Translates all constraints belonging to this model element with the given 'translation'. 846 * @see ModelElementFacade#translateConstraints(String translation) 847 */ 848 public String[] translateConstraints(String translation) 849 { 850 return this.getSuperAttributeFacade().translateConstraints(translation); 851 } 852 853 /** 854 * Translates the constraints of the specified 'kind' belonging to this model element. 855 * @see ModelElementFacade#translateConstraints(String kind, String translation) 856 */ 857 public String[] translateConstraints(String kind, String translation) 858 { 859 return this.getSuperAttributeFacade().translateConstraints(kind, translation); 860 } 861 862 /** 863 * @see org.andromda.core.metafacade.MetafacadeBase#initialize() 864 */ 865 @Override 866 public void initialize() 867 { 868 this.getSuperAttributeFacade().initialize(); 869 } 870 871 /** 872 * @return Object getSuperAttributeFacade().getValidationOwner() 873 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner() 874 */ 875 @Override 876 public Object getValidationOwner() 877 { 878 Object owner = this.getSuperAttributeFacade().getValidationOwner(); 879 return owner; 880 } 881 882 /** 883 * @return String getSuperAttributeFacade().getValidationName() 884 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName() 885 */ 886 @Override 887 public String getValidationName() 888 { 889 String name = this.getSuperAttributeFacade().getValidationName(); 890 return name; 891 } 892 893 /** 894 * @param validationMessages Collection<ModelValidationMessage> 895 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages) 896 */ 897 @Override 898 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 899 { 900 this.getSuperAttributeFacade().validateInvariants(validationMessages); 901 } 902 903 /** 904 * The property that stores the name of the metafacade. 905 */ 906 private static final String NAME_PROPERTY = "name"; 907 private static final String FQNAME_PROPERTY = "fullyQualifiedName"; 908 909 /** 910 * @see Object#toString() 911 */ 912 @Override 913 public String toString() 914 { 915 final StringBuilder toString = new StringBuilder(this.getClass().getName()); 916 toString.append("["); 917 try 918 { 919 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY)); 920 } 921 catch (final Throwable tryAgain) 922 { 923 try 924 { 925 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY)); 926 } 927 catch (final Throwable ignore) 928 { 929 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property 930 } 931 } 932 toString.append("]"); 933 return toString.toString(); 934 } 935}