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