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