001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.cartridges.bpm4struts.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.AssociationEndFacade; 013import org.andromda.metafacades.uml.AssociationFacade; 014import org.andromda.metafacades.uml.ClassifierFacade; 015import org.andromda.metafacades.uml.ConstraintFacade; 016import org.andromda.metafacades.uml.DependencyFacade; 017import org.andromda.metafacades.uml.EntityAttribute; 018import org.andromda.metafacades.uml.ManageableEntityAssociationEnd; 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; 027import org.andromda.translation.ocl.validation.OCLIntrospector; 028import org.andromda.translation.ocl.validation.OCLResultEnsurer; 029import org.apache.log4j.Logger; 030 031/** 032 * TODO: Model Documentation for 033 * org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd 034 * MetafacadeLogic for StrutsManageableEntityAssociationEnd 035 * 036 * @see StrutsManageableEntityAssociationEnd 037 */ 038public abstract class StrutsManageableEntityAssociationEndLogic 039 extends MetafacadeBase 040 implements StrutsManageableEntityAssociationEnd 041{ 042 /** 043 * The underlying UML object 044 * @see Object 045 */ 046 protected Object metaObject; 047 048 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 049 * @param metaObjectIn 050 * @param context 051 */ 052 protected StrutsManageableEntityAssociationEndLogic(Object metaObjectIn, String context) 053 { 054 super(metaObjectIn, getContext(context)); 055 this.superManageableEntityAssociationEnd = 056 (ManageableEntityAssociationEnd) 057 MetafacadeFactory.getInstance().createFacadeImpl( 058 "org.andromda.metafacades.uml.ManageableEntityAssociationEnd", 059 metaObjectIn, 060 getContext(context)); 061 this.metaObject = metaObjectIn; 062 } 063 064 /** 065 * The logger instance. 066 */ 067 private static final Logger logger = Logger.getLogger(StrutsManageableEntityAssociationEndLogic.class); 068 069 /** 070 * Gets the context for this metafacade logic instance. 071 * @param context String. Set to StrutsManageableEntityAssociationEnd if null 072 * @return context String 073 */ 074 private static String getContext(String context) 075 { 076 if (context == null) 077 { 078 context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd"; 079 } 080 return context; 081 } 082 083 private ManageableEntityAssociationEnd superManageableEntityAssociationEnd; 084 private boolean superManageableEntityAssociationEndInitialized = false; 085 086 /** 087 * Gets the ManageableEntityAssociationEnd parent instance. 088 * @return this.superManageableEntityAssociationEnd ManageableEntityAssociationEnd 089 */ 090 private ManageableEntityAssociationEnd getSuperManageableEntityAssociationEnd() 091 { 092 if (!this.superManageableEntityAssociationEndInitialized) 093 { 094 ((MetafacadeBase)this.superManageableEntityAssociationEnd).setMetafacadeContext(this.getMetafacadeContext()); 095 this.superManageableEntityAssociationEndInitialized = true; 096 } 097 return this.superManageableEntityAssociationEnd; 098 } 099 100 /** Reset context only for non-root metafacades 101 * @param context 102 * @see MetafacadeBase#resetMetafacadeContext(String context) 103 */ 104 @Override 105 public void resetMetafacadeContext(String context) 106 { 107 if (!this.contextRoot) // reset context only for non-root metafacades 108 { 109 context = getContext(context); // to have same value as in original constructor call 110 setMetafacadeContext (context); 111 if (this.superManageableEntityAssociationEndInitialized) 112 { 113 ((MetafacadeBase)this.superManageableEntityAssociationEnd).resetMetafacadeContext(context); 114 } 115 } 116 } 117 118 /** 119 * @return boolean true always 120 * @see StrutsManageableEntityAssociationEnd 121 */ 122 public boolean isStrutsManageableEntityAssociationEndMetaType() 123 { 124 return true; 125 } 126 127 // --------------- attributes --------------------- 128 129 /** 130 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd#getMessageKey() 131 * @return String 132 */ 133 protected abstract String handleGetMessageKey(); 134 135 private String __messageKey1a; 136 private boolean __messageKey1aSet = false; 137 138 /** 139 * TODO: Model Documentation for 140 * org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd.messageKey 141 * @return (String)handleGetMessageKey() 142 */ 143 public final String getMessageKey() 144 { 145 String messageKey1a = this.__messageKey1a; 146 if (!this.__messageKey1aSet) 147 { 148 // messageKey has no pre constraints 149 messageKey1a = handleGetMessageKey(); 150 // messageKey has no post constraints 151 this.__messageKey1a = messageKey1a; 152 if (isMetafacadePropertyCachingEnabled()) 153 { 154 this.__messageKey1aSet = true; 155 } 156 } 157 return messageKey1a; 158 } 159 160 /** 161 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd#getMessageValue() 162 * @return String 163 */ 164 protected abstract String handleGetMessageValue(); 165 166 private String __messageValue2a; 167 private boolean __messageValue2aSet = false; 168 169 /** 170 * TODO: Model Documentation for 171 * org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd.messageValue 172 * @return (String)handleGetMessageValue() 173 */ 174 public final String getMessageValue() 175 { 176 String messageValue2a = this.__messageValue2a; 177 if (!this.__messageValue2aSet) 178 { 179 // messageValue has no pre constraints 180 messageValue2a = handleGetMessageValue(); 181 // messageValue has no post constraints 182 this.__messageValue2a = messageValue2a; 183 if (isMetafacadePropertyCachingEnabled()) 184 { 185 this.__messageValue2aSet = true; 186 } 187 } 188 return messageValue2a; 189 } 190 191 /** 192 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd#isSafeNamePresent() 193 * @return boolean 194 */ 195 protected abstract boolean handleIsSafeNamePresent(); 196 197 private boolean __safeNamePresent3a; 198 private boolean __safeNamePresent3aSet = false; 199 200 /** 201 * True if this parameter has a name that can properly be handled by Jakarta commons (this lib 202 * is used by Struts but contains a bug) 203 * @return (boolean)handleIsSafeNamePresent() 204 */ 205 public final boolean isSafeNamePresent() 206 { 207 boolean safeNamePresent3a = this.__safeNamePresent3a; 208 if (!this.__safeNamePresent3aSet) 209 { 210 // safeNamePresent has no pre constraints 211 safeNamePresent3a = handleIsSafeNamePresent(); 212 // safeNamePresent has no post constraints 213 this.__safeNamePresent3a = safeNamePresent3a; 214 if (isMetafacadePropertyCachingEnabled()) 215 { 216 this.__safeNamePresent3aSet = true; 217 } 218 } 219 return safeNamePresent3a; 220 } 221 222 /** 223 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd#getOnlineHelpKey() 224 * @return String 225 */ 226 protected abstract String handleGetOnlineHelpKey(); 227 228 private String __onlineHelpKey4a; 229 private boolean __onlineHelpKey4aSet = false; 230 231 /** 232 * The key to lookup the online help documentation. This documentation is gathered from the 233 * documentation entered by the user, as well as analyzing the model. 234 * @return (String)handleGetOnlineHelpKey() 235 */ 236 public final String getOnlineHelpKey() 237 { 238 String onlineHelpKey4a = this.__onlineHelpKey4a; 239 if (!this.__onlineHelpKey4aSet) 240 { 241 // onlineHelpKey has no pre constraints 242 onlineHelpKey4a = handleGetOnlineHelpKey(); 243 // onlineHelpKey has no post constraints 244 this.__onlineHelpKey4a = onlineHelpKey4a; 245 if (isMetafacadePropertyCachingEnabled()) 246 { 247 this.__onlineHelpKey4aSet = true; 248 } 249 } 250 return onlineHelpKey4a; 251 } 252 253 /** 254 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAssociationEnd#getOnlineHelpValue() 255 * @return String 256 */ 257 protected abstract String handleGetOnlineHelpValue(); 258 259 private String __onlineHelpValue5a; 260 private boolean __onlineHelpValue5aSet = false; 261 262 /** 263 * The online help documentation. This documentation is gathered from the documentation entered 264 * by the user, as well as analyzing the model. The format is HTML without any style. 265 * @return (String)handleGetOnlineHelpValue() 266 */ 267 public final String getOnlineHelpValue() 268 { 269 String onlineHelpValue5a = this.__onlineHelpValue5a; 270 if (!this.__onlineHelpValue5aSet) 271 { 272 // onlineHelpValue has no pre constraints 273 onlineHelpValue5a = handleGetOnlineHelpValue(); 274 // onlineHelpValue has no post constraints 275 this.__onlineHelpValue5a = onlineHelpValue5a; 276 if (isMetafacadePropertyCachingEnabled()) 277 { 278 this.__onlineHelpValue5aSet = true; 279 } 280 } 281 return onlineHelpValue5a; 282 } 283 284 /** 285 * @return true 286 * @see ManageableEntityAssociationEnd 287 */ 288 public boolean isManageableEntityAssociationEndMetaType() 289 { 290 return true; 291 } 292 293 /** 294 * @return true 295 * @see org.andromda.metafacades.uml.EntityAssociationEnd 296 */ 297 public boolean isEntityAssociationEndMetaType() 298 { 299 return true; 300 } 301 302 /** 303 * @return true 304 * @see AssociationEndFacade 305 */ 306 public boolean isAssociationEndFacadeMetaType() 307 { 308 return true; 309 } 310 311 /** 312 * @return true 313 * @see ModelElementFacade 314 */ 315 public boolean isModelElementFacadeMetaType() 316 { 317 return true; 318 } 319 320 // ----------- delegates to ManageableEntityAssociationEnd ------------ 321 /** 322 * A name suitable for use when adding new elements to this association end in programming code. 323 * @see AssociationEndFacade#getAdderName() 324 */ 325 public String getAdderName() 326 { 327 return this.getSuperManageableEntityAssociationEnd().getAdderName(); 328 } 329 330 /** 331 * Returns the value of the 'Aggregation' attribute (none, shared, composite). The default value 332 * is "none". The literals are from the enumeration org.eclipse.uml2.uml.AggregationKind. 333 * Specifies the kind of aggregation that applies to the Property. 334 * @see AssociationEndFacade#getAggregationKind() 335 */ 336 public String getAggregationKind() 337 { 338 return this.getSuperManageableEntityAssociationEnd().getAggregationKind(); 339 } 340 341 /** 342 * The association owning this association end. 343 * @see AssociationEndFacade#getAssociation() 344 */ 345 public AssociationFacade getAssociation() 346 { 347 return this.getSuperManageableEntityAssociationEnd().getAssociation(); 348 } 349 350 /** 351 * UML2: Returns the value of the 'Default' attribute. Specifies a String that represents a 352 * value to be used when no argument is supplied for the Property. A String that is evaluated to 353 * give a default value for the Property when an object of the owning Classifier is 354 * instantiated. Can be something like: new ValueObject(values); 355 * @see AssociationEndFacade#getDefault() 356 */ 357 public String getDefault() 358 { 359 return this.getSuperManageableEntityAssociationEnd().getDefault(); 360 } 361 362 /** 363 * A name suitable for use when accessing this association end in programming code. 364 * @see AssociationEndFacade#getGetterName() 365 */ 366 public String getGetterName() 367 { 368 return this.getSuperManageableEntityAssociationEnd().getGetterName(); 369 } 370 371 /** 372 * The name of the type that is returned on the accessor and mutator operations, determined in 373 * part by the multiplicity. 374 * @see AssociationEndFacade#getGetterSetterTypeName() 375 */ 376 public String getGetterSetterTypeName() 377 { 378 return this.getSuperManageableEntityAssociationEnd().getGetterSetterTypeName(); 379 } 380 381 /** 382 * the lower value for the multiplicity 383 * -only applicable for UML2 384 * @see AssociationEndFacade#getLower() 385 */ 386 public int getLower() 387 { 388 return this.getSuperManageableEntityAssociationEnd().getLower(); 389 } 390 391 /** 392 * The other association end owned by this end's association. 393 * @see AssociationEndFacade#getOtherEnd() 394 */ 395 public AssociationEndFacade getOtherEnd() 396 { 397 return this.getSuperManageableEntityAssociationEnd().getOtherEnd(); 398 } 399 400 /** 401 * A name suitable for use when removing element from this association end in programming code. 402 * @see AssociationEndFacade#getRemoverName() 403 */ 404 public String getRemoverName() 405 { 406 return this.getSuperManageableEntityAssociationEnd().getRemoverName(); 407 } 408 409 /** 410 * A name suitable for use when accessing this association end in programming code. 411 * @see AssociationEndFacade#getSetterName() 412 */ 413 public String getSetterName() 414 { 415 return this.getSuperManageableEntityAssociationEnd().getSetterName(); 416 } 417 418 /** 419 * The classifier attached to this association end. 420 * @see AssociationEndFacade#getType() 421 */ 422 public ClassifierFacade getType() 423 { 424 return this.getSuperManageableEntityAssociationEnd().getType(); 425 } 426 427 /** 428 * the upper value for the multiplicity (will be -1 for *) 429 * -only applicable for UML2 430 * @see AssociationEndFacade#getUpper() 431 */ 432 public int getUpper() 433 { 434 return this.getSuperManageableEntityAssociationEnd().getUpper(); 435 } 436 437 /** 438 * True if this association end represents an aggregation relationship. 439 * @see AssociationEndFacade#isAggregation() 440 */ 441 public boolean isAggregation() 442 { 443 return this.getSuperManageableEntityAssociationEnd().isAggregation(); 444 } 445 446 /** 447 * Is true if update of one side of the association should also update the other side. false if 448 * not. 449 * @see AssociationEndFacade#isBidirectional() 450 */ 451 public boolean isBidirectional() 452 { 453 return this.getSuperManageableEntityAssociationEnd().isBidirectional(); 454 } 455 456 /** 457 * Returns whether or not (true/false) this association end is the child end of the assocation 458 * (i.e. the other end's aggregation is composition). 459 * @see AssociationEndFacade#isChild() 460 */ 461 public boolean isChild() 462 { 463 return this.getSuperManageableEntityAssociationEnd().isChild(); 464 } 465 466 /** 467 * True if this association end represents a composition relationship. 468 * @see AssociationEndFacade#isComposition() 469 */ 470 public boolean isComposition() 471 { 472 return this.getSuperManageableEntityAssociationEnd().isComposition(); 473 } 474 475 /** 476 * If the association end is derived (its value is computed). UML2 only. UML14 always returns 477 * false. Default=false. 478 * @see AssociationEndFacade#isDerived() 479 */ 480 public boolean isDerived() 481 { 482 return this.getSuperManageableEntityAssociationEnd().isDerived(); 483 } 484 485 /** 486 * IsLeaf property in the association end property. If true, attribute is final, cannot be 487 * extended or implemented by a descendant. Default=false. 488 * @see AssociationEndFacade#isLeaf() 489 */ 490 public boolean isLeaf() 491 { 492 return this.getSuperManageableEntityAssociationEnd().isLeaf(); 493 } 494 495 /** 496 * True if this association end's multiplicity is greater than one. 497 * @see AssociationEndFacade#isMany() 498 */ 499 public boolean isMany() 500 { 501 return this.getSuperManageableEntityAssociationEnd().isMany(); 502 } 503 504 /** 505 * True if this association end's and the other end's multiplicities are both many. 506 * @see AssociationEndFacade#isMany2Many() 507 */ 508 public boolean isMany2Many() 509 { 510 return this.getSuperManageableEntityAssociationEnd().isMany2Many(); 511 } 512 513 /** 514 * True if this association end's multiplicity is many while the other end's is one. 515 * @see AssociationEndFacade#isMany2One() 516 */ 517 public boolean isMany2One() 518 { 519 return this.getSuperManageableEntityAssociationEnd().isMany2One(); 520 } 521 522 /** 523 * True if it is possible to navigate from the other end to this association end . 524 * @see AssociationEndFacade#isNavigable() 525 */ 526 public boolean isNavigable() 527 { 528 return this.getSuperManageableEntityAssociationEnd().isNavigable(); 529 } 530 531 /** 532 * True if this association end's multiplicity is one while the other end's is many. 533 * @see AssociationEndFacade#isOne2Many() 534 */ 535 public boolean isOne2Many() 536 { 537 return this.getSuperManageableEntityAssociationEnd().isOne2Many(); 538 } 539 540 /** 541 * True if this association end's and the other end's multiplicities are both one. 542 * @see AssociationEndFacade#isOne2One() 543 */ 544 public boolean isOne2One() 545 { 546 return this.getSuperManageableEntityAssociationEnd().isOne2One(); 547 } 548 549 /** 550 * Indicates whether or not the association ends are ordered (if multiplicity is greater than 551 * 1). 552 * @see AssociationEndFacade#isOrdered() 553 */ 554 public boolean isOrdered() 555 { 556 return this.getSuperManageableEntityAssociationEnd().isOrdered(); 557 } 558 559 /** 560 * True if the association end cannot be changed. 561 * @see AssociationEndFacade#isReadOnly() 562 */ 563 public boolean isReadOnly() 564 { 565 return this.getSuperManageableEntityAssociationEnd().isReadOnly(); 566 } 567 568 /** 569 * True if this association end's multiplicity is strictly greater than zero. 570 * @see AssociationEndFacade#isRequired() 571 */ 572 public boolean isRequired() 573 { 574 return this.getSuperManageableEntityAssociationEnd().isRequired(); 575 } 576 577 /** 578 * Indicates if this associationEnd is 'static', meaning it has a classifier scope. 579 * @see AssociationEndFacade#isStatic() 580 */ 581 public boolean isStatic() 582 { 583 return this.getSuperManageableEntityAssociationEnd().isStatic(); 584 } 585 586 /** 587 * UML2: If the association attribute is unique within the Collection type. UML14 always returns 588 * false. Unique+Ordered determines the implementation Collection type. Default=false. 589 * @see AssociationEndFacade#isUnique() 590 */ 591 public boolean isUnique() 592 { 593 return this.getSuperManageableEntityAssociationEnd().isUnique(); 594 } 595 596 /** 597 * The name of the index to create on a column that persists the foreign key attribute. 598 * @see org.andromda.metafacades.uml.EntityAssociationEnd#getColumnIndex() 599 */ 600 public String getColumnIndex() 601 { 602 return this.getSuperManageableEntityAssociationEnd().getColumnIndex(); 603 } 604 605 /** 606 * The name of the column that makes up the foreign key. 607 * @see org.andromda.metafacades.uml.EntityAssociationEnd#getColumnName() 608 */ 609 public String getColumnName() 610 { 611 return this.getSuperManageableEntityAssociationEnd().getColumnName(); 612 } 613 614 /** 615 * The name of the foreign key constraint to use for databases. 616 * @see org.andromda.metafacades.uml.EntityAssociationEnd#getForeignKeyConstraintName() 617 */ 618 public String getForeignKeyConstraintName() 619 { 620 return this.getSuperManageableEntityAssociationEnd().getForeignKeyConstraintName(); 621 } 622 623 /** 624 * The current foreign key suffix specified for this entity association end facade. 625 * @see org.andromda.metafacades.uml.EntityAssociationEnd#getForeignKeySuffix() 626 */ 627 public String getForeignKeySuffix() 628 { 629 return this.getSuperManageableEntityAssociationEnd().getForeignKeySuffix(); 630 } 631 632 /** 633 * The SQL type for this the foreign key column of this association end. 634 * @see org.andromda.metafacades.uml.EntityAssociationEnd#getSqlType() 635 */ 636 public String getSqlType() 637 { 638 return this.getSuperManageableEntityAssociationEnd().getSqlType(); 639 } 640 641 /** 642 * The name of the unique-key that this unique association end belongs 643 * @see org.andromda.metafacades.uml.EntityAssociationEnd#getUniqueGroup() 644 */ 645 public String getUniqueGroup() 646 { 647 return this.getSuperManageableEntityAssociationEnd().getUniqueGroup(); 648 } 649 650 /** 651 * Indicates whether or not a foreign identifier should be used for the entity that owns this 652 * association end. This would only make sense in the case of a child in a one-to-one 653 * parent-child association. If this flag is true, then the identifier of this entity should 654 * also be used as the foreign key to the related parent entity. 655 * @see org.andromda.metafacades.uml.EntityAssociationEnd#isForeignIdentifier() 656 */ 657 public boolean isForeignIdentifier() 658 { 659 return this.getSuperManageableEntityAssociationEnd().isForeignIdentifier(); 660 } 661 662 /** 663 * True if this association is an identifier for its entity. 664 * @see org.andromda.metafacades.uml.EntityAssociationEnd#isIdentifier() 665 */ 666 public boolean isIdentifier() 667 { 668 return this.getSuperManageableEntityAssociationEnd().isIdentifier(); 669 } 670 671 /** 672 * True if the associationEnd is marked with identifiers stereotype, false otherwise. 673 * @see org.andromda.metafacades.uml.EntityAssociationEnd#isIdentifiersPresent() 674 */ 675 public boolean isIdentifiersPresent() 676 { 677 return this.getSuperManageableEntityAssociationEnd().isIdentifiersPresent(); 678 } 679 680 /** 681 * Indicates this association end should be ignored by the persistence layer. 682 * @see org.andromda.metafacades.uml.EntityAssociationEnd#isTransient() 683 */ 684 public boolean isTransient() 685 { 686 return this.getSuperManageableEntityAssociationEnd().isTransient(); 687 } 688 689 /** 690 * Represents an attribute of an entity. 691 * @see ManageableEntityAssociationEnd#getManageableIdentifier() 692 */ 693 public EntityAttribute getManageableIdentifier() 694 { 695 return this.getSuperManageableEntityAssociationEnd().getManageableIdentifier(); 696 } 697 698 /** 699 * Whether or not this association end should be displayed. 700 * @see ManageableEntityAssociationEnd#isDisplay() 701 */ 702 public boolean isDisplay() 703 { 704 return this.getSuperManageableEntityAssociationEnd().isDisplay(); 705 } 706 707 /** 708 * Copies all tagged values from the given ModelElementFacade to this model element facade. 709 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element) 710 */ 711 public void copyTaggedValues(ModelElementFacade element) 712 { 713 this.getSuperManageableEntityAssociationEnd().copyTaggedValues(element); 714 } 715 716 /** 717 * Finds the tagged value with the specified 'tagName'. In case there are more values the first 718 * one found will be returned. 719 * @see ModelElementFacade#findTaggedValue(String tagName) 720 */ 721 public Object findTaggedValue(String tagName) 722 { 723 return this.getSuperManageableEntityAssociationEnd().findTaggedValue(tagName); 724 } 725 726 /** 727 * Returns all the values for the tagged value with the specified name. The returned collection 728 * will contains only String instances, or will be empty. Never null. 729 * @see ModelElementFacade#findTaggedValues(String tagName) 730 */ 731 public Collection<Object> findTaggedValues(String tagName) 732 { 733 return this.getSuperManageableEntityAssociationEnd().findTaggedValues(tagName); 734 } 735 736 /** 737 * Returns the fully qualified name of the model element. The fully qualified name includes 738 * complete package qualified name of the underlying model element. The templates parameter will 739 * be replaced by the correct one given the binding relation of the parameter to this element. 740 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement) 741 */ 742 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement) 743 { 744 return this.getSuperManageableEntityAssociationEnd().getBindedFullyQualifiedName(bindedElement); 745 } 746 747 /** 748 * Gets all constraints belonging to the model element. 749 * @see ModelElementFacade#getConstraints() 750 */ 751 public Collection<ConstraintFacade> getConstraints() 752 { 753 return this.getSuperManageableEntityAssociationEnd().getConstraints(); 754 } 755 756 /** 757 * Returns the constraints of the argument kind that have been placed onto this model. Typical 758 * kinds are "inv", "pre" and "post". Other kinds are possible. 759 * @see ModelElementFacade#getConstraints(String kind) 760 */ 761 public Collection<ConstraintFacade> getConstraints(String kind) 762 { 763 return this.getSuperManageableEntityAssociationEnd().getConstraints(kind); 764 } 765 766 /** 767 * Gets the documentation for the model element, The indent argument is prefixed to each line. 768 * By default this method wraps lines after 64 characters. 769 * This method is equivalent to <code>getDocumentation(indent, 64)</code>. 770 * @see ModelElementFacade#getDocumentation(String indent) 771 */ 772 public String getDocumentation(String indent) 773 { 774 return this.getSuperManageableEntityAssociationEnd().getDocumentation(indent); 775 } 776 777 /** 778 * This method returns the documentation for this model element, with the lines wrapped after 779 * the specified number of characters, values of less than 1 will indicate no line wrapping is 780 * required. By default paragraphs are returned as HTML. 781 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>. 782 * @see ModelElementFacade#getDocumentation(String indent, int lineLength) 783 */ 784 public String getDocumentation(String indent, int lineLength) 785 { 786 return this.getSuperManageableEntityAssociationEnd().getDocumentation(indent, lineLength); 787 } 788 789 /** 790 * This method returns the documentation for this model element, with the lines wrapped after 791 * the specified number of characters, values of less than 1 will indicate no line wrapping is 792 * required. HTML style determines if HTML Escaping is applied. 793 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle) 794 */ 795 public String getDocumentation(String indent, int lineLength, boolean htmlStyle) 796 { 797 return this.getSuperManageableEntityAssociationEnd().getDocumentation(indent, lineLength, htmlStyle); 798 } 799 800 /** 801 * The fully qualified name of this model element. 802 * @see ModelElementFacade#getFullyQualifiedName() 803 */ 804 public String getFullyQualifiedName() 805 { 806 return this.getSuperManageableEntityAssociationEnd().getFullyQualifiedName(); 807 } 808 809 /** 810 * Returns the fully qualified name of the model element. The fully qualified name includes 811 * complete package qualified name of the underlying model element. If modelName is true, then 812 * the original name of the model element (the name contained within the model) will be the name 813 * returned, otherwise a name from a language mapping will be returned. 814 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName) 815 */ 816 public String getFullyQualifiedName(boolean modelName) 817 { 818 return this.getSuperManageableEntityAssociationEnd().getFullyQualifiedName(modelName); 819 } 820 821 /** 822 * Returns the fully qualified name as a path, the returned value always starts with out a slash 823 * '/'. 824 * @see ModelElementFacade#getFullyQualifiedNamePath() 825 */ 826 public String getFullyQualifiedNamePath() 827 { 828 return this.getSuperManageableEntityAssociationEnd().getFullyQualifiedNamePath(); 829 } 830 831 /** 832 * Gets the unique identifier of the underlying model element. 833 * @see ModelElementFacade#getId() 834 */ 835 public String getId() 836 { 837 return this.getSuperManageableEntityAssociationEnd().getId(); 838 } 839 840 /** 841 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which 842 * are not represented by other properties, i.e. native, transient, volatile, synchronized, 843 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings: 844 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require 845 * JDK5 compiler level. 846 * @see ModelElementFacade#getKeywords() 847 */ 848 public Collection<String> getKeywords() 849 { 850 return this.getSuperManageableEntityAssociationEnd().getKeywords(); 851 } 852 853 /** 854 * UML2: Retrieves a localized label for this named element. 855 * @see ModelElementFacade#getLabel() 856 */ 857 public String getLabel() 858 { 859 return this.getSuperManageableEntityAssociationEnd().getLabel(); 860 } 861 862 /** 863 * The language mappings that have been set for this model element. 864 * @see ModelElementFacade#getLanguageMappings() 865 */ 866 public TypeMappings getLanguageMappings() 867 { 868 return this.getSuperManageableEntityAssociationEnd().getLanguageMappings(); 869 } 870 871 /** 872 * Return the model containing this model element (multiple models may be loaded and processed 873 * at the same time). 874 * @see ModelElementFacade#getModel() 875 */ 876 public ModelFacade getModel() 877 { 878 return this.getSuperManageableEntityAssociationEnd().getModel(); 879 } 880 881 /** 882 * The name of the model element. 883 * @see ModelElementFacade#getName() 884 */ 885 public String getName() 886 { 887 return this.getSuperManageableEntityAssociationEnd().getName(); 888 } 889 890 /** 891 * Gets the package to which this model element belongs. 892 * @see ModelElementFacade#getPackage() 893 */ 894 public ModelElementFacade getPackage() 895 { 896 return this.getSuperManageableEntityAssociationEnd().getPackage(); 897 } 898 899 /** 900 * The name of this model element's package. 901 * @see ModelElementFacade#getPackageName() 902 */ 903 public String getPackageName() 904 { 905 return this.getSuperManageableEntityAssociationEnd().getPackageName(); 906 } 907 908 /** 909 * Gets the package name (optionally providing the ability to retrieve the model name and not 910 * the mapped name). 911 * @see ModelElementFacade#getPackageName(boolean modelName) 912 */ 913 public String getPackageName(boolean modelName) 914 { 915 return this.getSuperManageableEntityAssociationEnd().getPackageName(modelName); 916 } 917 918 /** 919 * Returns the package as a path, the returned value always starts with out a slash '/'. 920 * @see ModelElementFacade#getPackagePath() 921 */ 922 public String getPackagePath() 923 { 924 return this.getSuperManageableEntityAssociationEnd().getPackagePath(); 925 } 926 927 /** 928 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the 929 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from 930 * the names of the containing namespaces starting at the root of the hierarchy and ending with 931 * the name of the NamedElement itself. 932 * @see ModelElementFacade#getQualifiedName() 933 */ 934 public String getQualifiedName() 935 { 936 return this.getSuperManageableEntityAssociationEnd().getQualifiedName(); 937 } 938 939 /** 940 * Gets the root package for the model element. 941 * @see ModelElementFacade#getRootPackage() 942 */ 943 public PackageFacade getRootPackage() 944 { 945 return this.getSuperManageableEntityAssociationEnd().getRootPackage(); 946 } 947 948 /** 949 * Gets the dependencies for which this model element is the source. 950 * @see ModelElementFacade#getSourceDependencies() 951 */ 952 public Collection<DependencyFacade> getSourceDependencies() 953 { 954 return this.getSuperManageableEntityAssociationEnd().getSourceDependencies(); 955 } 956 957 /** 958 * If this model element is the context of an activity graph, this represents that activity 959 * graph. 960 * @see ModelElementFacade#getStateMachineContext() 961 */ 962 public StateMachineFacade getStateMachineContext() 963 { 964 return this.getSuperManageableEntityAssociationEnd().getStateMachineContext(); 965 } 966 967 /** 968 * The collection of ALL stereotype names for this model element. 969 * @see ModelElementFacade#getStereotypeNames() 970 */ 971 public Collection<String> getStereotypeNames() 972 { 973 return this.getSuperManageableEntityAssociationEnd().getStereotypeNames(); 974 } 975 976 /** 977 * Gets all stereotypes for this model element. 978 * @see ModelElementFacade#getStereotypes() 979 */ 980 public Collection<StereotypeFacade> getStereotypes() 981 { 982 return this.getSuperManageableEntityAssociationEnd().getStereotypes(); 983 } 984 985 /** 986 * Return the TaggedValues associated with this model element, under all stereotypes. 987 * @see ModelElementFacade#getTaggedValues() 988 */ 989 public Collection<TaggedValueFacade> getTaggedValues() 990 { 991 return this.getSuperManageableEntityAssociationEnd().getTaggedValues(); 992 } 993 994 /** 995 * Gets the dependencies for which this model element is the target. 996 * @see ModelElementFacade#getTargetDependencies() 997 */ 998 public Collection<DependencyFacade> getTargetDependencies() 999 { 1000 return this.getSuperManageableEntityAssociationEnd().getTargetDependencies(); 1001 } 1002 1003 /** 1004 * Get the template parameter for this model element having the parameterName 1005 * @see ModelElementFacade#getTemplateParameter(String parameterName) 1006 */ 1007 public Object getTemplateParameter(String parameterName) 1008 { 1009 return this.getSuperManageableEntityAssociationEnd().getTemplateParameter(parameterName); 1010 } 1011 1012 /** 1013 * Get the template parameters for this model element 1014 * @see ModelElementFacade#getTemplateParameters() 1015 */ 1016 public Collection<TemplateParameterFacade> getTemplateParameters() 1017 { 1018 return this.getSuperManageableEntityAssociationEnd().getTemplateParameters(); 1019 } 1020 1021 /** 1022 * The visibility (i.e. public, private, protected or package) of the model element, will 1023 * attempt a lookup for these values in the language mappings (if any). 1024 * @see ModelElementFacade#getVisibility() 1025 */ 1026 public String getVisibility() 1027 { 1028 return this.getSuperManageableEntityAssociationEnd().getVisibility(); 1029 } 1030 1031 /** 1032 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance 1033 * is taken into account when searching for the stereotype), false otherwise. 1034 * @see ModelElementFacade#hasExactStereotype(String stereotypeName) 1035 */ 1036 public boolean hasExactStereotype(String stereotypeName) 1037 { 1038 return this.getSuperManageableEntityAssociationEnd().hasExactStereotype(stereotypeName); 1039 } 1040 1041 /** 1042 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, 1043 * pipe, semicolon, or << >> 1044 * @see ModelElementFacade#hasKeyword(String keywordName) 1045 */ 1046 public boolean hasKeyword(String keywordName) 1047 { 1048 return this.getSuperManageableEntityAssociationEnd().hasKeyword(keywordName); 1049 } 1050 1051 /** 1052 * Returns true if the model element has the specified stereotype. If the stereotype itself 1053 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if 1054 * one of the stereotype's ancestors has a matching name this method will return true, false 1055 * otherwise. 1056 * For example, if we have a certain stereotype called <<exception>> and a model element has a 1057 * stereotype called <<applicationException>> which extends <<exception>>, when calling this 1058 * method with 'stereotypeName' defined as 'exception' the method would return true since 1059 * <<applicationException>> inherits from <<exception>>. If you want to check if the model 1060 * element has the exact stereotype, then use the method 'hasExactStereotype' instead. 1061 * @see ModelElementFacade#hasStereotype(String stereotypeName) 1062 */ 1063 public boolean hasStereotype(String stereotypeName) 1064 { 1065 return this.getSuperManageableEntityAssociationEnd().hasStereotype(stereotypeName); 1066 } 1067 1068 /** 1069 * True if there are target dependencies from this element that are instances of BindingFacade. 1070 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies. 1071 * @see ModelElementFacade#isBindingDependenciesPresent() 1072 */ 1073 public boolean isBindingDependenciesPresent() 1074 { 1075 return this.getSuperManageableEntityAssociationEnd().isBindingDependenciesPresent(); 1076 } 1077 1078 /** 1079 * Indicates if any constraints are present on this model element. 1080 * @see ModelElementFacade#isConstraintsPresent() 1081 */ 1082 public boolean isConstraintsPresent() 1083 { 1084 return this.getSuperManageableEntityAssociationEnd().isConstraintsPresent(); 1085 } 1086 1087 /** 1088 * Indicates if any documentation is present on this model element. 1089 * @see ModelElementFacade#isDocumentationPresent() 1090 */ 1091 public boolean isDocumentationPresent() 1092 { 1093 return this.getSuperManageableEntityAssociationEnd().isDocumentationPresent(); 1094 } 1095 1096 /** 1097 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript. 1098 * @see ModelElementFacade#isReservedWord() 1099 */ 1100 public boolean isReservedWord() 1101 { 1102 return this.getSuperManageableEntityAssociationEnd().isReservedWord(); 1103 } 1104 1105 /** 1106 * True is there are template parameters on this model element. For UML2, applies to Class, 1107 * Operation, Property, and Parameter. 1108 * @see ModelElementFacade#isTemplateParametersPresent() 1109 */ 1110 public boolean isTemplateParametersPresent() 1111 { 1112 return this.getSuperManageableEntityAssociationEnd().isTemplateParametersPresent(); 1113 } 1114 1115 /** 1116 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++, 1117 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on 1118 * Enumerations and Interfaces, optionally applies on other model elements. 1119 * @see ModelElementFacade#isValidIdentifierName() 1120 */ 1121 public boolean isValidIdentifierName() 1122 { 1123 return this.getSuperManageableEntityAssociationEnd().isValidIdentifierName(); 1124 } 1125 1126 /** 1127 * Searches for the constraint with the specified 'name' on this model element, and if found 1128 * translates it using the specified 'translation' from a translation library discovered by the 1129 * framework. 1130 * @see ModelElementFacade#translateConstraint(String name, String translation) 1131 */ 1132 public String translateConstraint(String name, String translation) 1133 { 1134 return this.getSuperManageableEntityAssociationEnd().translateConstraint(name, translation); 1135 } 1136 1137 /** 1138 * Translates all constraints belonging to this model element with the given 'translation'. 1139 * @see ModelElementFacade#translateConstraints(String translation) 1140 */ 1141 public String[] translateConstraints(String translation) 1142 { 1143 return this.getSuperManageableEntityAssociationEnd().translateConstraints(translation); 1144 } 1145 1146 /** 1147 * Translates the constraints of the specified 'kind' belonging to this model element. 1148 * @see ModelElementFacade#translateConstraints(String kind, String translation) 1149 */ 1150 public String[] translateConstraints(String kind, String translation) 1151 { 1152 return this.getSuperManageableEntityAssociationEnd().translateConstraints(kind, translation); 1153 } 1154 1155 /** 1156 * @see MetafacadeBase#initialize() 1157 */ 1158 @Override 1159 public void initialize() 1160 { 1161 this.getSuperManageableEntityAssociationEnd().initialize(); 1162 } 1163 1164 /** 1165 * @return Object getSuperManageableEntityAssociationEnd().getValidationOwner() 1166 * @see MetafacadeBase#getValidationOwner() 1167 */ 1168 @Override 1169 public Object getValidationOwner() 1170 { 1171 Object owner = this.getSuperManageableEntityAssociationEnd().getValidationOwner(); 1172 return owner; 1173 } 1174 1175 /** 1176 * @return String getSuperManageableEntityAssociationEnd().getValidationName() 1177 * @see MetafacadeBase#getValidationName() 1178 */ 1179 @Override 1180 public String getValidationName() 1181 { 1182 String name = this.getSuperManageableEntityAssociationEnd().getValidationName(); 1183 return name; 1184 } 1185 1186 /** 1187 * <p><b>Constraint:</b> org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::SAFE NAME - TO BE REMOVED LATER</p> 1188 * <p><b>Error:</b> The names you give to fields cannot start with a lowercase character directly followed by a character in uppercase. This is due to a bug in the Jakarta commons library which is used by Struts. The behavior of that library is inconsistent with the reflection API provided by the JDK. Please rename this field or you'll get exceptions when running your web application.</p> 1189 * <p><b>OCL:</b> context StrutsAttribute inv: safeNamePresent</p> 1190 * @param validationMessages Collection<ModelValidationMessage> 1191 * @see MetafacadeBase#validateInvariants(Collection validationMessages) 1192 */ 1193 @Override 1194 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 1195 { 1196 this.getSuperManageableEntityAssociationEnd().validateInvariants(validationMessages); 1197 try 1198 { 1199 final Object contextElement = this.THIS(); 1200 boolean constraintValid = OCLResultEnsurer.ensure(OCLIntrospector.invoke(contextElement,"safeNamePresent")); 1201 if (!constraintValid) 1202 { 1203 validationMessages.add( 1204 new ModelValidationMessage( 1205 (MetafacadeBase)contextElement , 1206 "org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::SAFE NAME - TO BE REMOVED LATER", 1207 "The names you give to fields cannot start with a lowercase character directly followed by a character in uppercase. This is due to a bug in the Jakarta commons library which is used by Struts. The behavior of that library is inconsistent with the reflection API provided by the JDK. Please rename this field or you'll get exceptions when running your web application.")); 1208 } 1209 } 1210 catch (Throwable th) 1211 { 1212 Throwable cause = th.getCause(); 1213 int depth = 0; // Some throwables have infinite recursion 1214 while (cause != null && depth < 7) 1215 { 1216 th = cause; 1217 depth++; 1218 } 1219 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::SAFE NAME - TO BE REMOVED LATER' ON " 1220 + this.THIS().toString() + ": " + th.getMessage(), th); 1221 } 1222 } 1223 1224 /** 1225 * The property that stores the name of the metafacade. 1226 */ 1227 private static final String NAME_PROPERTY = "name"; 1228 private static final String FQNAME_PROPERTY = "fullyQualifiedName"; 1229 1230 /** 1231 * @see Object#toString() 1232 */ 1233 @Override 1234 public String toString() 1235 { 1236 final StringBuilder toString = new StringBuilder(this.getClass().getName()); 1237 toString.append("["); 1238 try 1239 { 1240 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY)); 1241 } 1242 catch (final Throwable tryAgain) 1243 { 1244 try 1245 { 1246 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY)); 1247 } 1248 catch (final Throwable ignore) 1249 { 1250 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property 1251 } 1252 } 1253 toString.append("]"); 1254 return toString.toString(); 1255 } 1256}