001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.cartridges.ejb3.metafacades; 006 007import java.util.Collection; 008import java.util.List; 009import org.andromda.core.common.Introspector; 010import org.andromda.core.metafacade.MetafacadeBase; 011import org.andromda.core.metafacade.MetafacadeFactory; 012import org.andromda.core.metafacade.ModelValidationMessage; 013import org.andromda.metafacades.uml.AssociationEndFacade; 014import org.andromda.metafacades.uml.AttributeFacade; 015import org.andromda.metafacades.uml.ClassifierFacade; 016import org.andromda.metafacades.uml.ConstraintFacade; 017import org.andromda.metafacades.uml.DependencyFacade; 018import org.andromda.metafacades.uml.EnumerationFacade; 019import org.andromda.metafacades.uml.GeneralizableElementFacade; 020import org.andromda.metafacades.uml.GeneralizationFacade; 021import org.andromda.metafacades.uml.ModelElementFacade; 022import org.andromda.metafacades.uml.ModelFacade; 023import org.andromda.metafacades.uml.OperationFacade; 024import org.andromda.metafacades.uml.PackageFacade; 025import org.andromda.metafacades.uml.StateMachineFacade; 026import org.andromda.metafacades.uml.StereotypeFacade; 027import org.andromda.metafacades.uml.TaggedValueFacade; 028import org.andromda.metafacades.uml.TemplateParameterFacade; 029import org.andromda.metafacades.uml.TypeMappings; 030 031/** 032 * TODO: Model Documentation for org.andromda.cartridges.ejb3.metafacades.EJB3EnumerationFacade 033 * MetafacadeLogic for EJB3EnumerationFacade 034 * 035 * @see EJB3EnumerationFacade 036 */ 037public abstract class EJB3EnumerationFacadeLogic 038 extends MetafacadeBase 039 implements EJB3EnumerationFacade 040{ 041 /** 042 * The underlying UML object 043 * @see Object 044 */ 045 protected Object metaObject; 046 047 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 048 * @param metaObjectIn 049 * @param context 050 */ 051 protected EJB3EnumerationFacadeLogic(Object metaObjectIn, String context) 052 { 053 super(metaObjectIn, getContext(context)); 054 this.superEnumerationFacade = 055 (EnumerationFacade) 056 MetafacadeFactory.getInstance().createFacadeImpl( 057 "org.andromda.metafacades.uml.EnumerationFacade", 058 metaObjectIn, 059 getContext(context)); 060 this.metaObject = metaObjectIn; 061 } 062 063 /** 064 * Gets the context for this metafacade logic instance. 065 * @param context String. Set to EJB3EnumerationFacade if null 066 * @return context String 067 */ 068 private static String getContext(String context) 069 { 070 if (context == null) 071 { 072 context = "org.andromda.cartridges.ejb3.metafacades.EJB3EnumerationFacade"; 073 } 074 return context; 075 } 076 077 private EnumerationFacade superEnumerationFacade; 078 private boolean superEnumerationFacadeInitialized = false; 079 080 /** 081 * Gets the EnumerationFacade parent instance. 082 * @return this.superEnumerationFacade EnumerationFacade 083 */ 084 private EnumerationFacade getSuperEnumerationFacade() 085 { 086 if (!this.superEnumerationFacadeInitialized) 087 { 088 ((MetafacadeBase)this.superEnumerationFacade).setMetafacadeContext(this.getMetafacadeContext()); 089 this.superEnumerationFacadeInitialized = true; 090 } 091 return this.superEnumerationFacade; 092 } 093 094 /** Reset context only for non-root metafacades 095 * @param context 096 * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context) 097 */ 098 @Override 099 public void resetMetafacadeContext(String context) 100 { 101 if (!this.contextRoot) // reset context only for non-root metafacades 102 { 103 context = getContext(context); // to have same value as in original constructor call 104 setMetafacadeContext (context); 105 if (this.superEnumerationFacadeInitialized) 106 { 107 ((MetafacadeBase)this.superEnumerationFacade).resetMetafacadeContext(context); 108 } 109 } 110 } 111 112 /** 113 * @return boolean true always 114 * @see EJB3EnumerationFacade 115 */ 116 public boolean isEJB3EnumerationFacadeMetaType() 117 { 118 return true; 119 } 120 121 // ---------------- business methods ---------------------- 122 123 /** 124 * Method to be implemented in descendants 125 * Create a comma separated list of member variables. This method can be used to generate 126 * argument lists for constructors, method calls etc. 127 * @param variables 128 * @param includeTypes 129 * @param includeNames 130 * @return String 131 */ 132 protected abstract String handleGetMemberVariablesAsList(Collection variables, boolean includeTypes, boolean includeNames); 133 134 /** 135 * Create a comma separated list of member variables. This method can be used to generate 136 * argument lists for constructors, method calls etc. 137 * @param variables Collection 138 * a collection of {@link Attribute} objects 139 * @param includeTypes boolean 140 * If <code>true</code> the type names of the attributes are included. 141 * @param includeNames boolean 142 * If <code>true</code> the attribute names are included. 143 * @return handleGetMemberVariablesAsList(variables, includeTypes, includeNames) 144 */ 145 public String getMemberVariablesAsList(Collection variables, boolean includeTypes, boolean includeNames) 146 { 147 // getMemberVariablesAsList has no pre constraints 148 String returnValue = handleGetMemberVariablesAsList(variables, includeTypes, includeNames); 149 // getMemberVariablesAsList has no post constraints 150 return returnValue; 151 } 152 153 /** 154 * @return true 155 * @see EnumerationFacade 156 */ 157 public boolean isEnumerationFacadeMetaType() 158 { 159 return true; 160 } 161 162 /** 163 * @return true 164 * @see ClassifierFacade 165 */ 166 public boolean isClassifierFacadeMetaType() 167 { 168 return true; 169 } 170 171 /** 172 * @return true 173 * @see GeneralizableElementFacade 174 */ 175 public boolean isGeneralizableElementFacadeMetaType() 176 { 177 return true; 178 } 179 180 /** 181 * @return true 182 * @see ModelElementFacade 183 */ 184 public boolean isModelElementFacadeMetaType() 185 { 186 return true; 187 } 188 189 // ----------- delegates to EnumerationFacade ------------ 190 /** 191 * Return the attribute which name matches the parameter 192 * @see ClassifierFacade#findAttribute(String name) 193 */ 194 public AttributeFacade findAttribute(String name) 195 { 196 return this.getSuperEnumerationFacade().findAttribute(name); 197 } 198 199 /** 200 * Those abstraction dependencies for which this classifier is the client. 201 * @see ClassifierFacade#getAbstractions() 202 */ 203 public Collection<ClassifierFacade> getAbstractions() 204 { 205 return this.getSuperEnumerationFacade().getAbstractions(); 206 } 207 208 /** 209 * Lists all classes associated to this one and any ancestor classes (through generalization). 210 * There will be no duplicates. The order of the elements is predictable. 211 * @see ClassifierFacade#getAllAssociatedClasses() 212 */ 213 public Collection<ClassifierFacade> getAllAssociatedClasses() 214 { 215 return this.getSuperEnumerationFacade().getAllAssociatedClasses(); 216 } 217 218 /** 219 * A collection containing all 'properties' of the classifier and its ancestors. Properties are 220 * any attributes and navigable connecting association ends. 221 * @see ClassifierFacade#getAllProperties() 222 */ 223 public Collection<ModelElementFacade> getAllProperties() 224 { 225 return this.getSuperEnumerationFacade().getAllProperties(); 226 } 227 228 /** 229 * A collection containing all required and/or read-only 'properties' of the classifier and its 230 * ancestors. Properties are any attributes and navigable connecting association ends. 231 * @see ClassifierFacade#getAllRequiredConstructorParameters() 232 */ 233 public Collection<ModelElementFacade> getAllRequiredConstructorParameters() 234 { 235 return this.getSuperEnumerationFacade().getAllRequiredConstructorParameters(); 236 } 237 238 /** 239 * Gets the array type for this classifier. If this classifier already represents an array, it 240 * just returns itself. 241 * @see ClassifierFacade#getArray() 242 */ 243 public ClassifierFacade getArray() 244 { 245 return this.getSuperEnumerationFacade().getArray(); 246 } 247 248 /** 249 * The name of the classifier as an array. 250 * @see ClassifierFacade#getArrayName() 251 */ 252 public String getArrayName() 253 { 254 return this.getSuperEnumerationFacade().getArrayName(); 255 } 256 257 /** 258 * Lists the classes associated to this one, there is no repitition of classes. The order of the 259 * elements is predictable. 260 * @see ClassifierFacade#getAssociatedClasses() 261 */ 262 public Collection<ClassifierFacade> getAssociatedClasses() 263 { 264 return this.getSuperEnumerationFacade().getAssociatedClasses(); 265 } 266 267 /** 268 * Gets the association ends belonging to a classifier. 269 * @see ClassifierFacade#getAssociationEnds() 270 */ 271 public List<AssociationEndFacade> getAssociationEnds() 272 { 273 return this.getSuperEnumerationFacade().getAssociationEnds(); 274 } 275 276 /** 277 * Gets the attributes that belong to the classifier. 278 * @see ClassifierFacade#getAttributes() 279 */ 280 public List<AttributeFacade> getAttributes() 281 { 282 return this.getSuperEnumerationFacade().getAttributes(); 283 } 284 285 /** 286 * Gets all attributes for the classifier and if 'follow' is true goes up the inheritance 287 * hierarchy and gets the attributes from the super classes as well. 288 * @see ClassifierFacade#getAttributes(boolean follow) 289 */ 290 public List<AttributeFacade> getAttributes(boolean follow) 291 { 292 return this.getSuperEnumerationFacade().getAttributes(follow); 293 } 294 295 /** 296 * The fully qualified name of the classifier as an array. 297 * @see ClassifierFacade#getFullyQualifiedArrayName() 298 */ 299 public String getFullyQualifiedArrayName() 300 { 301 return this.getSuperEnumerationFacade().getFullyQualifiedArrayName(); 302 } 303 304 /** 305 * Returns all those operations that could be implemented at this classifier's level. This means 306 * the operations owned by this classifier as well as any realized interface's operations 307 * (recursively) in case this classifier itself is not already an interface, or generalized when 308 * this classifier is an interface. 309 * @see ClassifierFacade#getImplementationOperations() 310 */ 311 public Collection<OperationFacade> getImplementationOperations() 312 { 313 return this.getSuperEnumerationFacade().getImplementationOperations(); 314 } 315 316 /** 317 * A comma separated list of the fully qualified names of all implemented interfaces. 318 * @see ClassifierFacade#getImplementedInterfaceList() 319 */ 320 public String getImplementedInterfaceList() 321 { 322 return this.getSuperEnumerationFacade().getImplementedInterfaceList(); 323 } 324 325 /** 326 * Those attributes that are scoped to an instance of this class. 327 * @see ClassifierFacade#getInstanceAttributes() 328 */ 329 public Collection<AttributeFacade> getInstanceAttributes() 330 { 331 return this.getSuperEnumerationFacade().getInstanceAttributes(); 332 } 333 334 /** 335 * Those operations that are scoped to an instance of this class. 336 * @see ClassifierFacade#getInstanceOperations() 337 */ 338 public List<OperationFacade> getInstanceOperations() 339 { 340 return this.getSuperEnumerationFacade().getInstanceOperations(); 341 } 342 343 /** 344 * Those interfaces that are abstractions of this classifier, this basically means this 345 * classifier realizes them. 346 * @see ClassifierFacade#getInterfaceAbstractions() 347 */ 348 public Collection<ClassifierFacade> getInterfaceAbstractions() 349 { 350 return this.getSuperEnumerationFacade().getInterfaceAbstractions(); 351 } 352 353 /** 354 * A String representing a new Constructor declaration for this classifier type to be used in a 355 * Java environment. 356 * @see ClassifierFacade#getJavaNewString() 357 */ 358 public String getJavaNewString() 359 { 360 return this.getSuperEnumerationFacade().getJavaNewString(); 361 } 362 363 /** 364 * A String representing the null-value for this classifier type to be used in a Java 365 * environment. 366 * @see ClassifierFacade#getJavaNullString() 367 */ 368 public String getJavaNullString() 369 { 370 return this.getSuperEnumerationFacade().getJavaNullString(); 371 } 372 373 /** 374 * The other ends of this classifier's association ends which are navigable. 375 * @see ClassifierFacade#getNavigableConnectingEnds() 376 */ 377 public Collection<AssociationEndFacade> getNavigableConnectingEnds() 378 { 379 return this.getSuperEnumerationFacade().getNavigableConnectingEnds(); 380 } 381 382 /** 383 * Get the other ends of this classifier's association ends which are navigable and if 'follow' 384 * is true goes up the inheritance hierarchy and gets the super association ends as well. 385 * @see ClassifierFacade#getNavigableConnectingEnds(boolean follow) 386 */ 387 public List<AssociationEndFacade> getNavigableConnectingEnds(boolean follow) 388 { 389 return this.getSuperEnumerationFacade().getNavigableConnectingEnds(follow); 390 } 391 392 /** 393 * Assuming that the classifier is an array, this will return the non array type of the 394 * classifier from 395 * the model. If the classifier is NOT an array, it will just return itself. 396 * @see ClassifierFacade#getNonArray() 397 */ 398 public ClassifierFacade getNonArray() 399 { 400 return this.getSuperEnumerationFacade().getNonArray(); 401 } 402 403 /** 404 * The attributes from this classifier in the form of an operation call (this example would be 405 * in Java): '(String attributeOne, String attributeTwo). If there were no attributes on the 406 * classifier, the result would be an empty '()'. 407 * @see ClassifierFacade#getOperationCallFromAttributes() 408 */ 409 public String getOperationCallFromAttributes() 410 { 411 return this.getSuperEnumerationFacade().getOperationCallFromAttributes(); 412 } 413 414 /** 415 * The operations owned by this classifier. 416 * @see ClassifierFacade#getOperations() 417 */ 418 public List<OperationFacade> getOperations() 419 { 420 return this.getSuperEnumerationFacade().getOperations(); 421 } 422 423 /** 424 * A collection containing all 'properties' of the classifier. Properties are any attributes 425 * and navigable connecting association ends. 426 * @see ClassifierFacade#getProperties() 427 */ 428 public List<ModelElementFacade> getProperties() 429 { 430 return this.getSuperEnumerationFacade().getProperties(); 431 } 432 433 /** 434 * Gets all properties (attributes and navigable association ends) for the classifier and if 435 * 'follow' is true goes up the inheritance hierarchy and gets the properties from the super 436 * classes as well. 437 * @see ClassifierFacade#getProperties(boolean follow) 438 */ 439 public List getProperties(boolean follow) 440 { 441 return this.getSuperEnumerationFacade().getProperties(follow); 442 } 443 444 /** 445 * A collection containing all required and/or read-only 'properties' of the classifier. 446 * Properties are any attributes and navigable connecting association ends. 447 * @see ClassifierFacade#getRequiredConstructorParameters() 448 */ 449 public Collection<ModelElementFacade> getRequiredConstructorParameters() 450 { 451 return this.getSuperEnumerationFacade().getRequiredConstructorParameters(); 452 } 453 454 /** 455 * Returns the serial version UID of the underlying model element. 456 * @see ClassifierFacade#getSerialVersionUID() 457 */ 458 public long getSerialVersionUID() 459 { 460 return this.getSuperEnumerationFacade().getSerialVersionUID(); 461 } 462 463 /** 464 * Those attributes that are scoped to the definition of this class. 465 * @see ClassifierFacade#getStaticAttributes() 466 */ 467 public Collection<AttributeFacade> getStaticAttributes() 468 { 469 return this.getSuperEnumerationFacade().getStaticAttributes(); 470 } 471 472 /** 473 * Those operations that are scoped to the definition of this class. 474 * @see ClassifierFacade#getStaticOperations() 475 */ 476 public List<OperationFacade> getStaticOperations() 477 { 478 return this.getSuperEnumerationFacade().getStaticOperations(); 479 } 480 481 /** 482 * This class' superclass, returns the generalization if it is a ClassifierFacade, null 483 * otherwise. 484 * @see ClassifierFacade#getSuperClass() 485 */ 486 public ClassifierFacade getSuperClass() 487 { 488 return this.getSuperEnumerationFacade().getSuperClass(); 489 } 490 491 /** 492 * The wrapper name for this classifier if a mapped type has a defined wrapper class (ie. 'long' 493 * maps to 'Long'). If the classifier doesn't have a wrapper defined for it, this method will 494 * return a null. Note that wrapper mappings must be defined for the namespace by defining the 495 * 'wrapperMappingsUri', this property must point to the location of the mappings file which 496 * maps the primitives to wrapper types. 497 * @see ClassifierFacade#getWrapperName() 498 */ 499 public String getWrapperName() 500 { 501 return this.getSuperEnumerationFacade().getWrapperName(); 502 } 503 504 /** 505 * Indicates if this classifier is 'abstract'. 506 * @see ClassifierFacade#isAbstract() 507 */ 508 public boolean isAbstract() 509 { 510 return this.getSuperEnumerationFacade().isAbstract(); 511 } 512 513 /** 514 * True if this classifier represents an array type. False otherwise. 515 * @see ClassifierFacade#isArrayType() 516 */ 517 public boolean isArrayType() 518 { 519 return this.getSuperEnumerationFacade().isArrayType(); 520 } 521 522 /** 523 * True if the ClassifierFacade is an AssociationClass. 524 * @see ClassifierFacade#isAssociationClass() 525 */ 526 public boolean isAssociationClass() 527 { 528 return this.getSuperEnumerationFacade().isAssociationClass(); 529 } 530 531 /** 532 * Returns true if this type represents a Blob type. 533 * @see ClassifierFacade#isBlobType() 534 */ 535 public boolean isBlobType() 536 { 537 return this.getSuperEnumerationFacade().isBlobType(); 538 } 539 540 /** 541 * Indicates if this type represents a boolean type or not. 542 * @see ClassifierFacade#isBooleanType() 543 */ 544 public boolean isBooleanType() 545 { 546 return this.getSuperEnumerationFacade().isBooleanType(); 547 } 548 549 /** 550 * Indicates if this type represents a char, Character, or java.lang.Character type or not. 551 * @see ClassifierFacade#isCharacterType() 552 */ 553 public boolean isCharacterType() 554 { 555 return this.getSuperEnumerationFacade().isCharacterType(); 556 } 557 558 /** 559 * Returns true if this type represents a Clob type. 560 * @see ClassifierFacade#isClobType() 561 */ 562 public boolean isClobType() 563 { 564 return this.getSuperEnumerationFacade().isClobType(); 565 } 566 567 /** 568 * True if this classifier represents a collection type. False otherwise. 569 * @see ClassifierFacade#isCollectionType() 570 */ 571 public boolean isCollectionType() 572 { 573 return this.getSuperEnumerationFacade().isCollectionType(); 574 } 575 576 /** 577 * True/false depending on whether or not this classifier represents a datatype. A data type is 578 * a type whose instances are identified only by their value. A data type may contain attributes 579 * to support the modeling of structured data types. 580 * @see ClassifierFacade#isDataType() 581 */ 582 public boolean isDataType() 583 { 584 return this.getSuperEnumerationFacade().isDataType(); 585 } 586 587 /** 588 * True when this classifier is a date type. 589 * @see ClassifierFacade#isDateType() 590 */ 591 public boolean isDateType() 592 { 593 return this.getSuperEnumerationFacade().isDateType(); 594 } 595 596 /** 597 * Indicates if this type represents a Double type or not. 598 * @see ClassifierFacade#isDoubleType() 599 */ 600 public boolean isDoubleType() 601 { 602 return this.getSuperEnumerationFacade().isDoubleType(); 603 } 604 605 /** 606 * Indicates whether or not this classifier represents an "EmbeddedValue'. 607 * @see ClassifierFacade#isEmbeddedValue() 608 */ 609 public boolean isEmbeddedValue() 610 { 611 return this.getSuperEnumerationFacade().isEmbeddedValue(); 612 } 613 614 /** 615 * True if this classifier is in fact marked as an enumeration. 616 * @see ClassifierFacade#isEnumeration() 617 */ 618 public boolean isEnumeration() 619 { 620 return this.getSuperEnumerationFacade().isEnumeration(); 621 } 622 623 /** 624 * Returns true if this type represents a 'file' type. 625 * @see ClassifierFacade#isFileType() 626 */ 627 public boolean isFileType() 628 { 629 return this.getSuperEnumerationFacade().isFileType(); 630 } 631 632 /** 633 * Indicates if this type represents a Float type or not. 634 * @see ClassifierFacade#isFloatType() 635 */ 636 public boolean isFloatType() 637 { 638 return this.getSuperEnumerationFacade().isFloatType(); 639 } 640 641 /** 642 * Indicates if this type represents an int or Integer or java.lang.Integer type or not. 643 * @see ClassifierFacade#isIntegerType() 644 */ 645 public boolean isIntegerType() 646 { 647 return this.getSuperEnumerationFacade().isIntegerType(); 648 } 649 650 /** 651 * True/false depending on whether or not this Classifier represents an interface. 652 * @see ClassifierFacade#isInterface() 653 */ 654 public boolean isInterface() 655 { 656 return this.getSuperEnumerationFacade().isInterface(); 657 } 658 659 /** 660 * True if this classifier cannot be extended and represent a leaf in the inheritance tree. 661 * @see ClassifierFacade#isLeaf() 662 */ 663 public boolean isLeaf() 664 { 665 return this.getSuperEnumerationFacade().isLeaf(); 666 } 667 668 /** 669 * True if this classifier represents a list type. False otherwise. 670 * @see ClassifierFacade#isListType() 671 */ 672 public boolean isListType() 673 { 674 return this.getSuperEnumerationFacade().isListType(); 675 } 676 677 /** 678 * Indicates if this type represents a Long type or not. 679 * @see ClassifierFacade#isLongType() 680 */ 681 public boolean isLongType() 682 { 683 return this.getSuperEnumerationFacade().isLongType(); 684 } 685 686 /** 687 * Indicates whether or not this classifier represents a Map type. 688 * @see ClassifierFacade#isMapType() 689 */ 690 public boolean isMapType() 691 { 692 return this.getSuperEnumerationFacade().isMapType(); 693 } 694 695 /** 696 * Indicates whether or not this classifier represents a primitive type. 697 * @see ClassifierFacade#isPrimitive() 698 */ 699 public boolean isPrimitive() 700 { 701 return this.getSuperEnumerationFacade().isPrimitive(); 702 } 703 704 /** 705 * True if this classifier represents a set type. False otherwise. 706 * @see ClassifierFacade#isSetType() 707 */ 708 public boolean isSetType() 709 { 710 return this.getSuperEnumerationFacade().isSetType(); 711 } 712 713 /** 714 * Indicates whether or not this classifier represents a string type. 715 * @see ClassifierFacade#isStringType() 716 */ 717 public boolean isStringType() 718 { 719 return this.getSuperEnumerationFacade().isStringType(); 720 } 721 722 /** 723 * Indicates whether or not this classifier represents a time type. 724 * @see ClassifierFacade#isTimeType() 725 */ 726 public boolean isTimeType() 727 { 728 return this.getSuperEnumerationFacade().isTimeType(); 729 } 730 731 /** 732 * Returns true if this type is a wrapped primitive type. 733 * @see ClassifierFacade#isWrappedPrimitive() 734 */ 735 public boolean isWrappedPrimitive() 736 { 737 return this.getSuperEnumerationFacade().isWrappedPrimitive(); 738 } 739 740 /** 741 * The 'from' operation name. This is the name of the operation that takes the actual literal 742 * value and allows a new enumeration to be constructed. 743 * @see EnumerationFacade#getFromOperationName() 744 */ 745 public String getFromOperationName() 746 { 747 return this.getSuperEnumerationFacade().getFromOperationName(); 748 } 749 750 /** 751 * The 'from' operation signature. This is the signature that takes the actual literal value 752 * and allows a new enumeration to be constructed. 753 * @see EnumerationFacade#getFromOperationSignature() 754 */ 755 public String getFromOperationSignature() 756 { 757 return this.getSuperEnumerationFacade().getFromOperationSignature(); 758 } 759 760 /** 761 * The type of the enumeration's literals. 762 * @see EnumerationFacade#getLiteralType() 763 */ 764 public ClassifierFacade getLiteralType() 765 { 766 return this.getSuperEnumerationFacade().getLiteralType(); 767 } 768 769 /** 770 * This enumeration's literals. 771 * @see EnumerationFacade#getLiterals() 772 */ 773 public Collection<AttributeFacade> getLiterals() 774 { 775 return this.getSuperEnumerationFacade().getLiterals(); 776 } 777 778 /** 779 * The enumeration member variables. 780 * @see EnumerationFacade#getMemberVariables() 781 */ 782 public Collection<AttributeFacade> getMemberVariables() 783 { 784 return this.getSuperEnumerationFacade().getMemberVariables(); 785 } 786 787 /** 788 * Indicates whether the enumeration must be generated using a Java 5 type-safe enum or a 789 * traditional enumeration-pattern class. 790 * @see EnumerationFacade#isTypeSafe() 791 */ 792 public boolean isTypeSafe() 793 { 794 return this.getSuperEnumerationFacade().isTypeSafe(); 795 } 796 797 /** 798 * Finds the tagged value optional searching the entire inheritance hierarchy if 'follow' is set 799 * to true. 800 * @see GeneralizableElementFacade#findTaggedValue(String tagName, boolean follow) 801 */ 802 public Object findTaggedValue(String tagName, boolean follow) 803 { 804 return this.getSuperEnumerationFacade().findTaggedValue(tagName, follow); 805 } 806 807 /** 808 * All generalizations for this generalizable element, goes up the inheritance tree. 809 * @see GeneralizableElementFacade#getAllGeneralizations() 810 */ 811 public Collection<GeneralizableElementFacade> getAllGeneralizations() 812 { 813 return this.getSuperEnumerationFacade().getAllGeneralizations(); 814 } 815 816 /** 817 * All specializations (travels down the inheritance hierarchy). 818 * @see GeneralizableElementFacade#getAllSpecializations() 819 */ 820 public Collection<GeneralizableElementFacade> getAllSpecializations() 821 { 822 return this.getSuperEnumerationFacade().getAllSpecializations(); 823 } 824 825 /** 826 * Gets the direct generalization for this generalizable element. 827 * @see GeneralizableElementFacade#getGeneralization() 828 */ 829 public GeneralizableElementFacade getGeneralization() 830 { 831 return this.getSuperEnumerationFacade().getGeneralization(); 832 } 833 834 /** 835 * Gets the actual links that this generalization element is part of (it plays either the 836 * specialization or generalization). 837 * @see GeneralizableElementFacade#getGeneralizationLinks() 838 */ 839 public Collection<GeneralizationFacade> getGeneralizationLinks() 840 { 841 return this.getSuperEnumerationFacade().getGeneralizationLinks(); 842 } 843 844 /** 845 * A comma separated list of the fully qualified names of all generalizations. 846 * @see GeneralizableElementFacade#getGeneralizationList() 847 */ 848 public String getGeneralizationList() 849 { 850 return this.getSuperEnumerationFacade().getGeneralizationList(); 851 } 852 853 /** 854 * The element found when you recursively follow the generalization path up to the root. If an 855 * element has no generalization itself will be considered the root. 856 * @see GeneralizableElementFacade#getGeneralizationRoot() 857 */ 858 public GeneralizableElementFacade getGeneralizationRoot() 859 { 860 return this.getSuperEnumerationFacade().getGeneralizationRoot(); 861 } 862 863 /** 864 * Return all generalizations (ancestors) from this generalizable element. 865 * @see GeneralizableElementFacade#getGeneralizations() 866 */ 867 public Collection<GeneralizableElementFacade> getGeneralizations() 868 { 869 return this.getSuperEnumerationFacade().getGeneralizations(); 870 } 871 872 /** 873 * Gets the direct specializations (i.e. sub elements) for this generalizatble element. 874 * @see GeneralizableElementFacade#getSpecializations() 875 */ 876 public Collection<GeneralizableElementFacade> getSpecializations() 877 { 878 return this.getSuperEnumerationFacade().getSpecializations(); 879 } 880 881 /** 882 * Copies all tagged values from the given ModelElementFacade to this model element facade. 883 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element) 884 */ 885 public void copyTaggedValues(ModelElementFacade element) 886 { 887 this.getSuperEnumerationFacade().copyTaggedValues(element); 888 } 889 890 /** 891 * Finds the tagged value with the specified 'tagName'. In case there are more values the first 892 * one found will be returned. 893 * @see ModelElementFacade#findTaggedValue(String tagName) 894 */ 895 public Object findTaggedValue(String tagName) 896 { 897 return this.getSuperEnumerationFacade().findTaggedValue(tagName); 898 } 899 900 /** 901 * Returns all the values for the tagged value with the specified name. The returned collection 902 * will contains only String instances, or will be empty. Never null. 903 * @see ModelElementFacade#findTaggedValues(String tagName) 904 */ 905 public Collection<Object> findTaggedValues(String tagName) 906 { 907 return this.getSuperEnumerationFacade().findTaggedValues(tagName); 908 } 909 910 /** 911 * Returns the fully qualified name of the model element. The fully qualified name includes 912 * complete package qualified name of the underlying model element. The templates parameter will 913 * be replaced by the correct one given the binding relation of the parameter to this element. 914 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement) 915 */ 916 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement) 917 { 918 return this.getSuperEnumerationFacade().getBindedFullyQualifiedName(bindedElement); 919 } 920 921 /** 922 * Gets all constraints belonging to the model element. 923 * @see ModelElementFacade#getConstraints() 924 */ 925 public Collection<ConstraintFacade> getConstraints() 926 { 927 return this.getSuperEnumerationFacade().getConstraints(); 928 } 929 930 /** 931 * Returns the constraints of the argument kind that have been placed onto this model. Typical 932 * kinds are "inv", "pre" and "post". Other kinds are possible. 933 * @see ModelElementFacade#getConstraints(String kind) 934 */ 935 public Collection<ConstraintFacade> getConstraints(String kind) 936 { 937 return this.getSuperEnumerationFacade().getConstraints(kind); 938 } 939 940 /** 941 * Gets the documentation for the model element, The indent argument is prefixed to each line. 942 * By default this method wraps lines after 64 characters. 943 * This method is equivalent to <code>getDocumentation(indent, 64)</code>. 944 * @see ModelElementFacade#getDocumentation(String indent) 945 */ 946 public String getDocumentation(String indent) 947 { 948 return this.getSuperEnumerationFacade().getDocumentation(indent); 949 } 950 951 /** 952 * This method returns the documentation for this model element, with the lines wrapped after 953 * the specified number of characters, values of less than 1 will indicate no line wrapping is 954 * required. By default paragraphs are returned as HTML. 955 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>. 956 * @see ModelElementFacade#getDocumentation(String indent, int lineLength) 957 */ 958 public String getDocumentation(String indent, int lineLength) 959 { 960 return this.getSuperEnumerationFacade().getDocumentation(indent, lineLength); 961 } 962 963 /** 964 * This method returns the documentation for this model element, with the lines wrapped after 965 * the specified number of characters, values of less than 1 will indicate no line wrapping is 966 * required. HTML style determines if HTML Escaping is applied. 967 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle) 968 */ 969 public String getDocumentation(String indent, int lineLength, boolean htmlStyle) 970 { 971 return this.getSuperEnumerationFacade().getDocumentation(indent, lineLength, htmlStyle); 972 } 973 974 /** 975 * The fully qualified name of this model element. 976 * @see ModelElementFacade#getFullyQualifiedName() 977 */ 978 public String getFullyQualifiedName() 979 { 980 return this.getSuperEnumerationFacade().getFullyQualifiedName(); 981 } 982 983 /** 984 * Returns the fully qualified name of the model element. The fully qualified name includes 985 * complete package qualified name of the underlying model element. If modelName is true, then 986 * the original name of the model element (the name contained within the model) will be the name 987 * returned, otherwise a name from a language mapping will be returned. 988 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName) 989 */ 990 public String getFullyQualifiedName(boolean modelName) 991 { 992 return this.getSuperEnumerationFacade().getFullyQualifiedName(modelName); 993 } 994 995 /** 996 * Returns the fully qualified name as a path, the returned value always starts with out a slash 997 * '/'. 998 * @see ModelElementFacade#getFullyQualifiedNamePath() 999 */ 1000 public String getFullyQualifiedNamePath() 1001 { 1002 return this.getSuperEnumerationFacade().getFullyQualifiedNamePath(); 1003 } 1004 1005 /** 1006 * Gets the unique identifier of the underlying model element. 1007 * @see ModelElementFacade#getId() 1008 */ 1009 public String getId() 1010 { 1011 return this.getSuperEnumerationFacade().getId(); 1012 } 1013 1014 /** 1015 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which 1016 * are not represented by other properties, i.e. native, transient, volatile, synchronized, 1017 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings: 1018 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require 1019 * JDK5 compiler level. 1020 * @see ModelElementFacade#getKeywords() 1021 */ 1022 public Collection<String> getKeywords() 1023 { 1024 return this.getSuperEnumerationFacade().getKeywords(); 1025 } 1026 1027 /** 1028 * UML2: Retrieves a localized label for this named element. 1029 * @see ModelElementFacade#getLabel() 1030 */ 1031 public String getLabel() 1032 { 1033 return this.getSuperEnumerationFacade().getLabel(); 1034 } 1035 1036 /** 1037 * The language mappings that have been set for this model element. 1038 * @see ModelElementFacade#getLanguageMappings() 1039 */ 1040 public TypeMappings getLanguageMappings() 1041 { 1042 return this.getSuperEnumerationFacade().getLanguageMappings(); 1043 } 1044 1045 /** 1046 * Return the model containing this model element (multiple models may be loaded and processed 1047 * at the same time). 1048 * @see ModelElementFacade#getModel() 1049 */ 1050 public ModelFacade getModel() 1051 { 1052 return this.getSuperEnumerationFacade().getModel(); 1053 } 1054 1055 /** 1056 * The name of the model element. 1057 * @see ModelElementFacade#getName() 1058 */ 1059 public String getName() 1060 { 1061 return this.getSuperEnumerationFacade().getName(); 1062 } 1063 1064 /** 1065 * Gets the package to which this model element belongs. 1066 * @see ModelElementFacade#getPackage() 1067 */ 1068 public ModelElementFacade getPackage() 1069 { 1070 return this.getSuperEnumerationFacade().getPackage(); 1071 } 1072 1073 /** 1074 * The name of this model element's package. 1075 * @see ModelElementFacade#getPackageName() 1076 */ 1077 public String getPackageName() 1078 { 1079 return this.getSuperEnumerationFacade().getPackageName(); 1080 } 1081 1082 /** 1083 * Gets the package name (optionally providing the ability to retrieve the model name and not 1084 * the mapped name). 1085 * @see ModelElementFacade#getPackageName(boolean modelName) 1086 */ 1087 public String getPackageName(boolean modelName) 1088 { 1089 return this.getSuperEnumerationFacade().getPackageName(modelName); 1090 } 1091 1092 /** 1093 * Returns the package as a path, the returned value always starts with out a slash '/'. 1094 * @see ModelElementFacade#getPackagePath() 1095 */ 1096 public String getPackagePath() 1097 { 1098 return this.getSuperEnumerationFacade().getPackagePath(); 1099 } 1100 1101 /** 1102 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the 1103 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from 1104 * the names of the containing namespaces starting at the root of the hierarchy and ending with 1105 * the name of the NamedElement itself. 1106 * @see ModelElementFacade#getQualifiedName() 1107 */ 1108 public String getQualifiedName() 1109 { 1110 return this.getSuperEnumerationFacade().getQualifiedName(); 1111 } 1112 1113 /** 1114 * Gets the root package for the model element. 1115 * @see ModelElementFacade#getRootPackage() 1116 */ 1117 public PackageFacade getRootPackage() 1118 { 1119 return this.getSuperEnumerationFacade().getRootPackage(); 1120 } 1121 1122 /** 1123 * Gets the dependencies for which this model element is the source. 1124 * @see ModelElementFacade#getSourceDependencies() 1125 */ 1126 public Collection<DependencyFacade> getSourceDependencies() 1127 { 1128 return this.getSuperEnumerationFacade().getSourceDependencies(); 1129 } 1130 1131 /** 1132 * If this model element is the context of an activity graph, this represents that activity 1133 * graph. 1134 * @see ModelElementFacade#getStateMachineContext() 1135 */ 1136 public StateMachineFacade getStateMachineContext() 1137 { 1138 return this.getSuperEnumerationFacade().getStateMachineContext(); 1139 } 1140 1141 /** 1142 * The collection of ALL stereotype names for this model element. 1143 * @see ModelElementFacade#getStereotypeNames() 1144 */ 1145 public Collection<String> getStereotypeNames() 1146 { 1147 return this.getSuperEnumerationFacade().getStereotypeNames(); 1148 } 1149 1150 /** 1151 * Gets all stereotypes for this model element. 1152 * @see ModelElementFacade#getStereotypes() 1153 */ 1154 public Collection<StereotypeFacade> getStereotypes() 1155 { 1156 return this.getSuperEnumerationFacade().getStereotypes(); 1157 } 1158 1159 /** 1160 * Return the TaggedValues associated with this model element, under all stereotypes. 1161 * @see ModelElementFacade#getTaggedValues() 1162 */ 1163 public Collection<TaggedValueFacade> getTaggedValues() 1164 { 1165 return this.getSuperEnumerationFacade().getTaggedValues(); 1166 } 1167 1168 /** 1169 * Gets the dependencies for which this model element is the target. 1170 * @see ModelElementFacade#getTargetDependencies() 1171 */ 1172 public Collection<DependencyFacade> getTargetDependencies() 1173 { 1174 return this.getSuperEnumerationFacade().getTargetDependencies(); 1175 } 1176 1177 /** 1178 * Get the template parameter for this model element having the parameterName 1179 * @see ModelElementFacade#getTemplateParameter(String parameterName) 1180 */ 1181 public Object getTemplateParameter(String parameterName) 1182 { 1183 return this.getSuperEnumerationFacade().getTemplateParameter(parameterName); 1184 } 1185 1186 /** 1187 * Get the template parameters for this model element 1188 * @see ModelElementFacade#getTemplateParameters() 1189 */ 1190 public Collection<TemplateParameterFacade> getTemplateParameters() 1191 { 1192 return this.getSuperEnumerationFacade().getTemplateParameters(); 1193 } 1194 1195 /** 1196 * The visibility (i.e. public, private, protected or package) of the model element, will 1197 * attempt a lookup for these values in the language mappings (if any). 1198 * @see ModelElementFacade#getVisibility() 1199 */ 1200 public String getVisibility() 1201 { 1202 return this.getSuperEnumerationFacade().getVisibility(); 1203 } 1204 1205 /** 1206 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance 1207 * is taken into account when searching for the stereotype), false otherwise. 1208 * @see ModelElementFacade#hasExactStereotype(String stereotypeName) 1209 */ 1210 public boolean hasExactStereotype(String stereotypeName) 1211 { 1212 return this.getSuperEnumerationFacade().hasExactStereotype(stereotypeName); 1213 } 1214 1215 /** 1216 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, 1217 * pipe, semicolon, or << >> 1218 * @see ModelElementFacade#hasKeyword(String keywordName) 1219 */ 1220 public boolean hasKeyword(String keywordName) 1221 { 1222 return this.getSuperEnumerationFacade().hasKeyword(keywordName); 1223 } 1224 1225 /** 1226 * Returns true if the model element has the specified stereotype. If the stereotype itself 1227 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if 1228 * one of the stereotype's ancestors has a matching name this method will return true, false 1229 * otherwise. 1230 * For example, if we have a certain stereotype called <<exception>> and a model element has a 1231 * stereotype called <<applicationException>> which extends <<exception>>, when calling this 1232 * method with 'stereotypeName' defined as 'exception' the method would return true since 1233 * <<applicationException>> inherits from <<exception>>. If you want to check if the model 1234 * element has the exact stereotype, then use the method 'hasExactStereotype' instead. 1235 * @see ModelElementFacade#hasStereotype(String stereotypeName) 1236 */ 1237 public boolean hasStereotype(String stereotypeName) 1238 { 1239 return this.getSuperEnumerationFacade().hasStereotype(stereotypeName); 1240 } 1241 1242 /** 1243 * True if there are target dependencies from this element that are instances of BindingFacade. 1244 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies. 1245 * @see ModelElementFacade#isBindingDependenciesPresent() 1246 */ 1247 public boolean isBindingDependenciesPresent() 1248 { 1249 return this.getSuperEnumerationFacade().isBindingDependenciesPresent(); 1250 } 1251 1252 /** 1253 * Indicates if any constraints are present on this model element. 1254 * @see ModelElementFacade#isConstraintsPresent() 1255 */ 1256 public boolean isConstraintsPresent() 1257 { 1258 return this.getSuperEnumerationFacade().isConstraintsPresent(); 1259 } 1260 1261 /** 1262 * Indicates if any documentation is present on this model element. 1263 * @see ModelElementFacade#isDocumentationPresent() 1264 */ 1265 public boolean isDocumentationPresent() 1266 { 1267 return this.getSuperEnumerationFacade().isDocumentationPresent(); 1268 } 1269 1270 /** 1271 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript. 1272 * @see ModelElementFacade#isReservedWord() 1273 */ 1274 public boolean isReservedWord() 1275 { 1276 return this.getSuperEnumerationFacade().isReservedWord(); 1277 } 1278 1279 /** 1280 * True is there are template parameters on this model element. For UML2, applies to Class, 1281 * Operation, Property, and Parameter. 1282 * @see ModelElementFacade#isTemplateParametersPresent() 1283 */ 1284 public boolean isTemplateParametersPresent() 1285 { 1286 return this.getSuperEnumerationFacade().isTemplateParametersPresent(); 1287 } 1288 1289 /** 1290 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++, 1291 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on 1292 * Enumerations and Interfaces, optionally applies on other model elements. 1293 * @see ModelElementFacade#isValidIdentifierName() 1294 */ 1295 public boolean isValidIdentifierName() 1296 { 1297 return this.getSuperEnumerationFacade().isValidIdentifierName(); 1298 } 1299 1300 /** 1301 * Searches for the constraint with the specified 'name' on this model element, and if found 1302 * translates it using the specified 'translation' from a translation library discovered by the 1303 * framework. 1304 * @see ModelElementFacade#translateConstraint(String name, String translation) 1305 */ 1306 public String translateConstraint(String name, String translation) 1307 { 1308 return this.getSuperEnumerationFacade().translateConstraint(name, translation); 1309 } 1310 1311 /** 1312 * Translates all constraints belonging to this model element with the given 'translation'. 1313 * @see ModelElementFacade#translateConstraints(String translation) 1314 */ 1315 public String[] translateConstraints(String translation) 1316 { 1317 return this.getSuperEnumerationFacade().translateConstraints(translation); 1318 } 1319 1320 /** 1321 * Translates the constraints of the specified 'kind' belonging to this model element. 1322 * @see ModelElementFacade#translateConstraints(String kind, String translation) 1323 */ 1324 public String[] translateConstraints(String kind, String translation) 1325 { 1326 return this.getSuperEnumerationFacade().translateConstraints(kind, translation); 1327 } 1328 1329 /** 1330 * @see org.andromda.core.metafacade.MetafacadeBase#initialize() 1331 */ 1332 @Override 1333 public void initialize() 1334 { 1335 this.getSuperEnumerationFacade().initialize(); 1336 } 1337 1338 /** 1339 * @return Object getSuperEnumerationFacade().getValidationOwner() 1340 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner() 1341 */ 1342 @Override 1343 public Object getValidationOwner() 1344 { 1345 Object owner = this.getSuperEnumerationFacade().getValidationOwner(); 1346 return owner; 1347 } 1348 1349 /** 1350 * @return String getSuperEnumerationFacade().getValidationName() 1351 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName() 1352 */ 1353 @Override 1354 public String getValidationName() 1355 { 1356 String name = this.getSuperEnumerationFacade().getValidationName(); 1357 return name; 1358 } 1359 1360 /** 1361 * @param validationMessages Collection<ModelValidationMessage> 1362 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages) 1363 */ 1364 @Override 1365 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 1366 { 1367 this.getSuperEnumerationFacade().validateInvariants(validationMessages); 1368 } 1369 1370 /** 1371 * The property that stores the name of the metafacade. 1372 */ 1373 private static final String NAME_PROPERTY = "name"; 1374 private static final String FQNAME_PROPERTY = "fullyQualifiedName"; 1375 1376 /** 1377 * @see Object#toString() 1378 */ 1379 @Override 1380 public String toString() 1381 { 1382 final StringBuilder toString = new StringBuilder(this.getClass().getName()); 1383 toString.append("["); 1384 try 1385 { 1386 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY)); 1387 } 1388 catch (final Throwable tryAgain) 1389 { 1390 try 1391 { 1392 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY)); 1393 } 1394 catch (final Throwable ignore) 1395 { 1396 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property 1397 } 1398 } 1399 toString.append("]"); 1400 return toString.toString(); 1401 } 1402}