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