View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4   //
5   package org.andromda.metafacades.uml14;
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.ModelValidationMessage;
12  import org.andromda.metafacades.uml.ConstraintFacade;
13  import org.andromda.metafacades.uml.DependencyFacade;
14  import org.andromda.metafacades.uml.ModelElementFacade;
15  import org.andromda.metafacades.uml.ModelFacade;
16  import org.andromda.metafacades.uml.PackageFacade;
17  import org.andromda.metafacades.uml.StateMachineFacade;
18  import org.andromda.metafacades.uml.StereotypeFacade;
19  import org.andromda.metafacades.uml.TaggedValueFacade;
20  import org.andromda.metafacades.uml.TemplateParameterFacade;
21  import org.andromda.metafacades.uml.TypeMappings;
22  import org.apache.log4j.Logger;
23  import org.omg.uml.foundation.core.ModelElement;
24  
25  /**
26   * Represents a model element. It may be an Element or NamedElement. A named element is an element
27   * in a model that may have a name. An element is a constituent of a model. As such, it has the
28   * capability of owning other elements.
29   * MetafacadeLogic for ModelElementFacade
30   *
31   * @see ModelElementFacade
32   */
33  public abstract class ModelElementFacadeLogic
34      extends MetafacadeBase
35      implements ModelElementFacade
36  {
37      /**
38       * The underlying UML object
39       * @see ModelElement
40       */
41      protected ModelElement metaObject;
42  
43      /** Create Metafacade implementation instance using the MetafacadeFactory from the context
44       * @param metaObjectIn
45       * @param context
46       */
47      protected ModelElementFacadeLogic(ModelElement metaObjectIn, String context)
48      {
49          super(metaObjectIn, getContext(context));
50          this.metaObject = metaObjectIn;
51      }
52  
53      /**
54       * The logger instance.
55       */
56      private static final Logger logger = Logger.getLogger(ModelElementFacadeLogic.class);
57  
58      /**
59       * Gets the context for this metafacade logic instance.
60       * @param context String. Set to ModelElementFacade if null
61       * @return context String
62       */
63      private static String getContext(String context)
64      {
65          if (context == null)
66          {
67              context = "org.andromda.metafacades.uml.ModelElementFacade";
68          }
69          return context;
70      }
71  
72      /** Reset context only for non-root metafacades
73       * @param context
74       */
75      @Override
76      public void resetMetafacadeContext(String context)
77      {
78          if (!this.contextRoot) // reset context only for non-root metafacades
79          {
80              context = getContext(context);  // to have same value as in original constructor call
81              setMetafacadeContext (context);
82          }
83      }
84  
85      /**
86       * @return boolean true always
87       * @see ModelElementFacade
88       */
89      public boolean isModelElementFacadeMetaType()
90      {
91          return true;
92      }
93  
94      // --------------- attributes ---------------------
95  
96     /**
97      * @see ModelElementFacade#getVisibility()
98      * @return String
99      */
100     protected abstract String handleGetVisibility();
101 
102     private String __visibility1a;
103     private boolean __visibility1aSet = false;
104 
105     /**
106      * The visibility (i.e. public, private, protected or package) of the model element, will
107      * attempt a lookup for these values in the language mappings (if any).
108      * @return (String)handleGetVisibility()
109      */
110     public final String getVisibility()
111     {
112         String visibility1a = this.__visibility1a;
113         if (!this.__visibility1aSet)
114         {
115             // visibility has no pre constraints
116             visibility1a = handleGetVisibility();
117             // visibility has no post constraints
118             this.__visibility1a = visibility1a;
119             if (isMetafacadePropertyCachingEnabled())
120             {
121                 this.__visibility1aSet = true;
122             }
123         }
124         return visibility1a;
125     }
126 
127    /**
128     * @see ModelElementFacade#getPackagePath()
129     * @return String
130     */
131     protected abstract String handleGetPackagePath();
132 
133     private String __packagePath2a;
134     private boolean __packagePath2aSet = false;
135 
136     /**
137      * Returns the package as a path, the returned value always starts with out a slash '/'.
138      * @return (String)handleGetPackagePath()
139      */
140     public final String getPackagePath()
141     {
142         String packagePath2a = this.__packagePath2a;
143         if (!this.__packagePath2aSet)
144         {
145             // packagePath has no pre constraints
146             packagePath2a = handleGetPackagePath();
147             // packagePath has no post constraints
148             this.__packagePath2a = packagePath2a;
149             if (isMetafacadePropertyCachingEnabled())
150             {
151                 this.__packagePath2aSet = true;
152             }
153         }
154         return packagePath2a;
155     }
156 
157    /**
158     * @see ModelElementFacade#getName()
159     * @return String
160     */
161     protected abstract String handleGetName();
162 
163     private String __name3a;
164     private boolean __name3aSet = false;
165 
166     /**
167      * The name of the model element.
168      * @return (String)handleGetName()
169      */
170     public final String getName()
171     {
172         String name3a = this.__name3a;
173         if (!this.__name3aSet)
174         {
175             // name has no pre constraints
176             name3a = handleGetName();
177             // name has no post constraints
178             this.__name3a = name3a;
179             if (isMetafacadePropertyCachingEnabled())
180             {
181                 this.__name3aSet = true;
182             }
183         }
184         return name3a;
185     }
186 
187    /**
188     * @see ModelElementFacade#getPackageName()
189     * @return String
190     */
191     protected abstract String handleGetPackageName();
192 
193     private String __packageName4a;
194     private boolean __packageName4aSet = false;
195 
196     /**
197      * The name of this model element's package.
198      * @return (String)handleGetPackageName()
199      */
200     public final String getPackageName()
201     {
202         String packageName4a = this.__packageName4a;
203         if (!this.__packageName4aSet)
204         {
205             // packageName has no pre constraints
206             packageName4a = handleGetPackageName();
207             // packageName has no post constraints
208             this.__packageName4a = packageName4a;
209             if (isMetafacadePropertyCachingEnabled())
210             {
211                 this.__packageName4aSet = true;
212             }
213         }
214         return packageName4a;
215     }
216 
217    /**
218     * @see ModelElementFacade#getFullyQualifiedName()
219     * @return String
220     */
221     protected abstract String handleGetFullyQualifiedName();
222 
223     private String __fullyQualifiedName5a;
224     private boolean __fullyQualifiedName5aSet = false;
225 
226     /**
227      * The fully qualified name of this model element.
228      * @return (String)handleGetFullyQualifiedName()
229      */
230     public final String getFullyQualifiedName()
231     {
232         String fullyQualifiedName5a = this.__fullyQualifiedName5a;
233         if (!this.__fullyQualifiedName5aSet)
234         {
235             // fullyQualifiedName has no pre constraints
236             fullyQualifiedName5a = handleGetFullyQualifiedName();
237             // fullyQualifiedName has no post constraints
238             this.__fullyQualifiedName5a = fullyQualifiedName5a;
239             if (isMetafacadePropertyCachingEnabled())
240             {
241                 this.__fullyQualifiedName5aSet = true;
242             }
243         }
244         return fullyQualifiedName5a;
245     }
246 
247    /**
248     * @see ModelElementFacade#getFullyQualifiedNamePath()
249     * @return String
250     */
251     protected abstract String handleGetFullyQualifiedNamePath();
252 
253     private String __fullyQualifiedNamePath6a;
254     private boolean __fullyQualifiedNamePath6aSet = false;
255 
256     /**
257      * Returns the fully qualified name as a path, the returned value always starts with out a slash
258      * '/'.
259      * @return (String)handleGetFullyQualifiedNamePath()
260      */
261     public final String getFullyQualifiedNamePath()
262     {
263         String fullyQualifiedNamePath6a = this.__fullyQualifiedNamePath6a;
264         if (!this.__fullyQualifiedNamePath6aSet)
265         {
266             // fullyQualifiedNamePath has no pre constraints
267             fullyQualifiedNamePath6a = handleGetFullyQualifiedNamePath();
268             // fullyQualifiedNamePath has no post constraints
269             this.__fullyQualifiedNamePath6a = fullyQualifiedNamePath6a;
270             if (isMetafacadePropertyCachingEnabled())
271             {
272                 this.__fullyQualifiedNamePath6aSet = true;
273             }
274         }
275         return fullyQualifiedNamePath6a;
276     }
277 
278    /**
279     * @see ModelElementFacade#getLanguageMappings()
280     * @return TypeMappings
281     */
282     protected abstract TypeMappings handleGetLanguageMappings();
283 
284     private TypeMappings __languageMappings7a;
285     private boolean __languageMappings7aSet = false;
286 
287     /**
288      * The language mappings that have been set for this model element.
289      * @return (TypeMappings)handleGetLanguageMappings()
290      */
291     public final TypeMappings getLanguageMappings()
292     {
293         TypeMappings languageMappings7a = this.__languageMappings7a;
294         if (!this.__languageMappings7aSet)
295         {
296             // languageMappings has no pre constraints
297             languageMappings7a = handleGetLanguageMappings();
298             // languageMappings has no post constraints
299             this.__languageMappings7a = languageMappings7a;
300             if (isMetafacadePropertyCachingEnabled())
301             {
302                 this.__languageMappings7aSet = true;
303             }
304         }
305         return languageMappings7a;
306     }
307 
308    /**
309     * @see ModelElementFacade#getStereotypeNames()
310     * @return Collection<String>
311     */
312     protected abstract Collection<String> handleGetStereotypeNames();
313 
314     private Collection<String> __stereotypeNames8a;
315     private boolean __stereotypeNames8aSet = false;
316 
317     /**
318      * The collection of ALL stereotype names for this model element.
319      * @return (Collection<String>)handleGetStereotypeNames()
320      */
321     public final Collection<String> getStereotypeNames()
322     {
323         Collection<String> stereotypeNames8a = this.__stereotypeNames8a;
324         if (!this.__stereotypeNames8aSet)
325         {
326             // stereotypeNames has no pre constraints
327             stereotypeNames8a = handleGetStereotypeNames();
328             // stereotypeNames has no post constraints
329             this.__stereotypeNames8a = stereotypeNames8a;
330             if (isMetafacadePropertyCachingEnabled())
331             {
332                 this.__stereotypeNames8aSet = true;
333             }
334         }
335         return stereotypeNames8a;
336     }
337 
338    /**
339     * @see ModelElementFacade#getId()
340     * @return String
341     */
342     protected abstract String handleGetId();
343 
344     private String __id9a;
345     private boolean __id9aSet = false;
346 
347     /**
348      * Gets the unique identifier of the underlying model element.
349      * @return (String)handleGetId()
350      */
351     public final String getId()
352     {
353         String id9a = this.__id9a;
354         if (!this.__id9aSet)
355         {
356             // id has no pre constraints
357             id9a = handleGetId();
358             // id has no post constraints
359             this.__id9a = id9a;
360             if (isMetafacadePropertyCachingEnabled())
361             {
362                 this.__id9aSet = true;
363             }
364         }
365         return id9a;
366     }
367 
368    /**
369     * @see ModelElementFacade#isConstraintsPresent()
370     * @return boolean
371     */
372     protected abstract boolean handleIsConstraintsPresent();
373 
374     private boolean __constraintsPresent10a;
375     private boolean __constraintsPresent10aSet = false;
376 
377     /**
378      * Indicates if any constraints are present on this model element.
379      * @return (boolean)handleIsConstraintsPresent()
380      */
381     public final boolean isConstraintsPresent()
382     {
383         boolean constraintsPresent10a = this.__constraintsPresent10a;
384         if (!this.__constraintsPresent10aSet)
385         {
386             // constraintsPresent has no pre constraints
387             constraintsPresent10a = handleIsConstraintsPresent();
388             // constraintsPresent has no post constraints
389             this.__constraintsPresent10a = constraintsPresent10a;
390             if (isMetafacadePropertyCachingEnabled())
391             {
392                 this.__constraintsPresent10aSet = true;
393             }
394         }
395         return constraintsPresent10a;
396     }
397 
398    /**
399     * @see ModelElementFacade#isBindingDependenciesPresent()
400     * @return boolean
401     */
402     protected abstract boolean handleIsBindingDependenciesPresent();
403 
404     private boolean __bindingDependenciesPresent11a;
405     private boolean __bindingDependenciesPresent11aSet = false;
406 
407     /**
408      * True if there are target dependencies from this element that are instances of BindingFacade.
409      * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
410      * @return (boolean)handleIsBindingDependenciesPresent()
411      */
412     public final boolean isBindingDependenciesPresent()
413     {
414         boolean bindingDependenciesPresent11a = this.__bindingDependenciesPresent11a;
415         if (!this.__bindingDependenciesPresent11aSet)
416         {
417             // bindingDependenciesPresent has no pre constraints
418             bindingDependenciesPresent11a = handleIsBindingDependenciesPresent();
419             // bindingDependenciesPresent has no post constraints
420             this.__bindingDependenciesPresent11a = bindingDependenciesPresent11a;
421             if (isMetafacadePropertyCachingEnabled())
422             {
423                 this.__bindingDependenciesPresent11aSet = true;
424             }
425         }
426         return bindingDependenciesPresent11a;
427     }
428 
429    /**
430     * @see ModelElementFacade#isTemplateParametersPresent()
431     * @return boolean
432     */
433     protected abstract boolean handleIsTemplateParametersPresent();
434 
435     private boolean __templateParametersPresent12a;
436     private boolean __templateParametersPresent12aSet = false;
437 
438     /**
439      * True is there are template parameters on this model element. For UML2, applies to Class,
440      * Operation, Property, and Parameter.
441      * @return (boolean)handleIsTemplateParametersPresent()
442      */
443     public final boolean isTemplateParametersPresent()
444     {
445         boolean templateParametersPresent12a = this.__templateParametersPresent12a;
446         if (!this.__templateParametersPresent12aSet)
447         {
448             // templateParametersPresent has no pre constraints
449             templateParametersPresent12a = handleIsTemplateParametersPresent();
450             // templateParametersPresent has no post constraints
451             this.__templateParametersPresent12a = templateParametersPresent12a;
452             if (isMetafacadePropertyCachingEnabled())
453             {
454                 this.__templateParametersPresent12aSet = true;
455             }
456         }
457         return templateParametersPresent12a;
458     }
459 
460    /**
461     * @see ModelElementFacade#getKeywords()
462     * @return Collection<String>
463     */
464     protected abstract Collection<String> handleGetKeywords();
465 
466     private Collection<String> __keywords13a;
467     private boolean __keywords13aSet = false;
468 
469     /**
470      * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
471      * are not represented by other properties, i.e. native, transient, volatile, synchronized,
472      * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
473      * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
474      * JDK5 compiler level.
475      * @return (Collection<String>)handleGetKeywords()
476      */
477     public final Collection<String> getKeywords()
478     {
479         Collection<String> keywords13a = this.__keywords13a;
480         if (!this.__keywords13aSet)
481         {
482             // keywords has no pre constraints
483             keywords13a = handleGetKeywords();
484             // keywords has no post constraints
485             this.__keywords13a = keywords13a;
486             if (isMetafacadePropertyCachingEnabled())
487             {
488                 this.__keywords13aSet = true;
489             }
490         }
491         return keywords13a;
492     }
493 
494    /**
495     * @see ModelElementFacade#getLabel()
496     * @return String
497     */
498     protected abstract String handleGetLabel();
499 
500     private String __label14a;
501     private boolean __label14aSet = false;
502 
503     /**
504      * UML2: Retrieves a localized label for this named element.
505      * @return (String)handleGetLabel()
506      */
507     public final String getLabel()
508     {
509         String label14a = this.__label14a;
510         if (!this.__label14aSet)
511         {
512             // label has no pre constraints
513             label14a = handleGetLabel();
514             // label has no post constraints
515             this.__label14a = label14a;
516             if (isMetafacadePropertyCachingEnabled())
517             {
518                 this.__label14aSet = true;
519             }
520         }
521         return label14a;
522     }
523 
524    /**
525     * @see ModelElementFacade#getQualifiedName()
526     * @return String
527     */
528     protected abstract String handleGetQualifiedName();
529 
530     private String __qualifiedName15a;
531     private boolean __qualifiedName15aSet = false;
532 
533     /**
534      * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
535      * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
536      * the names of the containing namespaces starting at the root of the hierarchy and ending with
537      * the name of the NamedElement itself.
538      * @return (String)handleGetQualifiedName()
539      */
540     public final String getQualifiedName()
541     {
542         String qualifiedName15a = this.__qualifiedName15a;
543         if (!this.__qualifiedName15aSet)
544         {
545             // qualifiedName has no pre constraints
546             qualifiedName15a = handleGetQualifiedName();
547             // qualifiedName has no post constraints
548             this.__qualifiedName15a = qualifiedName15a;
549             if (isMetafacadePropertyCachingEnabled())
550             {
551                 this.__qualifiedName15aSet = true;
552             }
553         }
554         return qualifiedName15a;
555     }
556 
557    /**
558     * @see ModelElementFacade#isReservedWord()
559     * @return boolean
560     */
561     protected abstract boolean handleIsReservedWord();
562 
563     private boolean __reservedWord16a;
564     private boolean __reservedWord16aSet = false;
565 
566     /**
567      * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
568      * @return (boolean)handleIsReservedWord()
569      */
570     public final boolean isReservedWord()
571     {
572         boolean reservedWord16a = this.__reservedWord16a;
573         if (!this.__reservedWord16aSet)
574         {
575             // reservedWord has no pre constraints
576             reservedWord16a = handleIsReservedWord();
577             // reservedWord has no post constraints
578             this.__reservedWord16a = reservedWord16a;
579             if (isMetafacadePropertyCachingEnabled())
580             {
581                 this.__reservedWord16aSet = true;
582             }
583         }
584         return reservedWord16a;
585     }
586 
587    /**
588     * @see ModelElementFacade#isDocumentationPresent()
589     * @return boolean
590     */
591     protected abstract boolean handleIsDocumentationPresent();
592 
593     private boolean __documentationPresent17a;
594     private boolean __documentationPresent17aSet = false;
595 
596     /**
597      * Indicates if any documentation is present on this model element.
598      * @return (boolean)handleIsDocumentationPresent()
599      */
600     public final boolean isDocumentationPresent()
601     {
602         boolean documentationPresent17a = this.__documentationPresent17a;
603         if (!this.__documentationPresent17aSet)
604         {
605             // documentationPresent has no pre constraints
606             documentationPresent17a = handleIsDocumentationPresent();
607             // documentationPresent has no post constraints
608             this.__documentationPresent17a = documentationPresent17a;
609             if (isMetafacadePropertyCachingEnabled())
610             {
611                 this.__documentationPresent17aSet = true;
612             }
613         }
614         return documentationPresent17a;
615     }
616 
617    /**
618     * @see ModelElementFacade#isValidIdentifierName()
619     * @return boolean
620     */
621     protected abstract boolean handleIsValidIdentifierName();
622 
623     private boolean __validIdentifierName18a;
624     private boolean __validIdentifierName18aSet = false;
625 
626     /**
627      * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
628      * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
629      * Enumerations and Interfaces, optionally applies on other model elements.
630      * @return (boolean)handleIsValidIdentifierName()
631      */
632     public final boolean isValidIdentifierName()
633     {
634         boolean validIdentifierName18a = this.__validIdentifierName18a;
635         if (!this.__validIdentifierName18aSet)
636         {
637             // validIdentifierName has no pre constraints
638             validIdentifierName18a = handleIsValidIdentifierName();
639             // validIdentifierName has no post constraints
640             this.__validIdentifierName18a = validIdentifierName18a;
641             if (isMetafacadePropertyCachingEnabled())
642             {
643                 this.__validIdentifierName18aSet = true;
644             }
645         }
646         return validIdentifierName18a;
647     }
648 
649     // ---------------- business methods ----------------------
650 
651     /**
652      * Method to be implemented in descendants
653      * Finds the tagged value with the specified 'tagName'. In case there are more values the first
654      * one found will be returned.
655      * @param tagName
656      * @return Object
657      */
658     protected abstract Object handleFindTaggedValue(String tagName);
659 
660     /**
661      * Finds the tagged value with the specified 'tagName'. In case there are more values the first
662      * one found will be returned.
663      * @param tagName String
664      * TODO: Model Documentation for
665      * ModelElementFacade.findTaggedValue(tagName)
666      * @return handleFindTaggedValue(tagName)
667      */
668     public Object findTaggedValue(String tagName)
669     {
670         // findTaggedValue has no pre constraints
671         Object returnValue = handleFindTaggedValue(tagName);
672         // findTaggedValue has no post constraints
673         return returnValue;
674     }
675 
676     /**
677      * Method to be implemented in descendants
678      * Returns true if the model element has the specified stereotype.  If the stereotype itself
679      * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
680      * one of the stereotype's ancestors has a matching name this method will return true, false
681      * otherwise.
682      * For example, if we have a certain stereotype called <<exception>> and a model element has a
683      * stereotype called <<applicationException>> which extends <<exception>>, when calling this
684      * method with 'stereotypeName' defined as 'exception' the method would return true since
685      * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
686      * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
687      * @param stereotypeName
688      * @return boolean
689      */
690     protected abstract boolean handleHasStereotype(String stereotypeName);
691 
692     /**
693      * Returns true if the model element has the specified stereotype.  If the stereotype itself
694      * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
695      * one of the stereotype's ancestors has a matching name this method will return true, false
696      * otherwise.
697      * For example, if we have a certain stereotype called <<exception>> and a model element has a
698      * stereotype called <<applicationException>> which extends <<exception>>, when calling this
699      * method with 'stereotypeName' defined as 'exception' the method would return true since
700      * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
701      * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
702      * @param stereotypeName String
703      * TODO: Model Documentation for
704      * ModelElementFacade.hasStereotype(stereotypeName)
705      * @return handleHasStereotype(stereotypeName)
706      */
707     public boolean hasStereotype(String stereotypeName)
708     {
709         // hasStereotype has no pre constraints
710         boolean returnValue = handleHasStereotype(stereotypeName);
711         // hasStereotype has no post constraints
712         return returnValue;
713     }
714 
715     /**
716      * Method to be implemented in descendants
717      * Gets the documentation for the model element, The indent argument is prefixed to each line.
718      * By default this method wraps lines after 64 characters.
719      * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
720      * @param indent
721      * @return String
722      */
723     protected abstract String handleGetDocumentation(String indent);
724 
725     /**
726      * Gets the documentation for the model element, The indent argument is prefixed to each line.
727      * By default this method wraps lines after 64 characters.
728      * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
729      * @param indent String
730      * <p>Specifies the amount to indent by.</p>
731      * @return handleGetDocumentation(indent)
732      */
733     public String getDocumentation(String indent)
734     {
735         // getDocumentation has no pre constraints
736         String returnValue = handleGetDocumentation(indent);
737         // getDocumentation has no post constraints
738         return returnValue;
739     }
740 
741     /**
742      * Method to be implemented in descendants
743      * Returns the fully qualified name of the model element. The fully qualified name includes
744      * complete package qualified name of the underlying model element.  If modelName is true, then
745      * the original name of the model element (the name contained within the model) will be the name
746      * returned, otherwise a name from a language mapping will be returned.
747      * @param modelName
748      * @return String
749      */
750     protected abstract String handleGetFullyQualifiedName(boolean modelName);
751 
752     /**
753      * Returns the fully qualified name of the model element. The fully qualified name includes
754      * complete package qualified name of the underlying model element.  If modelName is true, then
755      * the original name of the model element (the name contained within the model) will be the name
756      * returned, otherwise a name from a language mapping will be returned.
757      * @param modelName boolean
758      * If true, then the original model name will be returned regardless of any underlying language
759      * mappings used.
760      * @return handleGetFullyQualifiedName(modelName)
761      */
762     public String getFullyQualifiedName(boolean modelName)
763     {
764         // getFullyQualifiedName has no pre constraints
765         String returnValue = handleGetFullyQualifiedName(modelName);
766         // getFullyQualifiedName has no post constraints
767         return returnValue;
768     }
769 
770     /**
771      * Method to be implemented in descendants
772      * This method returns the documentation for this model element, with the lines wrapped after
773      * the specified number of characters, values of less than 1 will indicate no line wrapping is
774      * required. By default paragraphs are returned as HTML.
775      * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
776      * @param indent
777      * @param lineLength
778      * @return String
779      */
780     protected abstract String handleGetDocumentation(String indent, int lineLength);
781 
782     /**
783      * This method returns the documentation for this model element, with the lines wrapped after
784      * the specified number of characters, values of less than 1 will indicate no line wrapping is
785      * required. By default paragraphs are returned as HTML.
786      * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
787      * @param indent String
788      * TODO: Model Documentation for
789      * ModelElementFacade.getDocumentation(indent)
790      * @param lineLength int
791      * TODO: Model Documentation for
792      * ModelElementFacade.getDocumentation(lineLength)
793      * @return handleGetDocumentation(indent, lineLength)
794      */
795     public String getDocumentation(String indent, int lineLength)
796     {
797         // getDocumentation has no pre constraints
798         String returnValue = handleGetDocumentation(indent, lineLength);
799         // getDocumentation has no post constraints
800         return returnValue;
801     }
802 
803     /**
804      * Method to be implemented in descendants
805      * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
806      * is taken into account when searching for the stereotype), false otherwise.
807      * @param stereotypeName
808      * @return boolean
809      */
810     protected abstract boolean handleHasExactStereotype(String stereotypeName);
811 
812     /**
813      * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
814      * is taken into account when searching for the stereotype), false otherwise.
815      * @param stereotypeName String
816      * The name of the stereotype to check for.
817      * @return handleHasExactStereotype(stereotypeName)
818      */
819     public boolean hasExactStereotype(String stereotypeName)
820     {
821         // hasExactStereotype has no pre constraints
822         boolean returnValue = handleHasExactStereotype(stereotypeName);
823         // hasExactStereotype has no post constraints
824         return returnValue;
825     }
826 
827     /**
828      * Method to be implemented in descendants
829      * Searches for the constraint with the specified 'name' on this model element, and if found
830      * translates it using the specified 'translation' from a translation library discovered by the
831      * framework.
832      * @param name
833      * @param translation
834      * @return String
835      */
836     protected abstract String handleTranslateConstraint(String name, String translation);
837 
838     /**
839      * Searches for the constraint with the specified 'name' on this model element, and if found
840      * translates it using the specified 'translation' from a translation library discovered by the
841      * framework.
842      * @param name String
843      * The name of the constraint to find.
844      * @param translation String
845      * The name of the translation to use.  This must be a translation within a translation library
846      * discovered by the framework.
847      * @return handleTranslateConstraint(name, translation)
848      */
849     public String translateConstraint(String name, String translation)
850     {
851         // translateConstraint has no pre constraints
852         String returnValue = handleTranslateConstraint(name, translation);
853         // translateConstraint has no post constraints
854         return returnValue;
855     }
856 
857     /**
858      * Method to be implemented in descendants
859      * Translates the constraints of the specified 'kind' belonging to this model element.
860      * @param kind
861      * @param translation
862      * @return String[]
863      */
864     protected abstract String[] handleTranslateConstraints(String kind, String translation);
865 
866     /**
867      * Translates the constraints of the specified 'kind' belonging to this model element.
868      * @param kind String
869      * The 'kind' of the constraint (i.e. inv, body, pre, post, etc.).
870      * @param translation String
871      * The name of the translation to use.  This must be a translation within a translation library
872      * discovered by the framework.
873      * @return handleTranslateConstraints(kind, translation)
874      */
875     public String[] translateConstraints(String kind, String translation)
876     {
877         // translateConstraints has no pre constraints
878         String[] returnValue = handleTranslateConstraints(kind, translation);
879         // translateConstraints has no post constraints
880         return returnValue;
881     }
882 
883     /**
884      * Method to be implemented in descendants
885      * Translates all constraints belonging to this model element with the given 'translation'.
886      * @param translation
887      * @return String[]
888      */
889     protected abstract String[] handleTranslateConstraints(String translation);
890 
891     /**
892      * Translates all constraints belonging to this model element with the given 'translation'.
893      * @param translation String
894      * The name of the translation to use.  This must be a translation within a translation library
895      * discovered by the framework.
896      * @return handleTranslateConstraints(translation)
897      */
898     public String[] translateConstraints(String translation)
899     {
900         // translateConstraints has no pre constraints
901         String[] returnValue = handleTranslateConstraints(translation);
902         // translateConstraints has no post constraints
903         return returnValue;
904     }
905 
906     /**
907      * Method to be implemented in descendants
908      * Returns the constraints of the argument kind that have been placed onto this model. Typical
909      * kinds are "inv", "pre" and "post". Other kinds are possible.
910      * @param kind
911      * @return Collection<ConstraintFacade>
912      */
913     protected abstract Collection<ConstraintFacade> handleGetConstraints(String kind);
914 
915     /**
916      * Returns the constraints of the argument kind that have been placed onto this model. Typical
917      * kinds are "inv", "pre" and "post". Other kinds are possible.
918      * @param kind String
919      * TODO: Model Documentation for
920      * ModelElementFacade.getConstraints(kind)
921      * @return handleGetConstraints(kind)
922      */
923     public Collection<ConstraintFacade> getConstraints(String kind)
924     {
925         // getConstraints has no pre constraints
926         Collection<ConstraintFacade> returnValue = handleGetConstraints(kind);
927         // getConstraints has no post constraints
928         return returnValue;
929     }
930 
931     /**
932      * Method to be implemented in descendants
933      * Returns all the values for the tagged value with the specified name. The returned collection
934      * will contains only String instances, or will be empty. Never null.
935      * @param tagName
936      * @return Collection<Object>
937      */
938     protected abstract Collection<Object> handleFindTaggedValues(String tagName);
939 
940     /**
941      * Returns all the values for the tagged value with the specified name. The returned collection
942      * will contains only String instances, or will be empty. Never null.
943      * @param tagName String
944      * TODO: Model Documentation for
945      * ModelElementFacade.findTaggedValues(tagName)
946      * @return handleFindTaggedValues(tagName)
947      */
948     public Collection<Object> findTaggedValues(String tagName)
949     {
950         // findTaggedValues has no pre constraints
951         Collection<Object> returnValue = handleFindTaggedValues(tagName);
952         // findTaggedValues has no post constraints
953         return returnValue;
954     }
955 
956     /**
957      * Method to be implemented in descendants
958      * This method returns the documentation for this model element, with the lines wrapped after
959      * the specified number of characters, values of less than 1 will indicate no line wrapping is
960      * required. HTML style determines if HTML Escaping is applied.
961      * @param indent
962      * @param lineLength
963      * @param htmlStyle
964      * @return String
965      */
966     protected abstract String handleGetDocumentation(String indent, int lineLength, boolean htmlStyle);
967 
968     /**
969      * This method returns the documentation for this model element, with the lines wrapped after
970      * the specified number of characters, values of less than 1 will indicate no line wrapping is
971      * required. HTML style determines if HTML Escaping is applied.
972      * @param indent String
973      * TODO: Model Documentation for
974      * ModelElementFacade.getDocumentation(indent)
975      * @param lineLength int
976      * TODO: Model Documentation for
977      * ModelElementFacade.getDocumentation(lineLength)
978      * @param htmlStyle boolean
979      * TODO: Model Documentation for
980      * ModelElementFacade.getDocumentation(htmlStyle)
981      * @return handleGetDocumentation(indent, lineLength, htmlStyle)
982      */
983     public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
984     {
985         // getDocumentation has no pre constraints
986         String returnValue = handleGetDocumentation(indent, lineLength, htmlStyle);
987         // getDocumentation has no post constraints
988         return returnValue;
989     }
990 
991     /**
992      * Method to be implemented in descendants
993      * Gets the package name (optionally providing the ability to retrieve the model name and not
994      * the mapped name).
995      * @param modelName
996      * @return String
997      */
998     protected abstract String handleGetPackageName(boolean modelName);
999 
1000     /**
1001      * Gets the package name (optionally providing the ability to retrieve the model name and not
1002      * the mapped name).
1003      * @param modelName boolean
1004      * A flag indicating whether or not the model name should be retrieved.
1005      * @return handleGetPackageName(modelName)
1006      */
1007     public String getPackageName(boolean modelName)
1008     {
1009         // getPackageName has no pre constraints
1010         String returnValue = handleGetPackageName(modelName);
1011         // getPackageName has no post constraints
1012         return returnValue;
1013     }
1014 
1015     /**
1016      * Method to be implemented in descendants
1017      * Copies all tagged values from the given ModelElementFacade to this model element facade.
1018      * @param element
1019      */
1020     protected abstract void handleCopyTaggedValues(ModelElementFacade element);
1021 
1022     /**
1023      * Copies all tagged values from the given ModelElementFacade to this model element facade.
1024      * @param element ModelElementFacade
1025      * The element from which to copy the tagged values.
1026      */
1027     public void copyTaggedValues(ModelElementFacade element)
1028     {
1029         // copyTaggedValues has no pre constraints
1030         handleCopyTaggedValues(element);
1031         // copyTaggedValues has no post constraints
1032     }
1033 
1034     /**
1035      * Method to be implemented in descendants
1036      * Get the template parameter for this model element having the parameterName
1037      * @param parameterName
1038      * @return Object
1039      */
1040     protected abstract Object handleGetTemplateParameter(String parameterName);
1041 
1042     /**
1043      * Get the template parameter for this model element having the parameterName
1044      * @param parameterName String
1045      * TODO: Model Documentation for
1046      * ModelElementFacade.getTemplateParameter(parameterName)
1047      * @return handleGetTemplateParameter(parameterName)
1048      */
1049     public Object getTemplateParameter(String parameterName)
1050     {
1051         // getTemplateParameter has no pre constraints
1052         Object returnValue = handleGetTemplateParameter(parameterName);
1053         // getTemplateParameter has no post constraints
1054         return returnValue;
1055     }
1056 
1057     /**
1058      * Method to be implemented in descendants
1059      * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1060      * pipe, semicolon, or << >>
1061      * @param keywordName
1062      * @return boolean
1063      */
1064     protected abstract boolean handleHasKeyword(String keywordName);
1065 
1066     /**
1067      * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1068      * pipe, semicolon, or << >>
1069      * @param keywordName String
1070      * Keyword to find in the list of UML Element Keywords.
1071      * @return handleHasKeyword(keywordName)
1072      */
1073     public boolean hasKeyword(String keywordName)
1074     {
1075         // hasKeyword has no pre constraints
1076         boolean returnValue = handleHasKeyword(keywordName);
1077         // hasKeyword has no post constraints
1078         return returnValue;
1079     }
1080 
1081     /**
1082      * Method to be implemented in descendants
1083      * Returns the fully qualified name of the model element. The fully qualified name includes
1084      * complete package qualified name of the underlying model element. The templates parameter will
1085      * be replaced by the correct one given the binding relation of the parameter to this element.
1086      * @param bindedElement
1087      * @return String
1088      */
1089     protected abstract String handleGetBindedFullyQualifiedName(ModelElementFacade bindedElement);
1090 
1091     /**
1092      * Returns the fully qualified name of the model element. The fully qualified name includes
1093      * complete package qualified name of the underlying model element. The templates parameter will
1094      * be replaced by the correct one given the binding relation of the parameter to this element.
1095      * @param bindedElement ModelElementFacade
1096      * the element that will be used to find binding to the templates parameters of this element.
1097      * @return handleGetBindedFullyQualifiedName(bindedElement)
1098      */
1099     public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1100     {
1101         // getBindedFullyQualifiedName has no pre constraints
1102         String returnValue = handleGetBindedFullyQualifiedName(bindedElement);
1103         // getBindedFullyQualifiedName has no post constraints
1104         return returnValue;
1105     }
1106 
1107     // ------------- associations ------------------
1108 
1109     /**
1110      * The source element of this dependency.
1111      * @return (Collection<DependencyFacade>)handleGetSourceDependencies()
1112      */
1113     public final Collection<DependencyFacade> getSourceDependencies()
1114     {
1115         Collection<DependencyFacade> getSourceDependencies1r = null;
1116         // sourceElement has no pre constraints
1117         Collection result = handleGetSourceDependencies();
1118         List shieldedResult = this.shieldedElements(result);
1119         try
1120         {
1121             getSourceDependencies1r = (Collection<DependencyFacade>)shieldedResult;
1122         }
1123         catch (ClassCastException ex)
1124         {
1125             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1126             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getSourceDependencies Collection<DependencyFacade> " + result + ": " + shieldedResult);
1127         }
1128         // sourceElement has no post constraints
1129         return getSourceDependencies1r;
1130     }
1131 
1132     /**
1133      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
1134      * @return  Collection
1135      */
1136     protected abstract Collection handleGetSourceDependencies();
1137 
1138     /**
1139      * Gets the element to which the dependencies belong.
1140      * @return (Collection<DependencyFacade>)handleGetTargetDependencies()
1141      */
1142     public final Collection<DependencyFacade> getTargetDependencies()
1143     {
1144         Collection<DependencyFacade> getTargetDependencies2r = null;
1145         // targetElement has no pre constraints
1146         Collection result = handleGetTargetDependencies();
1147         List shieldedResult = this.shieldedElements(result);
1148         try
1149         {
1150             getTargetDependencies2r = (Collection<DependencyFacade>)shieldedResult;
1151         }
1152         catch (ClassCastException ex)
1153         {
1154             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1155             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getTargetDependencies Collection<DependencyFacade> " + result + ": " + shieldedResult);
1156         }
1157         // targetElement has no post constraints
1158         return getTargetDependencies2r;
1159     }
1160 
1161     /**
1162      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
1163      * @return  Collection
1164      */
1165     protected abstract Collection handleGetTargetDependencies();
1166 
1167     /**
1168      * Gets the model element to which the constraint applies (i.e. is the context of).
1169      * @return (Collection<ConstraintFacade>)handleGetConstraints()
1170      */
1171     public final Collection<ConstraintFacade> getConstraints()
1172     {
1173         Collection<ConstraintFacade> getConstraints3r = null;
1174         // contextElement has no pre constraints
1175         Collection result = handleGetConstraints();
1176         List shieldedResult = this.shieldedElements(result);
1177         try
1178         {
1179             getConstraints3r = (Collection<ConstraintFacade>)shieldedResult;
1180         }
1181         catch (ClassCastException ex)
1182         {
1183             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1184             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getConstraints Collection<ConstraintFacade> " + result + ": " + shieldedResult);
1185         }
1186         // contextElement has no post constraints
1187         return getConstraints3r;
1188     }
1189 
1190     /**
1191      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
1192      * @return  Collection
1193      */
1194     protected abstract Collection handleGetConstraints();
1195 
1196     /**
1197      * Represents a model element. It may be an Element or NamedElement. A named element is an
1198      * element in a
1199      * model that may have a name. An element is a constituent of a model. As such, it has the
1200      * capability
1201      * of owning other elements.
1202      * @return (Collection<StereotypeFacade>)handleGetStereotypes()
1203      */
1204     public final Collection<StereotypeFacade> getStereotypes()
1205     {
1206         Collection<StereotypeFacade> getStereotypes4r = null;
1207         // modelElementFacade has no pre constraints
1208         Collection result = handleGetStereotypes();
1209         List shieldedResult = this.shieldedElements(result);
1210         try
1211         {
1212             getStereotypes4r = (Collection<StereotypeFacade>)shieldedResult;
1213         }
1214         catch (ClassCastException ex)
1215         {
1216             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1217             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getStereotypes Collection<StereotypeFacade> " + result + ": " + shieldedResult);
1218         }
1219         // modelElementFacade has no post constraints
1220         return getStereotypes4r;
1221     }
1222 
1223     /**
1224      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
1225      * @return  Collection
1226      */
1227     protected abstract Collection handleGetStereotypes();
1228 
1229     /**
1230      * Represents a model element. It may be an Element or NamedElement. A named element is an
1231      * element in a
1232      * model that may have a name. An element is a constituent of a model. As such, it has the
1233      * capability
1234      * of owning other elements.
1235      * @return (ModelFacade)handleGetModel()
1236      */
1237     public final ModelFacade getModel()
1238     {
1239         ModelFacade getModel5r = null;
1240         // modelElementFacade has no pre constraints
1241         Object result = handleGetModel();
1242         MetafacadeBase shieldedResult = this.shieldedElement(result);
1243         try
1244         {
1245             getModel5r = (ModelFacade)shieldedResult;
1246         }
1247         catch (ClassCastException ex)
1248         {
1249             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1250             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getModel ModelFacade " + result + ": " + shieldedResult);
1251         }
1252         // modelElementFacade has no post constraints
1253         return getModel5r;
1254     }
1255 
1256     /**
1257      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
1258      * @return Object
1259      */
1260     protected abstract Object handleGetModel();
1261 
1262     /**
1263      * Represents a model element. It may be an Element or NamedElement. A named element is an
1264      * element in a
1265      * model that may have a name. An element is a constituent of a model. As such, it has the
1266      * capability
1267      * of owning other elements.
1268      * @return (Collection<TaggedValueFacade>)handleGetTaggedValues()
1269      */
1270     public final Collection<TaggedValueFacade> getTaggedValues()
1271     {
1272         Collection<TaggedValueFacade> getTaggedValues6r = null;
1273         // modelElementFacade has no pre constraints
1274         Collection result = handleGetTaggedValues();
1275         List shieldedResult = this.shieldedElements(result);
1276         try
1277         {
1278             getTaggedValues6r = (Collection<TaggedValueFacade>)shieldedResult;
1279         }
1280         catch (ClassCastException ex)
1281         {
1282             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1283             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getTaggedValues Collection<TaggedValueFacade> " + result + ": " + shieldedResult);
1284         }
1285         // modelElementFacade has no post constraints
1286         return getTaggedValues6r;
1287     }
1288 
1289     /**
1290      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
1291      * @return  Collection
1292      */
1293     protected abstract Collection handleGetTaggedValues();
1294 
1295     /**
1296      * Represents a model element. It may be an Element or NamedElement. A named element is an
1297      * element in a
1298      * model that may have a name. An element is a constituent of a model. As such, it has the
1299      * capability
1300      * of owning other elements.
1301      * @return (Collection<TemplateParameterFacade>)handleGetTemplateParameters()
1302      */
1303     public final Collection<TemplateParameterFacade> getTemplateParameters()
1304     {
1305         Collection<TemplateParameterFacade> getTemplateParameters7r = null;
1306         // modelElementFacade has no pre constraints
1307         Collection result = handleGetTemplateParameters();
1308         List shieldedResult = this.shieldedElements(result);
1309         try
1310         {
1311             getTemplateParameters7r = (Collection<TemplateParameterFacade>)shieldedResult;
1312         }
1313         catch (ClassCastException ex)
1314         {
1315             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1316             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getTemplateParameters Collection<TemplateParameterFacade> " + result + ": " + shieldedResult);
1317         }
1318         // modelElementFacade has no post constraints
1319         return getTemplateParameters7r;
1320     }
1321 
1322     /**
1323      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
1324      * @return  Collection
1325      */
1326     protected abstract Collection handleGetTemplateParameters();
1327 
1328     /**
1329      * Represents a model element. It may be an Element or NamedElement. A named element is an
1330      * element in a
1331      * model that may have a name. An element is a constituent of a model. As such, it has the
1332      * capability
1333      * of owning other elements.
1334      * @return (ModelElementFacade)handleGetPackage()
1335      */
1336     public final ModelElementFacade getPackage()
1337     {
1338         ModelElementFacade getPackage8r = null;
1339         // modelElementFacade has no pre constraints
1340         Object result = handleGetPackage();
1341         MetafacadeBase shieldedResult = this.shieldedElement(result);
1342         try
1343         {
1344             getPackage8r = (ModelElementFacade)shieldedResult;
1345         }
1346         catch (ClassCastException ex)
1347         {
1348             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1349             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getPackage ModelElementFacade " + result + ": " + shieldedResult);
1350         }
1351         // modelElementFacade has no post constraints
1352         return getPackage8r;
1353     }
1354 
1355     /**
1356      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
1357      * @return Object
1358      */
1359     protected abstract Object handleGetPackage();
1360 
1361     /**
1362      * Gets all the model elements belonging to the root package.
1363      * @return (PackageFacade)handleGetRootPackage()
1364      */
1365     public final PackageFacade getRootPackage()
1366     {
1367         PackageFacade getRootPackage9r = null;
1368         // modelElements has no pre constraints
1369         Object result = handleGetRootPackage();
1370         MetafacadeBase shieldedResult = this.shieldedElement(result);
1371         try
1372         {
1373             getRootPackage9r = (PackageFacade)shieldedResult;
1374         }
1375         catch (ClassCastException ex)
1376         {
1377             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1378             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getRootPackage PackageFacade " + result + ": " + shieldedResult);
1379         }
1380         // modelElements has no post constraints
1381         return getRootPackage9r;
1382     }
1383 
1384     /**
1385      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
1386      * @return Object
1387      */
1388     protected abstract Object handleGetRootPackage();
1389 
1390     /**
1391      * Represents a model element. It may be an Element or NamedElement. A named element is an
1392      * element in a
1393      * model that may have a name. An element is a constituent of a model. As such, it has the
1394      * capability
1395      * of owning other elements.
1396      * @return (StateMachineFacade)handleGetStateMachineContext()
1397      */
1398     public final StateMachineFacade getStateMachineContext()
1399     {
1400         StateMachineFacade getStateMachineContext10r = null;
1401         // contextElement has no pre constraints
1402         Object result = handleGetStateMachineContext();
1403         MetafacadeBase shieldedResult = this.shieldedElement(result);
1404         try
1405         {
1406             getStateMachineContext10r = (StateMachineFacade)shieldedResult;
1407         }
1408         catch (ClassCastException ex)
1409         {
1410             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
1411             ModelElementFacadeLogic.logger.warn("incorrect metafacade cast for ModelElementFacadeLogic.getStateMachineContext StateMachineFacade " + result + ": " + shieldedResult);
1412         }
1413         // contextElement has no post constraints
1414         return getStateMachineContext10r;
1415     }
1416 
1417     /**
1418      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
1419      * @return Object
1420      */
1421     protected abstract Object handleGetStateMachineContext();
1422 
1423     /**
1424      * @param validationMessages Collection<ModelValidationMessage>
1425      * @see MetafacadeBase#validateInvariants(Collection validationMessages)
1426      */
1427     @Override
1428     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1429     {
1430     }
1431 
1432     /**
1433      * The property that stores the name of the metafacade.
1434      */
1435     private static final String NAME_PROPERTY = "name";
1436     private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1437 
1438     /**
1439      * @see Object#toString()
1440      */
1441     @Override
1442     public String toString()
1443     {
1444         final StringBuilder toString = new StringBuilder(this.getClass().getName());
1445         toString.append("[");
1446         try
1447         {
1448             toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1449         }
1450         catch (final Throwable tryAgain)
1451         {
1452             try
1453             {
1454                 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1455             }
1456             catch (final Throwable ignore)
1457             {
1458                 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1459             }
1460         }
1461         toString.append("]");
1462         return toString.toString();
1463     }
1464 }