001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.cartridges.spring.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.ConstraintFacade; 013import org.andromda.metafacades.uml.DependencyFacade; 014import org.andromda.metafacades.uml.ModelElementFacade; 015import org.andromda.metafacades.uml.ModelFacade; 016import org.andromda.metafacades.uml.PackageFacade; 017import org.andromda.metafacades.uml.StateMachineFacade; 018import org.andromda.metafacades.uml.StereotypeFacade; 019import org.andromda.metafacades.uml.TaggedValueFacade; 020import org.andromda.metafacades.uml.TemplateParameterFacade; 021import org.andromda.metafacades.uml.TypeMappings; 022 023/** 024 * Represents a dependency between spring objects. 025 * MetafacadeLogic for SpringDependency 026 * 027 * @see SpringDependency 028 */ 029public abstract class SpringDependencyLogic 030 extends MetafacadeBase 031 implements SpringDependency 032{ 033 /** 034 * The underlying UML object 035 * @see Object 036 */ 037 protected Object metaObject; 038 039 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 040 * @param metaObjectIn 041 * @param context 042 */ 043 protected SpringDependencyLogic(Object metaObjectIn, String context) 044 { 045 super(metaObjectIn, getContext(context)); 046 this.superDependencyFacade = 047 (DependencyFacade) 048 MetafacadeFactory.getInstance().createFacadeImpl( 049 "org.andromda.metafacades.uml.DependencyFacade", 050 metaObjectIn, 051 getContext(context)); 052 this.metaObject = metaObjectIn; 053 } 054 055 /** 056 * Gets the context for this metafacade logic instance. 057 * @param context String. Set to SpringDependency if null 058 * @return context String 059 */ 060 private static String getContext(String context) 061 { 062 if (context == null) 063 { 064 context = "org.andromda.cartridges.spring.metafacades.SpringDependency"; 065 } 066 return context; 067 } 068 069 private DependencyFacade superDependencyFacade; 070 private boolean superDependencyFacadeInitialized = false; 071 072 /** 073 * Gets the DependencyFacade parent instance. 074 * @return this.superDependencyFacade DependencyFacade 075 */ 076 private DependencyFacade getSuperDependencyFacade() 077 { 078 if (!this.superDependencyFacadeInitialized) 079 { 080 ((MetafacadeBase)this.superDependencyFacade).setMetafacadeContext(this.getMetafacadeContext()); 081 this.superDependencyFacadeInitialized = true; 082 } 083 return this.superDependencyFacade; 084 } 085 086 /** Reset context only for non-root metafacades 087 * @param context 088 * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context) 089 */ 090 @Override 091 public void resetMetafacadeContext(String context) 092 { 093 if (!this.contextRoot) // reset context only for non-root metafacades 094 { 095 context = getContext(context); // to have same value as in original constructor call 096 setMetafacadeContext (context); 097 if (this.superDependencyFacadeInitialized) 098 { 099 ((MetafacadeBase)this.superDependencyFacade).resetMetafacadeContext(context); 100 } 101 } 102 } 103 104 /** 105 * @return boolean true always 106 * @see SpringDependency 107 */ 108 public boolean isSpringDependencyMetaType() 109 { 110 return true; 111 } 112 113 // --------------- attributes --------------------- 114 115 /** 116 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getTransformationConstantName() 117 * @return String 118 */ 119 protected abstract String handleGetTransformationConstantName(); 120 121 private String __transformationConstantName1a; 122 private boolean __transformationConstantName1aSet = false; 123 124 /** 125 * The name of the constant designated for use as a transformation flag for value objects (only 126 * makes sense when this dependency goes into a value object). 127 * @return (String)handleGetTransformationConstantName() 128 */ 129 public final String getTransformationConstantName() 130 { 131 String transformationConstantName1a = this.__transformationConstantName1a; 132 if (!this.__transformationConstantName1aSet) 133 { 134 // transformationConstantName has no pre constraints 135 transformationConstantName1a = handleGetTransformationConstantName(); 136 // transformationConstantName has no post constraints 137 this.__transformationConstantName1a = transformationConstantName1a; 138 if (isMetafacadePropertyCachingEnabled()) 139 { 140 this.__transformationConstantName1aSet = true; 141 } 142 } 143 return transformationConstantName1a; 144 } 145 146 /** 147 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getTransformationMethodName() 148 * @return String 149 */ 150 protected abstract String handleGetTransformationMethodName(); 151 152 private String __transformationMethodName2a; 153 private boolean __transformationMethodName2aSet = false; 154 155 /** 156 * The name of the method use for transformation into a value object (only makes sense when this 157 * dependency goes into a value object). 158 * @return (String)handleGetTransformationMethodName() 159 */ 160 public final String getTransformationMethodName() 161 { 162 String transformationMethodName2a = this.__transformationMethodName2a; 163 if (!this.__transformationMethodName2aSet) 164 { 165 // transformationMethodName has no pre constraints 166 transformationMethodName2a = handleGetTransformationMethodName(); 167 // transformationMethodName has no post constraints 168 this.__transformationMethodName2a = transformationMethodName2a; 169 if (isMetafacadePropertyCachingEnabled()) 170 { 171 this.__transformationMethodName2aSet = true; 172 } 173 } 174 return transformationMethodName2a; 175 } 176 177 /** 178 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getTransformationAnonymousName() 179 * @return String 180 */ 181 protected abstract String handleGetTransformationAnonymousName(); 182 183 private String __transformationAnonymousName3a; 184 private boolean __transformationAnonymousName3aSet = false; 185 186 /** 187 * TODO: Model Documentation for 188 * org.andromda.cartridges.spring.metafacades.SpringDependency.transformationAnonymousName 189 * @return (String)handleGetTransformationAnonymousName() 190 */ 191 public final String getTransformationAnonymousName() 192 { 193 String transformationAnonymousName3a = this.__transformationAnonymousName3a; 194 if (!this.__transformationAnonymousName3aSet) 195 { 196 // transformationAnonymousName has no pre constraints 197 transformationAnonymousName3a = handleGetTransformationAnonymousName(); 198 // transformationAnonymousName has no post constraints 199 this.__transformationAnonymousName3a = transformationAnonymousName3a; 200 if (isMetafacadePropertyCachingEnabled()) 201 { 202 this.__transformationAnonymousName3aSet = true; 203 } 204 } 205 return transformationAnonymousName3a; 206 } 207 208 /** 209 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#isCircularReference() 210 * @return boolean 211 */ 212 protected abstract boolean handleIsCircularReference(); 213 214 private boolean __circularReference4a; 215 private boolean __circularReference4aSet = false; 216 217 /** 218 * Indicates if this dependency is part of a circular reference (meaning that both entities 219 * reference each other). 220 * @return (boolean)handleIsCircularReference() 221 */ 222 public final boolean isCircularReference() 223 { 224 boolean circularReference4a = this.__circularReference4a; 225 if (!this.__circularReference4aSet) 226 { 227 // circularReference has no pre constraints 228 circularReference4a = handleIsCircularReference(); 229 // circularReference has no post constraints 230 this.__circularReference4a = circularReference4a; 231 if (isMetafacadePropertyCachingEnabled()) 232 { 233 this.__circularReference4aSet = true; 234 } 235 } 236 return circularReference4a; 237 } 238 239 /** 240 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getTransformationToCollectionMethodName() 241 * @return String 242 */ 243 protected abstract String handleGetTransformationToCollectionMethodName(); 244 245 private String __transformationToCollectionMethodName5a; 246 private boolean __transformationToCollectionMethodName5aSet = false; 247 248 /** 249 * Returns the name of the method for transforming the contents of a collection. 250 * @return (String)handleGetTransformationToCollectionMethodName() 251 */ 252 public final String getTransformationToCollectionMethodName() 253 { 254 String transformationToCollectionMethodName5a = this.__transformationToCollectionMethodName5a; 255 if (!this.__transformationToCollectionMethodName5aSet) 256 { 257 // transformationToCollectionMethodName has no pre constraints 258 transformationToCollectionMethodName5a = handleGetTransformationToCollectionMethodName(); 259 // transformationToCollectionMethodName has no post constraints 260 this.__transformationToCollectionMethodName5a = transformationToCollectionMethodName5a; 261 if (isMetafacadePropertyCachingEnabled()) 262 { 263 this.__transformationToCollectionMethodName5aSet = true; 264 } 265 } 266 return transformationToCollectionMethodName5a; 267 } 268 269 /** 270 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getDaoName() 271 * @return String 272 */ 273 protected abstract String handleGetDaoName(); 274 275 private String __daoName6a; 276 private boolean __daoName6aSet = false; 277 278 /** 279 * The name given to a DAO reference. 280 * @return (String)handleGetDaoName() 281 */ 282 public final String getDaoName() 283 { 284 String daoName6a = this.__daoName6a; 285 if (!this.__daoName6aSet) 286 { 287 // daoName has no pre constraints 288 daoName6a = handleGetDaoName(); 289 // daoName has no post constraints 290 this.__daoName6a = daoName6a; 291 if (isMetafacadePropertyCachingEnabled()) 292 { 293 this.__daoName6aSet = true; 294 } 295 } 296 return daoName6a; 297 } 298 299 /** 300 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getDaoGetterName() 301 * @return String 302 */ 303 protected abstract String handleGetDaoGetterName(); 304 305 private String __daoGetterName7a; 306 private boolean __daoGetterName7aSet = false; 307 308 /** 309 * The name of the DAO reference getter name. 310 * @return (String)handleGetDaoGetterName() 311 */ 312 public final String getDaoGetterName() 313 { 314 String daoGetterName7a = this.__daoGetterName7a; 315 if (!this.__daoGetterName7aSet) 316 { 317 // daoGetterName has no pre constraints 318 daoGetterName7a = handleGetDaoGetterName(); 319 // daoGetterName has no post constraints 320 this.__daoGetterName7a = daoGetterName7a; 321 if (isMetafacadePropertyCachingEnabled()) 322 { 323 this.__daoGetterName7aSet = true; 324 } 325 } 326 return daoGetterName7a; 327 } 328 329 /** 330 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getDaoSetterName() 331 * @return String 332 */ 333 protected abstract String handleGetDaoSetterName(); 334 335 private String __daoSetterName8a; 336 private boolean __daoSetterName8aSet = false; 337 338 /** 339 * The DAO reference setter's name. 340 * @return (String)handleGetDaoSetterName() 341 */ 342 public final String getDaoSetterName() 343 { 344 String daoSetterName8a = this.__daoSetterName8a; 345 if (!this.__daoSetterName8aSet) 346 { 347 // daoSetterName has no pre constraints 348 daoSetterName8a = handleGetDaoSetterName(); 349 // daoSetterName has no post constraints 350 this.__daoSetterName8a = daoSetterName8a; 351 if (isMetafacadePropertyCachingEnabled()) 352 { 353 this.__daoSetterName8aSet = true; 354 } 355 } 356 return daoSetterName8a; 357 } 358 359 /** 360 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getTransformationConstantValue() 361 * @return int 362 */ 363 protected abstract int handleGetTransformationConstantValue(); 364 365 private int __transformationConstantValue9a; 366 private boolean __transformationConstantValue9aSet = false; 367 368 /** 369 * Stores the transformation constrant name. 370 * @return (int)handleGetTransformationConstantValue() 371 */ 372 public final int getTransformationConstantValue() 373 { 374 int transformationConstantValue9a = this.__transformationConstantValue9a; 375 if (!this.__transformationConstantValue9aSet) 376 { 377 // transformationConstantValue has no pre constraints 378 transformationConstantValue9a = handleGetTransformationConstantValue(); 379 // transformationConstantValue has no post constraints 380 this.__transformationConstantValue9a = transformationConstantValue9a; 381 if (isMetafacadePropertyCachingEnabled()) 382 { 383 this.__transformationConstantValue9aSet = true; 384 } 385 } 386 return transformationConstantValue9a; 387 } 388 389 /** 390 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getTransformationToEntityCollectionMethodName() 391 * @return String 392 */ 393 protected abstract String handleGetTransformationToEntityCollectionMethodName(); 394 395 private String __transformationToEntityCollectionMethodName10a; 396 private boolean __transformationToEntityCollectionMethodName10aSet = false; 397 398 /** 399 * The method name that performs the value object collection to entity collection 400 * transformation. 401 * @return (String)handleGetTransformationToEntityCollectionMethodName() 402 */ 403 public final String getTransformationToEntityCollectionMethodName() 404 { 405 String transformationToEntityCollectionMethodName10a = this.__transformationToEntityCollectionMethodName10a; 406 if (!this.__transformationToEntityCollectionMethodName10aSet) 407 { 408 // transformationToEntityCollectionMethodName has no pre constraints 409 transformationToEntityCollectionMethodName10a = handleGetTransformationToEntityCollectionMethodName(); 410 // transformationToEntityCollectionMethodName has no post constraints 411 this.__transformationToEntityCollectionMethodName10a = transformationToEntityCollectionMethodName10a; 412 if (isMetafacadePropertyCachingEnabled()) 413 { 414 this.__transformationToEntityCollectionMethodName10aSet = true; 415 } 416 } 417 return transformationToEntityCollectionMethodName10a; 418 } 419 420 /** 421 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getTransformationToEntityMethodName() 422 * @return String 423 */ 424 protected abstract String handleGetTransformationToEntityMethodName(); 425 426 private String __transformationToEntityMethodName11a; 427 private boolean __transformationToEntityMethodName11aSet = false; 428 429 /** 430 * The name of the "to entity" transformation method name. 431 * @return (String)handleGetTransformationToEntityMethodName() 432 */ 433 public final String getTransformationToEntityMethodName() 434 { 435 String transformationToEntityMethodName11a = this.__transformationToEntityMethodName11a; 436 if (!this.__transformationToEntityMethodName11aSet) 437 { 438 // transformationToEntityMethodName has no pre constraints 439 transformationToEntityMethodName11a = handleGetTransformationToEntityMethodName(); 440 // transformationToEntityMethodName has no post constraints 441 this.__transformationToEntityMethodName11a = transformationToEntityMethodName11a; 442 if (isMetafacadePropertyCachingEnabled()) 443 { 444 this.__transformationToEntityMethodName11aSet = true; 445 } 446 } 447 return transformationToEntityMethodName11a; 448 } 449 450 /** 451 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getValueObjectToEntityTransformerName() 452 * @return String 453 */ 454 protected abstract String handleGetValueObjectToEntityTransformerName(); 455 456 private String __valueObjectToEntityTransformerName12a; 457 private boolean __valueObjectToEntityTransformerName12aSet = false; 458 459 /** 460 * The name of the class that performs the value object to entity transformation. 461 * @return (String)handleGetValueObjectToEntityTransformerName() 462 */ 463 public final String getValueObjectToEntityTransformerName() 464 { 465 String valueObjectToEntityTransformerName12a = this.__valueObjectToEntityTransformerName12a; 466 if (!this.__valueObjectToEntityTransformerName12aSet) 467 { 468 // valueObjectToEntityTransformerName has no pre constraints 469 valueObjectToEntityTransformerName12a = handleGetValueObjectToEntityTransformerName(); 470 // valueObjectToEntityTransformerName has no post constraints 471 this.__valueObjectToEntityTransformerName12a = valueObjectToEntityTransformerName12a; 472 if (isMetafacadePropertyCachingEnabled()) 473 { 474 this.__valueObjectToEntityTransformerName12aSet = true; 475 } 476 } 477 return valueObjectToEntityTransformerName12a; 478 } 479 480 /** 481 * @see org.andromda.cartridges.spring.metafacades.SpringDependency#getTransformationToArrayMethodName() 482 * @return String 483 */ 484 protected abstract String handleGetTransformationToArrayMethodName(); 485 486 private String __transformationToArrayMethodName13a; 487 private boolean __transformationToArrayMethodName13aSet = false; 488 489 /** 490 * Returns the name of the method for transforming the contents of a collection to an array. 491 * @return (String)handleGetTransformationToArrayMethodName() 492 */ 493 public final String getTransformationToArrayMethodName() 494 { 495 String transformationToArrayMethodName13a = this.__transformationToArrayMethodName13a; 496 if (!this.__transformationToArrayMethodName13aSet) 497 { 498 // transformationToArrayMethodName has no pre constraints 499 transformationToArrayMethodName13a = handleGetTransformationToArrayMethodName(); 500 // transformationToArrayMethodName has no post constraints 501 this.__transformationToArrayMethodName13a = transformationToArrayMethodName13a; 502 if (isMetafacadePropertyCachingEnabled()) 503 { 504 this.__transformationToArrayMethodName13aSet = true; 505 } 506 } 507 return transformationToArrayMethodName13a; 508 } 509 510 /** 511 * @return true 512 * @see DependencyFacade 513 */ 514 public boolean isDependencyFacadeMetaType() 515 { 516 return true; 517 } 518 519 /** 520 * @return true 521 * @see ModelElementFacade 522 */ 523 public boolean isModelElementFacadeMetaType() 524 { 525 return true; 526 } 527 528 // ----------- delegates to DependencyFacade ------------ 529 /** 530 * The "getter" name for this dependency. 531 * @see DependencyFacade#getGetterName() 532 */ 533 public String getGetterName() 534 { 535 return this.getSuperDependencyFacade().getGetterName(); 536 } 537 538 /** 539 * The "setter" name for this dependency. 540 * @see DependencyFacade#getSetterName() 541 */ 542 public String getSetterName() 543 { 544 return this.getSuperDependencyFacade().getSetterName(); 545 } 546 547 /** 548 * The source element of this dependency. 549 * @see DependencyFacade#getSourceElement() 550 */ 551 public ModelElementFacade getSourceElement() 552 { 553 return this.getSuperDependencyFacade().getSourceElement(); 554 } 555 556 /** 557 * Gets the element to which the dependencies belong. 558 * @see DependencyFacade#getTargetElement() 559 */ 560 public ModelElementFacade getTargetElement() 561 { 562 return this.getSuperDependencyFacade().getTargetElement(); 563 } 564 565 /** 566 * Copies all tagged values from the given ModelElementFacade to this model element facade. 567 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element) 568 */ 569 public void copyTaggedValues(ModelElementFacade element) 570 { 571 this.getSuperDependencyFacade().copyTaggedValues(element); 572 } 573 574 /** 575 * Finds the tagged value with the specified 'tagName'. In case there are more values the first 576 * one found will be returned. 577 * @see ModelElementFacade#findTaggedValue(String tagName) 578 */ 579 public Object findTaggedValue(String tagName) 580 { 581 return this.getSuperDependencyFacade().findTaggedValue(tagName); 582 } 583 584 /** 585 * Returns all the values for the tagged value with the specified name. The returned collection 586 * will contains only String instances, or will be empty. Never null. 587 * @see ModelElementFacade#findTaggedValues(String tagName) 588 */ 589 public Collection<Object> findTaggedValues(String tagName) 590 { 591 return this.getSuperDependencyFacade().findTaggedValues(tagName); 592 } 593 594 /** 595 * Returns the fully qualified name of the model element. The fully qualified name includes 596 * complete package qualified name of the underlying model element. The templates parameter will 597 * be replaced by the correct one given the binding relation of the parameter to this element. 598 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement) 599 */ 600 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement) 601 { 602 return this.getSuperDependencyFacade().getBindedFullyQualifiedName(bindedElement); 603 } 604 605 /** 606 * Gets all constraints belonging to the model element. 607 * @see ModelElementFacade#getConstraints() 608 */ 609 public Collection<ConstraintFacade> getConstraints() 610 { 611 return this.getSuperDependencyFacade().getConstraints(); 612 } 613 614 /** 615 * Returns the constraints of the argument kind that have been placed onto this model. Typical 616 * kinds are "inv", "pre" and "post". Other kinds are possible. 617 * @see ModelElementFacade#getConstraints(String kind) 618 */ 619 public Collection<ConstraintFacade> getConstraints(String kind) 620 { 621 return this.getSuperDependencyFacade().getConstraints(kind); 622 } 623 624 /** 625 * Gets the documentation for the model element, The indent argument is prefixed to each line. 626 * By default this method wraps lines after 64 characters. 627 * This method is equivalent to <code>getDocumentation(indent, 64)</code>. 628 * @see ModelElementFacade#getDocumentation(String indent) 629 */ 630 public String getDocumentation(String indent) 631 { 632 return this.getSuperDependencyFacade().getDocumentation(indent); 633 } 634 635 /** 636 * This method returns the documentation for this model element, with the lines wrapped after 637 * the specified number of characters, values of less than 1 will indicate no line wrapping is 638 * required. By default paragraphs are returned as HTML. 639 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>. 640 * @see ModelElementFacade#getDocumentation(String indent, int lineLength) 641 */ 642 public String getDocumentation(String indent, int lineLength) 643 { 644 return this.getSuperDependencyFacade().getDocumentation(indent, lineLength); 645 } 646 647 /** 648 * This method returns the documentation for this model element, with the lines wrapped after 649 * the specified number of characters, values of less than 1 will indicate no line wrapping is 650 * required. HTML style determines if HTML Escaping is applied. 651 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle) 652 */ 653 public String getDocumentation(String indent, int lineLength, boolean htmlStyle) 654 { 655 return this.getSuperDependencyFacade().getDocumentation(indent, lineLength, htmlStyle); 656 } 657 658 /** 659 * The fully qualified name of this model element. 660 * @see ModelElementFacade#getFullyQualifiedName() 661 */ 662 public String getFullyQualifiedName() 663 { 664 return this.getSuperDependencyFacade().getFullyQualifiedName(); 665 } 666 667 /** 668 * Returns the fully qualified name of the model element. The fully qualified name includes 669 * complete package qualified name of the underlying model element. If modelName is true, then 670 * the original name of the model element (the name contained within the model) will be the name 671 * returned, otherwise a name from a language mapping will be returned. 672 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName) 673 */ 674 public String getFullyQualifiedName(boolean modelName) 675 { 676 return this.getSuperDependencyFacade().getFullyQualifiedName(modelName); 677 } 678 679 /** 680 * Returns the fully qualified name as a path, the returned value always starts with out a slash 681 * '/'. 682 * @see ModelElementFacade#getFullyQualifiedNamePath() 683 */ 684 public String getFullyQualifiedNamePath() 685 { 686 return this.getSuperDependencyFacade().getFullyQualifiedNamePath(); 687 } 688 689 /** 690 * Gets the unique identifier of the underlying model element. 691 * @see ModelElementFacade#getId() 692 */ 693 public String getId() 694 { 695 return this.getSuperDependencyFacade().getId(); 696 } 697 698 /** 699 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which 700 * are not represented by other properties, i.e. native, transient, volatile, synchronized, 701 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings: 702 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require 703 * JDK5 compiler level. 704 * @see ModelElementFacade#getKeywords() 705 */ 706 public Collection<String> getKeywords() 707 { 708 return this.getSuperDependencyFacade().getKeywords(); 709 } 710 711 /** 712 * UML2: Retrieves a localized label for this named element. 713 * @see ModelElementFacade#getLabel() 714 */ 715 public String getLabel() 716 { 717 return this.getSuperDependencyFacade().getLabel(); 718 } 719 720 /** 721 * The language mappings that have been set for this model element. 722 * @see ModelElementFacade#getLanguageMappings() 723 */ 724 public TypeMappings getLanguageMappings() 725 { 726 return this.getSuperDependencyFacade().getLanguageMappings(); 727 } 728 729 /** 730 * Return the model containing this model element (multiple models may be loaded and processed 731 * at the same time). 732 * @see ModelElementFacade#getModel() 733 */ 734 public ModelFacade getModel() 735 { 736 return this.getSuperDependencyFacade().getModel(); 737 } 738 739 /** 740 * The name of the model element. 741 * @see ModelElementFacade#getName() 742 */ 743 public String getName() 744 { 745 return this.getSuperDependencyFacade().getName(); 746 } 747 748 /** 749 * Gets the package to which this model element belongs. 750 * @see ModelElementFacade#getPackage() 751 */ 752 public ModelElementFacade getPackage() 753 { 754 return this.getSuperDependencyFacade().getPackage(); 755 } 756 757 /** 758 * The name of this model element's package. 759 * @see ModelElementFacade#getPackageName() 760 */ 761 public String getPackageName() 762 { 763 return this.getSuperDependencyFacade().getPackageName(); 764 } 765 766 /** 767 * Gets the package name (optionally providing the ability to retrieve the model name and not 768 * the mapped name). 769 * @see ModelElementFacade#getPackageName(boolean modelName) 770 */ 771 public String getPackageName(boolean modelName) 772 { 773 return this.getSuperDependencyFacade().getPackageName(modelName); 774 } 775 776 /** 777 * Returns the package as a path, the returned value always starts with out a slash '/'. 778 * @see ModelElementFacade#getPackagePath() 779 */ 780 public String getPackagePath() 781 { 782 return this.getSuperDependencyFacade().getPackagePath(); 783 } 784 785 /** 786 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the 787 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from 788 * the names of the containing namespaces starting at the root of the hierarchy and ending with 789 * the name of the NamedElement itself. 790 * @see ModelElementFacade#getQualifiedName() 791 */ 792 public String getQualifiedName() 793 { 794 return this.getSuperDependencyFacade().getQualifiedName(); 795 } 796 797 /** 798 * Gets the root package for the model element. 799 * @see ModelElementFacade#getRootPackage() 800 */ 801 public PackageFacade getRootPackage() 802 { 803 return this.getSuperDependencyFacade().getRootPackage(); 804 } 805 806 /** 807 * Gets the dependencies for which this model element is the source. 808 * @see ModelElementFacade#getSourceDependencies() 809 */ 810 public Collection<DependencyFacade> getSourceDependencies() 811 { 812 return this.getSuperDependencyFacade().getSourceDependencies(); 813 } 814 815 /** 816 * If this model element is the context of an activity graph, this represents that activity 817 * graph. 818 * @see ModelElementFacade#getStateMachineContext() 819 */ 820 public StateMachineFacade getStateMachineContext() 821 { 822 return this.getSuperDependencyFacade().getStateMachineContext(); 823 } 824 825 /** 826 * The collection of ALL stereotype names for this model element. 827 * @see ModelElementFacade#getStereotypeNames() 828 */ 829 public Collection<String> getStereotypeNames() 830 { 831 return this.getSuperDependencyFacade().getStereotypeNames(); 832 } 833 834 /** 835 * Gets all stereotypes for this model element. 836 * @see ModelElementFacade#getStereotypes() 837 */ 838 public Collection<StereotypeFacade> getStereotypes() 839 { 840 return this.getSuperDependencyFacade().getStereotypes(); 841 } 842 843 /** 844 * Return the TaggedValues associated with this model element, under all stereotypes. 845 * @see ModelElementFacade#getTaggedValues() 846 */ 847 public Collection<TaggedValueFacade> getTaggedValues() 848 { 849 return this.getSuperDependencyFacade().getTaggedValues(); 850 } 851 852 /** 853 * Gets the dependencies for which this model element is the target. 854 * @see ModelElementFacade#getTargetDependencies() 855 */ 856 public Collection<DependencyFacade> getTargetDependencies() 857 { 858 return this.getSuperDependencyFacade().getTargetDependencies(); 859 } 860 861 /** 862 * Get the template parameter for this model element having the parameterName 863 * @see ModelElementFacade#getTemplateParameter(String parameterName) 864 */ 865 public Object getTemplateParameter(String parameterName) 866 { 867 return this.getSuperDependencyFacade().getTemplateParameter(parameterName); 868 } 869 870 /** 871 * Get the template parameters for this model element 872 * @see ModelElementFacade#getTemplateParameters() 873 */ 874 public Collection<TemplateParameterFacade> getTemplateParameters() 875 { 876 return this.getSuperDependencyFacade().getTemplateParameters(); 877 } 878 879 /** 880 * The visibility (i.e. public, private, protected or package) of the model element, will 881 * attempt a lookup for these values in the language mappings (if any). 882 * @see ModelElementFacade#getVisibility() 883 */ 884 public String getVisibility() 885 { 886 return this.getSuperDependencyFacade().getVisibility(); 887 } 888 889 /** 890 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance 891 * is taken into account when searching for the stereotype), false otherwise. 892 * @see ModelElementFacade#hasExactStereotype(String stereotypeName) 893 */ 894 public boolean hasExactStereotype(String stereotypeName) 895 { 896 return this.getSuperDependencyFacade().hasExactStereotype(stereotypeName); 897 } 898 899 /** 900 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, 901 * pipe, semicolon, or << >> 902 * @see ModelElementFacade#hasKeyword(String keywordName) 903 */ 904 public boolean hasKeyword(String keywordName) 905 { 906 return this.getSuperDependencyFacade().hasKeyword(keywordName); 907 } 908 909 /** 910 * Returns true if the model element has the specified stereotype. If the stereotype itself 911 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if 912 * one of the stereotype's ancestors has a matching name this method will return true, false 913 * otherwise. 914 * For example, if we have a certain stereotype called <<exception>> and a model element has a 915 * stereotype called <<applicationException>> which extends <<exception>>, when calling this 916 * method with 'stereotypeName' defined as 'exception' the method would return true since 917 * <<applicationException>> inherits from <<exception>>. If you want to check if the model 918 * element has the exact stereotype, then use the method 'hasExactStereotype' instead. 919 * @see ModelElementFacade#hasStereotype(String stereotypeName) 920 */ 921 public boolean hasStereotype(String stereotypeName) 922 { 923 return this.getSuperDependencyFacade().hasStereotype(stereotypeName); 924 } 925 926 /** 927 * True if there are target dependencies from this element that are instances of BindingFacade. 928 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies. 929 * @see ModelElementFacade#isBindingDependenciesPresent() 930 */ 931 public boolean isBindingDependenciesPresent() 932 { 933 return this.getSuperDependencyFacade().isBindingDependenciesPresent(); 934 } 935 936 /** 937 * Indicates if any constraints are present on this model element. 938 * @see ModelElementFacade#isConstraintsPresent() 939 */ 940 public boolean isConstraintsPresent() 941 { 942 return this.getSuperDependencyFacade().isConstraintsPresent(); 943 } 944 945 /** 946 * Indicates if any documentation is present on this model element. 947 * @see ModelElementFacade#isDocumentationPresent() 948 */ 949 public boolean isDocumentationPresent() 950 { 951 return this.getSuperDependencyFacade().isDocumentationPresent(); 952 } 953 954 /** 955 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript. 956 * @see ModelElementFacade#isReservedWord() 957 */ 958 public boolean isReservedWord() 959 { 960 return this.getSuperDependencyFacade().isReservedWord(); 961 } 962 963 /** 964 * True is there are template parameters on this model element. For UML2, applies to Class, 965 * Operation, Property, and Parameter. 966 * @see ModelElementFacade#isTemplateParametersPresent() 967 */ 968 public boolean isTemplateParametersPresent() 969 { 970 return this.getSuperDependencyFacade().isTemplateParametersPresent(); 971 } 972 973 /** 974 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++, 975 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on 976 * Enumerations and Interfaces, optionally applies on other model elements. 977 * @see ModelElementFacade#isValidIdentifierName() 978 */ 979 public boolean isValidIdentifierName() 980 { 981 return this.getSuperDependencyFacade().isValidIdentifierName(); 982 } 983 984 /** 985 * Searches for the constraint with the specified 'name' on this model element, and if found 986 * translates it using the specified 'translation' from a translation library discovered by the 987 * framework. 988 * @see ModelElementFacade#translateConstraint(String name, String translation) 989 */ 990 public String translateConstraint(String name, String translation) 991 { 992 return this.getSuperDependencyFacade().translateConstraint(name, translation); 993 } 994 995 /** 996 * Translates all constraints belonging to this model element with the given 'translation'. 997 * @see ModelElementFacade#translateConstraints(String translation) 998 */ 999 public String[] translateConstraints(String translation) 1000 { 1001 return this.getSuperDependencyFacade().translateConstraints(translation); 1002 } 1003 1004 /** 1005 * Translates the constraints of the specified 'kind' belonging to this model element. 1006 * @see ModelElementFacade#translateConstraints(String kind, String translation) 1007 */ 1008 public String[] translateConstraints(String kind, String translation) 1009 { 1010 return this.getSuperDependencyFacade().translateConstraints(kind, translation); 1011 } 1012 1013 /** 1014 * @see org.andromda.core.metafacade.MetafacadeBase#initialize() 1015 */ 1016 @Override 1017 public void initialize() 1018 { 1019 this.getSuperDependencyFacade().initialize(); 1020 } 1021 1022 /** 1023 * @return Object getSuperDependencyFacade().getValidationOwner() 1024 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner() 1025 */ 1026 @Override 1027 public Object getValidationOwner() 1028 { 1029 Object owner = this.getSuperDependencyFacade().getValidationOwner(); 1030 return owner; 1031 } 1032 1033 /** 1034 * @return String getSuperDependencyFacade().getValidationName() 1035 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName() 1036 */ 1037 @Override 1038 public String getValidationName() 1039 { 1040 String name = this.getSuperDependencyFacade().getValidationName(); 1041 return name; 1042 } 1043 1044 /** 1045 * @param validationMessages Collection<ModelValidationMessage> 1046 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages) 1047 */ 1048 @Override 1049 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 1050 { 1051 this.getSuperDependencyFacade().validateInvariants(validationMessages); 1052 } 1053 1054 /** 1055 * The property that stores the name of the metafacade. 1056 */ 1057 private static final String NAME_PROPERTY = "name"; 1058 private static final String FQNAME_PROPERTY = "fullyQualifiedName"; 1059 1060 /** 1061 * @see Object#toString() 1062 */ 1063 @Override 1064 public String toString() 1065 { 1066 final StringBuilder toString = new StringBuilder(this.getClass().getName()); 1067 toString.append("["); 1068 try 1069 { 1070 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY)); 1071 } 1072 catch (final Throwable tryAgain) 1073 { 1074 try 1075 { 1076 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY)); 1077 } 1078 catch (final Throwable ignore) 1079 { 1080 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property 1081 } 1082 } 1083 toString.append("]"); 1084 return toString.toString(); 1085 } 1086}