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