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