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