001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.cartridges.hibernate.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 * TODO: Model Documentation for org.andromda.cartridges.hibernate.metafacades.HibernateAssociation 030 * MetafacadeLogic for HibernateAssociation 031 * 032 * @see HibernateAssociation 033 */ 034public abstract class HibernateAssociationLogic 035 extends MetafacadeBase 036 implements HibernateAssociation 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 HibernateAssociationLogic(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 HibernateAssociation 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.hibernate.metafacades.HibernateAssociation"; 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 HibernateAssociation 112 */ 113 public boolean isHibernateAssociationMetaType() 114 { 115 return true; 116 } 117 118 // --------------- attributes --------------------- 119 120 /** 121 * @see org.andromda.cartridges.hibernate.metafacades.HibernateAssociation#getHibernateCacheType() 122 * @return String 123 */ 124 protected abstract String handleGetHibernateCacheType(); 125 126 private String __hibernateCacheType1a; 127 private boolean __hibernateCacheType1aSet = false; 128 129 /** 130 * TODO: Model Documentation for 131 * org.andromda.cartridges.hibernate.metafacades.HibernateAssociation.hibernateCacheType 132 * @return (String)handleGetHibernateCacheType() 133 */ 134 public final String getHibernateCacheType() 135 { 136 String hibernateCacheType1a = this.__hibernateCacheType1a; 137 if (!this.__hibernateCacheType1aSet) 138 { 139 // hibernateCacheType has no pre constraints 140 hibernateCacheType1a = handleGetHibernateCacheType(); 141 // hibernateCacheType has no post constraints 142 this.__hibernateCacheType1a = hibernateCacheType1a; 143 if (isMetafacadePropertyCachingEnabled()) 144 { 145 this.__hibernateCacheType1aSet = true; 146 } 147 } 148 return hibernateCacheType1a; 149 } 150 151 /** 152 * @see org.andromda.cartridges.hibernate.metafacades.HibernateAssociation#isEhCacheEternal() 153 * @return boolean 154 */ 155 protected abstract boolean handleIsEhCacheEternal(); 156 157 private boolean __ehCacheEternal2a; 158 private boolean __ehCacheEternal2aSet = false; 159 160 /** 161 * EhCache property. Defines if elements are eternal. 162 * @return (boolean)handleIsEhCacheEternal() 163 */ 164 public final boolean isEhCacheEternal() 165 { 166 boolean ehCacheEternal2a = this.__ehCacheEternal2a; 167 if (!this.__ehCacheEternal2aSet) 168 { 169 // ehCacheEternal has no pre constraints 170 ehCacheEternal2a = handleIsEhCacheEternal(); 171 // ehCacheEternal has no post constraints 172 this.__ehCacheEternal2a = ehCacheEternal2a; 173 if (isMetafacadePropertyCachingEnabled()) 174 { 175 this.__ehCacheEternal2aSet = true; 176 } 177 } 178 return ehCacheEternal2a; 179 } 180 181 /** 182 * @see org.andromda.cartridges.hibernate.metafacades.HibernateAssociation#getEhCacheMaxElementsInMemory() 183 * @return int 184 */ 185 protected abstract int handleGetEhCacheMaxElementsInMemory(); 186 187 private int __ehCacheMaxElementsInMemory3a; 188 private boolean __ehCacheMaxElementsInMemory3aSet = false; 189 190 /** 191 * EhCache property. Defines the maximum number of objects that will be created in memory. 192 * @return (int)handleGetEhCacheMaxElementsInMemory() 193 */ 194 public final int getEhCacheMaxElementsInMemory() 195 { 196 int ehCacheMaxElementsInMemory3a = this.__ehCacheMaxElementsInMemory3a; 197 if (!this.__ehCacheMaxElementsInMemory3aSet) 198 { 199 // ehCacheMaxElementsInMemory has no pre constraints 200 ehCacheMaxElementsInMemory3a = handleGetEhCacheMaxElementsInMemory(); 201 // ehCacheMaxElementsInMemory has no post constraints 202 this.__ehCacheMaxElementsInMemory3a = ehCacheMaxElementsInMemory3a; 203 if (isMetafacadePropertyCachingEnabled()) 204 { 205 this.__ehCacheMaxElementsInMemory3aSet = true; 206 } 207 } 208 return ehCacheMaxElementsInMemory3a; 209 } 210 211 /** 212 * @see org.andromda.cartridges.hibernate.metafacades.HibernateAssociation#isEhCacheOverflowToDisk() 213 * @return boolean 214 */ 215 protected abstract boolean handleIsEhCacheOverflowToDisk(); 216 217 private boolean __ehCacheOverflowToDisk4a; 218 private boolean __ehCacheOverflowToDisk4aSet = false; 219 220 /** 221 * EhCache property. Defines if elements can overflow to disk 222 * @return (boolean)handleIsEhCacheOverflowToDisk() 223 */ 224 public final boolean isEhCacheOverflowToDisk() 225 { 226 boolean ehCacheOverflowToDisk4a = this.__ehCacheOverflowToDisk4a; 227 if (!this.__ehCacheOverflowToDisk4aSet) 228 { 229 // ehCacheOverflowToDisk has no pre constraints 230 ehCacheOverflowToDisk4a = handleIsEhCacheOverflowToDisk(); 231 // ehCacheOverflowToDisk has no post constraints 232 this.__ehCacheOverflowToDisk4a = ehCacheOverflowToDisk4a; 233 if (isMetafacadePropertyCachingEnabled()) 234 { 235 this.__ehCacheOverflowToDisk4aSet = true; 236 } 237 } 238 return ehCacheOverflowToDisk4a; 239 } 240 241 /** 242 * @see org.andromda.cartridges.hibernate.metafacades.HibernateAssociation#getEhCacheTimeToIdleSeconds() 243 * @return int 244 */ 245 protected abstract int handleGetEhCacheTimeToIdleSeconds(); 246 247 private int __ehCacheTimeToIdleSeconds5a; 248 private boolean __ehCacheTimeToIdleSeconds5aSet = false; 249 250 /** 251 * EhCache property. Defines the time to idle for an element before it expires. 252 * @return (int)handleGetEhCacheTimeToIdleSeconds() 253 */ 254 public final int getEhCacheTimeToIdleSeconds() 255 { 256 int ehCacheTimeToIdleSeconds5a = this.__ehCacheTimeToIdleSeconds5a; 257 if (!this.__ehCacheTimeToIdleSeconds5aSet) 258 { 259 // ehCacheTimeToIdleSeconds has no pre constraints 260 ehCacheTimeToIdleSeconds5a = handleGetEhCacheTimeToIdleSeconds(); 261 // ehCacheTimeToIdleSeconds has no post constraints 262 this.__ehCacheTimeToIdleSeconds5a = ehCacheTimeToIdleSeconds5a; 263 if (isMetafacadePropertyCachingEnabled()) 264 { 265 this.__ehCacheTimeToIdleSeconds5aSet = true; 266 } 267 } 268 return ehCacheTimeToIdleSeconds5a; 269 } 270 271 /** 272 * @see org.andromda.cartridges.hibernate.metafacades.HibernateAssociation#getEhCacheTimeToLiveSeconds() 273 * @return int 274 */ 275 protected abstract int handleGetEhCacheTimeToLiveSeconds(); 276 277 private int __ehCacheTimeToLiveSeconds6a; 278 private boolean __ehCacheTimeToLiveSeconds6aSet = false; 279 280 /** 281 * EhCache property. Defines the time to live for an element before it expires. 282 * @return (int)handleGetEhCacheTimeToLiveSeconds() 283 */ 284 public final int getEhCacheTimeToLiveSeconds() 285 { 286 int ehCacheTimeToLiveSeconds6a = this.__ehCacheTimeToLiveSeconds6a; 287 if (!this.__ehCacheTimeToLiveSeconds6aSet) 288 { 289 // ehCacheTimeToLiveSeconds has no pre constraints 290 ehCacheTimeToLiveSeconds6a = handleGetEhCacheTimeToLiveSeconds(); 291 // ehCacheTimeToLiveSeconds has no post constraints 292 this.__ehCacheTimeToLiveSeconds6a = ehCacheTimeToLiveSeconds6a; 293 if (isMetafacadePropertyCachingEnabled()) 294 { 295 this.__ehCacheTimeToLiveSeconds6aSet = true; 296 } 297 } 298 return ehCacheTimeToLiveSeconds6a; 299 } 300 301 /** 302 * @see org.andromda.cartridges.hibernate.metafacades.HibernateAssociation#isHibernateCacheDistributed() 303 * @return boolean 304 */ 305 protected abstract boolean handleIsHibernateCacheDistributed(); 306 307 private boolean __hibernateCacheDistributed7a; 308 private boolean __hibernateCacheDistributed7aSet = false; 309 310 /** 311 * Specifies whether the cache for this association is distributed. 312 * @return (boolean)handleIsHibernateCacheDistributed() 313 */ 314 public final boolean isHibernateCacheDistributed() 315 { 316 boolean hibernateCacheDistributed7a = this.__hibernateCacheDistributed7a; 317 if (!this.__hibernateCacheDistributed7aSet) 318 { 319 // hibernateCacheDistributed has no pre constraints 320 hibernateCacheDistributed7a = handleIsHibernateCacheDistributed(); 321 // hibernateCacheDistributed has no post constraints 322 this.__hibernateCacheDistributed7a = hibernateCacheDistributed7a; 323 if (isMetafacadePropertyCachingEnabled()) 324 { 325 this.__hibernateCacheDistributed7aSet = true; 326 } 327 } 328 return hibernateCacheDistributed7a; 329 } 330 331 /** 332 * @return true 333 * @see EntityAssociation 334 */ 335 public boolean isEntityAssociationMetaType() 336 { 337 return true; 338 } 339 340 /** 341 * @return true 342 * @see org.andromda.metafacades.uml.AssociationFacade 343 */ 344 public boolean isAssociationFacadeMetaType() 345 { 346 return true; 347 } 348 349 /** 350 * @return true 351 * @see GeneralizableElementFacade 352 */ 353 public boolean isGeneralizableElementFacadeMetaType() 354 { 355 return true; 356 } 357 358 /** 359 * @return true 360 * @see ModelElementFacade 361 */ 362 public boolean isModelElementFacadeMetaType() 363 { 364 return true; 365 } 366 367 // ----------- delegates to EntityAssociation ------------ 368 /** 369 * The first association end. 370 * @see org.andromda.metafacades.uml.AssociationFacade#getAssociationEndA() 371 */ 372 public AssociationEndFacade getAssociationEndA() 373 { 374 return this.getSuperEntityAssociation().getAssociationEndA(); 375 } 376 377 /** 378 * The second association end. 379 * @see org.andromda.metafacades.uml.AssociationFacade#getAssociationEndB() 380 */ 381 public AssociationEndFacade getAssociationEndB() 382 { 383 return this.getSuperEntityAssociation().getAssociationEndB(); 384 } 385 386 /** 387 * Gets the association ends belonging to this association. 388 * @see org.andromda.metafacades.uml.AssociationFacade#getAssociationEnds() 389 */ 390 public List<AssociationEndFacade> getAssociationEnds() 391 { 392 return this.getSuperEntityAssociation().getAssociationEnds(); 393 } 394 395 /** 396 * A name suited for naming this relationship. This name will be constructed from both 397 * association ends. 398 * @see org.andromda.metafacades.uml.AssociationFacade#getRelationName() 399 */ 400 public String getRelationName() 401 { 402 return this.getSuperEntityAssociation().getRelationName(); 403 } 404 405 /** 406 * Indicates if this association is 'abstract'. 407 * @see org.andromda.metafacades.uml.AssociationFacade#isAbstract() 408 */ 409 public boolean isAbstract() 410 { 411 return this.getSuperEntityAssociation().isAbstract(); 412 } 413 414 /** 415 * True if the AssociationFacade is an AssociationClass. 416 * @see org.andromda.metafacades.uml.AssociationFacade#isAssociationClass() 417 */ 418 public boolean isAssociationClass() 419 { 420 return this.getSuperEntityAssociation().isAssociationClass(); 421 } 422 423 /** 424 * UML2: Determines whether this association is a binary association, i.e. whether it has 425 * exactly two member ends. UML2 allows association classes in the association itself (many2many 426 * with association attributes). Default=true: only two member ends. 427 * @see org.andromda.metafacades.uml.AssociationFacade#isBinary() 428 */ 429 public boolean isBinary() 430 { 431 return this.getSuperEntityAssociation().isBinary(); 432 } 433 434 /** 435 * UML2: Returns the value of the 'Is Derived' attribute. The default value is "false". If 436 * isDerived is true, the value of the attribute is derived from information elsewhere. 437 * Specifies whether the Property is derived, i.e., whether its value or values can be computed 438 * from other information. 439 * @see org.andromda.metafacades.uml.AssociationFacade#isDerived() 440 */ 441 public boolean isDerived() 442 { 443 return this.getSuperEntityAssociation().isDerived(); 444 } 445 446 /** 447 * True if this association cannot be extended and represent a leaf in the inheritance tree. 448 * @see org.andromda.metafacades.uml.AssociationFacade#isLeaf() 449 */ 450 public boolean isLeaf() 451 { 452 return this.getSuperEntityAssociation().isLeaf(); 453 } 454 455 /** 456 * Indicates whether or not this associations represents a many-to-many relation. 457 * @see org.andromda.metafacades.uml.AssociationFacade#isMany2Many() 458 */ 459 public boolean isMany2Many() 460 { 461 return this.getSuperEntityAssociation().isMany2Many(); 462 } 463 464 /** 465 * The name of the schema that contains the database table 466 * @see EntityAssociation#getSchema() 467 */ 468 public String getSchema() 469 { 470 return this.getSuperEntityAssociation().getSchema(); 471 } 472 473 /** 474 * The name of the table if this is a many-to-many association. Otherwise it just returns null 475 * if not part of a many-to-many association. 476 * @see EntityAssociation#getTableName() 477 */ 478 public String getTableName() 479 { 480 return this.getSuperEntityAssociation().getTableName(); 481 } 482 483 /** 484 * is this an EntityAssociation? 485 * @see EntityAssociation#isEntityAssociation() 486 */ 487 public boolean isEntityAssociation() 488 { 489 return this.getSuperEntityAssociation().isEntityAssociation(); 490 } 491 492 /** 493 * Finds the tagged value optional searching the entire inheritance hierarchy if 'follow' is set 494 * to true. 495 * @see GeneralizableElementFacade#findTaggedValue(String tagName, boolean follow) 496 */ 497 public Object findTaggedValue(String tagName, boolean follow) 498 { 499 return this.getSuperEntityAssociation().findTaggedValue(tagName, follow); 500 } 501 502 /** 503 * All generalizations for this generalizable element, goes up the inheritance tree. 504 * @see GeneralizableElementFacade#getAllGeneralizations() 505 */ 506 public Collection<GeneralizableElementFacade> getAllGeneralizations() 507 { 508 return this.getSuperEntityAssociation().getAllGeneralizations(); 509 } 510 511 /** 512 * All specializations (travels down the inheritance hierarchy). 513 * @see GeneralizableElementFacade#getAllSpecializations() 514 */ 515 public Collection<GeneralizableElementFacade> getAllSpecializations() 516 { 517 return this.getSuperEntityAssociation().getAllSpecializations(); 518 } 519 520 /** 521 * Gets the direct generalization for this generalizable element. 522 * @see GeneralizableElementFacade#getGeneralization() 523 */ 524 public GeneralizableElementFacade getGeneralization() 525 { 526 return this.getSuperEntityAssociation().getGeneralization(); 527 } 528 529 /** 530 * Gets the actual links that this generalization element is part of (it plays either the 531 * specialization or generalization). 532 * @see GeneralizableElementFacade#getGeneralizationLinks() 533 */ 534 public Collection<GeneralizationFacade> getGeneralizationLinks() 535 { 536 return this.getSuperEntityAssociation().getGeneralizationLinks(); 537 } 538 539 /** 540 * A comma separated list of the fully qualified names of all generalizations. 541 * @see GeneralizableElementFacade#getGeneralizationList() 542 */ 543 public String getGeneralizationList() 544 { 545 return this.getSuperEntityAssociation().getGeneralizationList(); 546 } 547 548 /** 549 * The element found when you recursively follow the generalization path up to the root. If an 550 * element has no generalization itself will be considered the root. 551 * @see GeneralizableElementFacade#getGeneralizationRoot() 552 */ 553 public GeneralizableElementFacade getGeneralizationRoot() 554 { 555 return this.getSuperEntityAssociation().getGeneralizationRoot(); 556 } 557 558 /** 559 * Return all generalizations (ancestors) from this generalizable element. 560 * @see GeneralizableElementFacade#getGeneralizations() 561 */ 562 public Collection<GeneralizableElementFacade> getGeneralizations() 563 { 564 return this.getSuperEntityAssociation().getGeneralizations(); 565 } 566 567 /** 568 * Gets the direct specializations (i.e. sub elements) for this generalizatble element. 569 * @see GeneralizableElementFacade#getSpecializations() 570 */ 571 public Collection<GeneralizableElementFacade> getSpecializations() 572 { 573 return this.getSuperEntityAssociation().getSpecializations(); 574 } 575 576 /** 577 * Copies all tagged values from the given ModelElementFacade to this model element facade. 578 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element) 579 */ 580 public void copyTaggedValues(ModelElementFacade element) 581 { 582 this.getSuperEntityAssociation().copyTaggedValues(element); 583 } 584 585 /** 586 * Finds the tagged value with the specified 'tagName'. In case there are more values the first 587 * one found will be returned. 588 * @see ModelElementFacade#findTaggedValue(String tagName) 589 */ 590 public Object findTaggedValue(String tagName) 591 { 592 return this.getSuperEntityAssociation().findTaggedValue(tagName); 593 } 594 595 /** 596 * Returns all the values for the tagged value with the specified name. The returned collection 597 * will contains only String instances, or will be empty. Never null. 598 * @see ModelElementFacade#findTaggedValues(String tagName) 599 */ 600 public Collection<Object> findTaggedValues(String tagName) 601 { 602 return this.getSuperEntityAssociation().findTaggedValues(tagName); 603 } 604 605 /** 606 * Returns the fully qualified name of the model element. The fully qualified name includes 607 * complete package qualified name of the underlying model element. The templates parameter will 608 * be replaced by the correct one given the binding relation of the parameter to this element. 609 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement) 610 */ 611 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement) 612 { 613 return this.getSuperEntityAssociation().getBindedFullyQualifiedName(bindedElement); 614 } 615 616 /** 617 * Gets all constraints belonging to the model element. 618 * @see ModelElementFacade#getConstraints() 619 */ 620 public Collection<ConstraintFacade> getConstraints() 621 { 622 return this.getSuperEntityAssociation().getConstraints(); 623 } 624 625 /** 626 * Returns the constraints of the argument kind that have been placed onto this model. Typical 627 * kinds are "inv", "pre" and "post". Other kinds are possible. 628 * @see ModelElementFacade#getConstraints(String kind) 629 */ 630 public Collection<ConstraintFacade> getConstraints(String kind) 631 { 632 return this.getSuperEntityAssociation().getConstraints(kind); 633 } 634 635 /** 636 * Gets the documentation for the model element, The indent argument is prefixed to each line. 637 * By default this method wraps lines after 64 characters. 638 * This method is equivalent to <code>getDocumentation(indent, 64)</code>. 639 * @see ModelElementFacade#getDocumentation(String indent) 640 */ 641 public String getDocumentation(String indent) 642 { 643 return this.getSuperEntityAssociation().getDocumentation(indent); 644 } 645 646 /** 647 * This method returns the documentation for this model element, with the lines wrapped after 648 * the specified number of characters, values of less than 1 will indicate no line wrapping is 649 * required. By default paragraphs are returned as HTML. 650 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>. 651 * @see ModelElementFacade#getDocumentation(String indent, int lineLength) 652 */ 653 public String getDocumentation(String indent, int lineLength) 654 { 655 return this.getSuperEntityAssociation().getDocumentation(indent, lineLength); 656 } 657 658 /** 659 * This method returns the documentation for this model element, with the lines wrapped after 660 * the specified number of characters, values of less than 1 will indicate no line wrapping is 661 * required. HTML style determines if HTML Escaping is applied. 662 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle) 663 */ 664 public String getDocumentation(String indent, int lineLength, boolean htmlStyle) 665 { 666 return this.getSuperEntityAssociation().getDocumentation(indent, lineLength, htmlStyle); 667 } 668 669 /** 670 * The fully qualified name of this model element. 671 * @see ModelElementFacade#getFullyQualifiedName() 672 */ 673 public String getFullyQualifiedName() 674 { 675 return this.getSuperEntityAssociation().getFullyQualifiedName(); 676 } 677 678 /** 679 * Returns the fully qualified name of the model element. The fully qualified name includes 680 * complete package qualified name of the underlying model element. If modelName is true, then 681 * the original name of the model element (the name contained within the model) will be the name 682 * returned, otherwise a name from a language mapping will be returned. 683 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName) 684 */ 685 public String getFullyQualifiedName(boolean modelName) 686 { 687 return this.getSuperEntityAssociation().getFullyQualifiedName(modelName); 688 } 689 690 /** 691 * Returns the fully qualified name as a path, the returned value always starts with out a slash 692 * '/'. 693 * @see ModelElementFacade#getFullyQualifiedNamePath() 694 */ 695 public String getFullyQualifiedNamePath() 696 { 697 return this.getSuperEntityAssociation().getFullyQualifiedNamePath(); 698 } 699 700 /** 701 * Gets the unique identifier of the underlying model element. 702 * @see ModelElementFacade#getId() 703 */ 704 public String getId() 705 { 706 return this.getSuperEntityAssociation().getId(); 707 } 708 709 /** 710 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which 711 * are not represented by other properties, i.e. native, transient, volatile, synchronized, 712 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings: 713 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require 714 * JDK5 compiler level. 715 * @see ModelElementFacade#getKeywords() 716 */ 717 public Collection<String> getKeywords() 718 { 719 return this.getSuperEntityAssociation().getKeywords(); 720 } 721 722 /** 723 * UML2: Retrieves a localized label for this named element. 724 * @see ModelElementFacade#getLabel() 725 */ 726 public String getLabel() 727 { 728 return this.getSuperEntityAssociation().getLabel(); 729 } 730 731 /** 732 * The language mappings that have been set for this model element. 733 * @see ModelElementFacade#getLanguageMappings() 734 */ 735 public TypeMappings getLanguageMappings() 736 { 737 return this.getSuperEntityAssociation().getLanguageMappings(); 738 } 739 740 /** 741 * Return the model containing this model element (multiple models may be loaded and processed 742 * at the same time). 743 * @see ModelElementFacade#getModel() 744 */ 745 public ModelFacade getModel() 746 { 747 return this.getSuperEntityAssociation().getModel(); 748 } 749 750 /** 751 * The name of the model element. 752 * @see ModelElementFacade#getName() 753 */ 754 public String getName() 755 { 756 return this.getSuperEntityAssociation().getName(); 757 } 758 759 /** 760 * Gets the package to which this model element belongs. 761 * @see ModelElementFacade#getPackage() 762 */ 763 public ModelElementFacade getPackage() 764 { 765 return this.getSuperEntityAssociation().getPackage(); 766 } 767 768 /** 769 * The name of this model element's package. 770 * @see ModelElementFacade#getPackageName() 771 */ 772 public String getPackageName() 773 { 774 return this.getSuperEntityAssociation().getPackageName(); 775 } 776 777 /** 778 * Gets the package name (optionally providing the ability to retrieve the model name and not 779 * the mapped name). 780 * @see ModelElementFacade#getPackageName(boolean modelName) 781 */ 782 public String getPackageName(boolean modelName) 783 { 784 return this.getSuperEntityAssociation().getPackageName(modelName); 785 } 786 787 /** 788 * Returns the package as a path, the returned value always starts with out a slash '/'. 789 * @see ModelElementFacade#getPackagePath() 790 */ 791 public String getPackagePath() 792 { 793 return this.getSuperEntityAssociation().getPackagePath(); 794 } 795 796 /** 797 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the 798 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from 799 * the names of the containing namespaces starting at the root of the hierarchy and ending with 800 * the name of the NamedElement itself. 801 * @see ModelElementFacade#getQualifiedName() 802 */ 803 public String getQualifiedName() 804 { 805 return this.getSuperEntityAssociation().getQualifiedName(); 806 } 807 808 /** 809 * Gets the root package for the model element. 810 * @see ModelElementFacade#getRootPackage() 811 */ 812 public PackageFacade getRootPackage() 813 { 814 return this.getSuperEntityAssociation().getRootPackage(); 815 } 816 817 /** 818 * Gets the dependencies for which this model element is the source. 819 * @see ModelElementFacade#getSourceDependencies() 820 */ 821 public Collection<DependencyFacade> getSourceDependencies() 822 { 823 return this.getSuperEntityAssociation().getSourceDependencies(); 824 } 825 826 /** 827 * If this model element is the context of an activity graph, this represents that activity 828 * graph. 829 * @see ModelElementFacade#getStateMachineContext() 830 */ 831 public StateMachineFacade getStateMachineContext() 832 { 833 return this.getSuperEntityAssociation().getStateMachineContext(); 834 } 835 836 /** 837 * The collection of ALL stereotype names for this model element. 838 * @see ModelElementFacade#getStereotypeNames() 839 */ 840 public Collection<String> getStereotypeNames() 841 { 842 return this.getSuperEntityAssociation().getStereotypeNames(); 843 } 844 845 /** 846 * Gets all stereotypes for this model element. 847 * @see ModelElementFacade#getStereotypes() 848 */ 849 public Collection<StereotypeFacade> getStereotypes() 850 { 851 return this.getSuperEntityAssociation().getStereotypes(); 852 } 853 854 /** 855 * Return the TaggedValues associated with this model element, under all stereotypes. 856 * @see ModelElementFacade#getTaggedValues() 857 */ 858 public Collection<TaggedValueFacade> getTaggedValues() 859 { 860 return this.getSuperEntityAssociation().getTaggedValues(); 861 } 862 863 /** 864 * Gets the dependencies for which this model element is the target. 865 * @see ModelElementFacade#getTargetDependencies() 866 */ 867 public Collection<DependencyFacade> getTargetDependencies() 868 { 869 return this.getSuperEntityAssociation().getTargetDependencies(); 870 } 871 872 /** 873 * Get the template parameter for this model element having the parameterName 874 * @see ModelElementFacade#getTemplateParameter(String parameterName) 875 */ 876 public Object getTemplateParameter(String parameterName) 877 { 878 return this.getSuperEntityAssociation().getTemplateParameter(parameterName); 879 } 880 881 /** 882 * Get the template parameters for this model element 883 * @see ModelElementFacade#getTemplateParameters() 884 */ 885 public Collection<TemplateParameterFacade> getTemplateParameters() 886 { 887 return this.getSuperEntityAssociation().getTemplateParameters(); 888 } 889 890 /** 891 * The visibility (i.e. public, private, protected or package) of the model element, will 892 * attempt a lookup for these values in the language mappings (if any). 893 * @see ModelElementFacade#getVisibility() 894 */ 895 public String getVisibility() 896 { 897 return this.getSuperEntityAssociation().getVisibility(); 898 } 899 900 /** 901 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance 902 * is taken into account when searching for the stereotype), false otherwise. 903 * @see ModelElementFacade#hasExactStereotype(String stereotypeName) 904 */ 905 public boolean hasExactStereotype(String stereotypeName) 906 { 907 return this.getSuperEntityAssociation().hasExactStereotype(stereotypeName); 908 } 909 910 /** 911 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, 912 * pipe, semicolon, or << >> 913 * @see ModelElementFacade#hasKeyword(String keywordName) 914 */ 915 public boolean hasKeyword(String keywordName) 916 { 917 return this.getSuperEntityAssociation().hasKeyword(keywordName); 918 } 919 920 /** 921 * Returns true if the model element has the specified stereotype. If the stereotype itself 922 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if 923 * one of the stereotype's ancestors has a matching name this method will return true, false 924 * otherwise. 925 * For example, if we have a certain stereotype called <<exception>> and a model element has a 926 * stereotype called <<applicationException>> which extends <<exception>>, when calling this 927 * method with 'stereotypeName' defined as 'exception' the method would return true since 928 * <<applicationException>> inherits from <<exception>>. If you want to check if the model 929 * element has the exact stereotype, then use the method 'hasExactStereotype' instead. 930 * @see ModelElementFacade#hasStereotype(String stereotypeName) 931 */ 932 public boolean hasStereotype(String stereotypeName) 933 { 934 return this.getSuperEntityAssociation().hasStereotype(stereotypeName); 935 } 936 937 /** 938 * True if there are target dependencies from this element that are instances of BindingFacade. 939 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies. 940 * @see ModelElementFacade#isBindingDependenciesPresent() 941 */ 942 public boolean isBindingDependenciesPresent() 943 { 944 return this.getSuperEntityAssociation().isBindingDependenciesPresent(); 945 } 946 947 /** 948 * Indicates if any constraints are present on this model element. 949 * @see ModelElementFacade#isConstraintsPresent() 950 */ 951 public boolean isConstraintsPresent() 952 { 953 return this.getSuperEntityAssociation().isConstraintsPresent(); 954 } 955 956 /** 957 * Indicates if any documentation is present on this model element. 958 * @see ModelElementFacade#isDocumentationPresent() 959 */ 960 public boolean isDocumentationPresent() 961 { 962 return this.getSuperEntityAssociation().isDocumentationPresent(); 963 } 964 965 /** 966 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript. 967 * @see ModelElementFacade#isReservedWord() 968 */ 969 public boolean isReservedWord() 970 { 971 return this.getSuperEntityAssociation().isReservedWord(); 972 } 973 974 /** 975 * True is there are template parameters on this model element. For UML2, applies to Class, 976 * Operation, Property, and Parameter. 977 * @see ModelElementFacade#isTemplateParametersPresent() 978 */ 979 public boolean isTemplateParametersPresent() 980 { 981 return this.getSuperEntityAssociation().isTemplateParametersPresent(); 982 } 983 984 /** 985 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++, 986 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on 987 * Enumerations and Interfaces, optionally applies on other model elements. 988 * @see ModelElementFacade#isValidIdentifierName() 989 */ 990 public boolean isValidIdentifierName() 991 { 992 return this.getSuperEntityAssociation().isValidIdentifierName(); 993 } 994 995 /** 996 * Searches for the constraint with the specified 'name' on this model element, and if found 997 * translates it using the specified 'translation' from a translation library discovered by the 998 * framework. 999 * @see ModelElementFacade#translateConstraint(String name, String translation) 1000 */ 1001 public String translateConstraint(String name, String translation) 1002 { 1003 return this.getSuperEntityAssociation().translateConstraint(name, translation); 1004 } 1005 1006 /** 1007 * Translates all constraints belonging to this model element with the given 'translation'. 1008 * @see ModelElementFacade#translateConstraints(String translation) 1009 */ 1010 public String[] translateConstraints(String translation) 1011 { 1012 return this.getSuperEntityAssociation().translateConstraints(translation); 1013 } 1014 1015 /** 1016 * Translates the constraints of the specified 'kind' belonging to this model element. 1017 * @see ModelElementFacade#translateConstraints(String kind, String translation) 1018 */ 1019 public String[] translateConstraints(String kind, String translation) 1020 { 1021 return this.getSuperEntityAssociation().translateConstraints(kind, translation); 1022 } 1023 1024 /** 1025 * @see org.andromda.core.metafacade.MetafacadeBase#initialize() 1026 */ 1027 @Override 1028 public void initialize() 1029 { 1030 this.getSuperEntityAssociation().initialize(); 1031 } 1032 1033 /** 1034 * @return Object getSuperEntityAssociation().getValidationOwner() 1035 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner() 1036 */ 1037 @Override 1038 public Object getValidationOwner() 1039 { 1040 Object owner = this.getSuperEntityAssociation().getValidationOwner(); 1041 return owner; 1042 } 1043 1044 /** 1045 * @return String getSuperEntityAssociation().getValidationName() 1046 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName() 1047 */ 1048 @Override 1049 public String getValidationName() 1050 { 1051 String name = this.getSuperEntityAssociation().getValidationName(); 1052 return name; 1053 } 1054 1055 /** 1056 * @param validationMessages Collection<ModelValidationMessage> 1057 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages) 1058 */ 1059 @Override 1060 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 1061 { 1062 this.getSuperEntityAssociation().validateInvariants(validationMessages); 1063 } 1064 1065 /** 1066 * The property that stores the name of the metafacade. 1067 */ 1068 private static final String NAME_PROPERTY = "name"; 1069 private static final String FQNAME_PROPERTY = "fullyQualifiedName"; 1070 1071 /** 1072 * @see Object#toString() 1073 */ 1074 @Override 1075 public String toString() 1076 { 1077 final StringBuilder toString = new StringBuilder(this.getClass().getName()); 1078 toString.append("["); 1079 try 1080 { 1081 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY)); 1082 } 1083 catch (final Throwable tryAgain) 1084 { 1085 try 1086 { 1087 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY)); 1088 } 1089 catch (final Throwable ignore) 1090 { 1091 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property 1092 } 1093 } 1094 toString.append("]"); 1095 return toString.toString(); 1096 } 1097}