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