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