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.ConstraintFacade;
015import org.andromda.metafacades.uml.DependencyFacade;
016import org.andromda.metafacades.uml.EntityAssociation;
017import org.andromda.metafacades.uml.GeneralizableElementFacade;
018import org.andromda.metafacades.uml.GeneralizationFacade;
019import org.andromda.metafacades.uml.ModelElementFacade;
020import org.andromda.metafacades.uml.ModelFacade;
021import org.andromda.metafacades.uml.PackageFacade;
022import org.andromda.metafacades.uml.StateMachineFacade;
023import org.andromda.metafacades.uml.StereotypeFacade;
024import org.andromda.metafacades.uml.TaggedValueFacade;
025import org.andromda.metafacades.uml.TemplateParameterFacade;
026import org.andromda.metafacades.uml.TypeMappings;
027
028/**
029 * Represents an association between two EJBs.
030 * MetafacadeLogic for EJB3AssociationFacade
031 *
032 * @see EJB3AssociationFacade
033 */
034public abstract class EJB3AssociationFacadeLogic
035    extends MetafacadeBase
036    implements EJB3AssociationFacade
037{
038    /**
039     * The underlying UML object
040     * @see Object
041     */
042    protected Object metaObject;
043
044    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
045     * @param metaObjectIn
046     * @param context
047     */
048    protected EJB3AssociationFacadeLogic(Object metaObjectIn, String context)
049    {
050        super(metaObjectIn, getContext(context));
051        this.superEntityAssociation =
052           (EntityAssociation)
053            MetafacadeFactory.getInstance().createFacadeImpl(
054                    "org.andromda.metafacades.uml.EntityAssociation",
055                    metaObjectIn,
056                    getContext(context));
057        this.metaObject = metaObjectIn;
058    }
059
060    /**
061     * Gets the context for this metafacade logic instance.
062     * @param context String. Set to EJB3AssociationFacade if null
063     * @return context String
064     */
065    private static String getContext(String context)
066    {
067        if (context == null)
068        {
069            context = "org.andromda.cartridges.ejb3.metafacades.EJB3AssociationFacade";
070        }
071        return context;
072    }
073
074    private EntityAssociation superEntityAssociation;
075    private boolean superEntityAssociationInitialized = false;
076
077    /**
078     * Gets the EntityAssociation parent instance.
079     * @return this.superEntityAssociation EntityAssociation
080     */
081    private EntityAssociation getSuperEntityAssociation()
082    {
083        if (!this.superEntityAssociationInitialized)
084        {
085            ((MetafacadeBase)this.superEntityAssociation).setMetafacadeContext(this.getMetafacadeContext());
086            this.superEntityAssociationInitialized = true;
087        }
088        return this.superEntityAssociation;
089    }
090
091    /** Reset context only for non-root metafacades
092     * @param context
093     * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context)
094     */
095    @Override
096    public void resetMetafacadeContext(String context)
097    {
098        if (!this.contextRoot) // reset context only for non-root metafacades
099        {
100            context = getContext(context);  // to have same value as in original constructor call
101            setMetafacadeContext (context);
102            if (this.superEntityAssociationInitialized)
103            {
104                ((MetafacadeBase)this.superEntityAssociation).resetMetafacadeContext(context);
105            }
106        }
107    }
108
109    /**
110     * @return boolean true always
111     * @see EJB3AssociationFacade
112     */
113    public boolean isEJB3AssociationFacadeMetaType()
114    {
115        return true;
116    }
117
118    /**
119     * @return true
120     * @see EntityAssociation
121     */
122    public boolean isEntityAssociationMetaType()
123    {
124        return true;
125    }
126
127    /**
128     * @return true
129     * @see org.andromda.metafacades.uml.AssociationFacade
130     */
131    public boolean isAssociationFacadeMetaType()
132    {
133        return true;
134    }
135
136    /**
137     * @return true
138     * @see GeneralizableElementFacade
139     */
140    public boolean isGeneralizableElementFacadeMetaType()
141    {
142        return true;
143    }
144
145    /**
146     * @return true
147     * @see ModelElementFacade
148     */
149    public boolean isModelElementFacadeMetaType()
150    {
151        return true;
152    }
153
154    // ----------- delegates to EntityAssociation ------------
155    /**
156     * The first association end.
157     * @see org.andromda.metafacades.uml.AssociationFacade#getAssociationEndA()
158     */
159    public AssociationEndFacade getAssociationEndA()
160    {
161        return this.getSuperEntityAssociation().getAssociationEndA();
162    }
163
164    /**
165     * The second association end.
166     * @see org.andromda.metafacades.uml.AssociationFacade#getAssociationEndB()
167     */
168    public AssociationEndFacade getAssociationEndB()
169    {
170        return this.getSuperEntityAssociation().getAssociationEndB();
171    }
172
173    /**
174     * Gets the association ends belonging to this association.
175     * @see org.andromda.metafacades.uml.AssociationFacade#getAssociationEnds()
176     */
177    public List<AssociationEndFacade> getAssociationEnds()
178    {
179        return this.getSuperEntityAssociation().getAssociationEnds();
180    }
181
182    /**
183     * A name suited for naming this relationship. This name will be constructed from both
184     * association ends.
185     * @see org.andromda.metafacades.uml.AssociationFacade#getRelationName()
186     */
187    public String getRelationName()
188    {
189        return this.getSuperEntityAssociation().getRelationName();
190    }
191
192    /**
193     * Indicates if this association is 'abstract'.
194     * @see org.andromda.metafacades.uml.AssociationFacade#isAbstract()
195     */
196    public boolean isAbstract()
197    {
198        return this.getSuperEntityAssociation().isAbstract();
199    }
200
201    /**
202     * True if the AssociationFacade is an AssociationClass.
203     * @see org.andromda.metafacades.uml.AssociationFacade#isAssociationClass()
204     */
205    public boolean isAssociationClass()
206    {
207        return this.getSuperEntityAssociation().isAssociationClass();
208    }
209
210    /**
211     * UML2: Determines whether this association is a binary association, i.e. whether it has
212     * exactly two member ends. UML2 allows association classes in the association itself (many2many
213     * with association attributes). Default=true: only two member ends.
214     * @see org.andromda.metafacades.uml.AssociationFacade#isBinary()
215     */
216    public boolean isBinary()
217    {
218        return this.getSuperEntityAssociation().isBinary();
219    }
220
221    /**
222     * UML2: Returns the value of the 'Is Derived' attribute. The default value is "false". If
223     * isDerived is true, the value of the attribute is derived from information elsewhere.
224     * Specifies whether the Property is derived, i.e., whether its value or values can be computed
225     * from other information.
226     * @see org.andromda.metafacades.uml.AssociationFacade#isDerived()
227     */
228    public boolean isDerived()
229    {
230        return this.getSuperEntityAssociation().isDerived();
231    }
232
233    /**
234     * True if this association cannot be extended and represent a leaf in the inheritance tree.
235     * @see org.andromda.metafacades.uml.AssociationFacade#isLeaf()
236     */
237    public boolean isLeaf()
238    {
239        return this.getSuperEntityAssociation().isLeaf();
240    }
241
242    /**
243     * Indicates whether or not this associations represents a many-to-many relation.
244     * @see org.andromda.metafacades.uml.AssociationFacade#isMany2Many()
245     */
246    public boolean isMany2Many()
247    {
248        return this.getSuperEntityAssociation().isMany2Many();
249    }
250
251    /**
252     * The name of the schema that contains the database table
253     * @see EntityAssociation#getSchema()
254     */
255    public String getSchema()
256    {
257        return this.getSuperEntityAssociation().getSchema();
258    }
259
260    /**
261     * The name of the table if this is a many-to-many association.  Otherwise it just returns null
262     * if not part of a many-to-many association.
263     * @see EntityAssociation#getTableName()
264     */
265    public String getTableName()
266    {
267        return this.getSuperEntityAssociation().getTableName();
268    }
269
270    /**
271     * is this an EntityAssociation?
272     * @see EntityAssociation#isEntityAssociation()
273     */
274    public boolean isEntityAssociation()
275    {
276        return this.getSuperEntityAssociation().isEntityAssociation();
277    }
278
279    /**
280     * Finds the tagged value optional searching the entire inheritance hierarchy if 'follow' is set
281     * to true.
282     * @see GeneralizableElementFacade#findTaggedValue(String tagName, boolean follow)
283     */
284    public Object findTaggedValue(String tagName, boolean follow)
285    {
286        return this.getSuperEntityAssociation().findTaggedValue(tagName, follow);
287    }
288
289    /**
290     * All generalizations for this generalizable element, goes up the inheritance tree.
291     * @see GeneralizableElementFacade#getAllGeneralizations()
292     */
293    public Collection<GeneralizableElementFacade> getAllGeneralizations()
294    {
295        return this.getSuperEntityAssociation().getAllGeneralizations();
296    }
297
298    /**
299     * All specializations (travels down the inheritance hierarchy).
300     * @see GeneralizableElementFacade#getAllSpecializations()
301     */
302    public Collection<GeneralizableElementFacade> getAllSpecializations()
303    {
304        return this.getSuperEntityAssociation().getAllSpecializations();
305    }
306
307    /**
308     * Gets the direct generalization for this generalizable element.
309     * @see GeneralizableElementFacade#getGeneralization()
310     */
311    public GeneralizableElementFacade getGeneralization()
312    {
313        return this.getSuperEntityAssociation().getGeneralization();
314    }
315
316    /**
317     * Gets the actual links that this generalization element is part of (it plays either the
318     * specialization or generalization).
319     * @see GeneralizableElementFacade#getGeneralizationLinks()
320     */
321    public Collection<GeneralizationFacade> getGeneralizationLinks()
322    {
323        return this.getSuperEntityAssociation().getGeneralizationLinks();
324    }
325
326    /**
327     * A comma separated list of the fully qualified names of all generalizations.
328     * @see GeneralizableElementFacade#getGeneralizationList()
329     */
330    public String getGeneralizationList()
331    {
332        return this.getSuperEntityAssociation().getGeneralizationList();
333    }
334
335    /**
336     * The element found when you recursively follow the generalization path up to the root. If an
337     * element has no generalization itself will be considered the root.
338     * @see GeneralizableElementFacade#getGeneralizationRoot()
339     */
340    public GeneralizableElementFacade getGeneralizationRoot()
341    {
342        return this.getSuperEntityAssociation().getGeneralizationRoot();
343    }
344
345    /**
346     * Return all generalizations (ancestors) from this generalizable element.
347     * @see GeneralizableElementFacade#getGeneralizations()
348     */
349    public Collection<GeneralizableElementFacade> getGeneralizations()
350    {
351        return this.getSuperEntityAssociation().getGeneralizations();
352    }
353
354    /**
355     * Gets the direct specializations (i.e. sub elements) for this generalizatble element.
356     * @see GeneralizableElementFacade#getSpecializations()
357     */
358    public Collection<GeneralizableElementFacade> getSpecializations()
359    {
360        return this.getSuperEntityAssociation().getSpecializations();
361    }
362
363    /**
364     * Copies all tagged values from the given ModelElementFacade to this model element facade.
365     * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
366     */
367    public void copyTaggedValues(ModelElementFacade element)
368    {
369        this.getSuperEntityAssociation().copyTaggedValues(element);
370    }
371
372    /**
373     * Finds the tagged value with the specified 'tagName'. In case there are more values the first
374     * one found will be returned.
375     * @see ModelElementFacade#findTaggedValue(String tagName)
376     */
377    public Object findTaggedValue(String tagName)
378    {
379        return this.getSuperEntityAssociation().findTaggedValue(tagName);
380    }
381
382    /**
383     * Returns all the values for the tagged value with the specified name. The returned collection
384     * will contains only String instances, or will be empty. Never null.
385     * @see ModelElementFacade#findTaggedValues(String tagName)
386     */
387    public Collection<Object> findTaggedValues(String tagName)
388    {
389        return this.getSuperEntityAssociation().findTaggedValues(tagName);
390    }
391
392    /**
393     * Returns the fully qualified name of the model element. The fully qualified name includes
394     * complete package qualified name of the underlying model element. The templates parameter will
395     * be replaced by the correct one given the binding relation of the parameter to this element.
396     * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
397     */
398    public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
399    {
400        return this.getSuperEntityAssociation().getBindedFullyQualifiedName(bindedElement);
401    }
402
403    /**
404     * Gets all constraints belonging to the model element.
405     * @see ModelElementFacade#getConstraints()
406     */
407    public Collection<ConstraintFacade> getConstraints()
408    {
409        return this.getSuperEntityAssociation().getConstraints();
410    }
411
412    /**
413     * Returns the constraints of the argument kind that have been placed onto this model. Typical
414     * kinds are "inv", "pre" and "post". Other kinds are possible.
415     * @see ModelElementFacade#getConstraints(String kind)
416     */
417    public Collection<ConstraintFacade> getConstraints(String kind)
418    {
419        return this.getSuperEntityAssociation().getConstraints(kind);
420    }
421
422    /**
423     * Gets the documentation for the model element, The indent argument is prefixed to each line.
424     * By default this method wraps lines after 64 characters.
425     * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
426     * @see ModelElementFacade#getDocumentation(String indent)
427     */
428    public String getDocumentation(String indent)
429    {
430        return this.getSuperEntityAssociation().getDocumentation(indent);
431    }
432
433    /**
434     * This method returns the documentation for this model element, with the lines wrapped after
435     * the specified number of characters, values of less than 1 will indicate no line wrapping is
436     * required. By default paragraphs are returned as HTML.
437     * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
438     * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
439     */
440    public String getDocumentation(String indent, int lineLength)
441    {
442        return this.getSuperEntityAssociation().getDocumentation(indent, lineLength);
443    }
444
445    /**
446     * This method returns the documentation for this model element, with the lines wrapped after
447     * the specified number of characters, values of less than 1 will indicate no line wrapping is
448     * required. HTML style determines if HTML Escaping is applied.
449     * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
450     */
451    public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
452    {
453        return this.getSuperEntityAssociation().getDocumentation(indent, lineLength, htmlStyle);
454    }
455
456    /**
457     * The fully qualified name of this model element.
458     * @see ModelElementFacade#getFullyQualifiedName()
459     */
460    public String getFullyQualifiedName()
461    {
462        return this.getSuperEntityAssociation().getFullyQualifiedName();
463    }
464
465    /**
466     * Returns the fully qualified name of the model element. The fully qualified name includes
467     * complete package qualified name of the underlying model element.  If modelName is true, then
468     * the original name of the model element (the name contained within the model) will be the name
469     * returned, otherwise a name from a language mapping will be returned.
470     * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
471     */
472    public String getFullyQualifiedName(boolean modelName)
473    {
474        return this.getSuperEntityAssociation().getFullyQualifiedName(modelName);
475    }
476
477    /**
478     * Returns the fully qualified name as a path, the returned value always starts with out a slash
479     * '/'.
480     * @see ModelElementFacade#getFullyQualifiedNamePath()
481     */
482    public String getFullyQualifiedNamePath()
483    {
484        return this.getSuperEntityAssociation().getFullyQualifiedNamePath();
485    }
486
487    /**
488     * Gets the unique identifier of the underlying model element.
489     * @see ModelElementFacade#getId()
490     */
491    public String getId()
492    {
493        return this.getSuperEntityAssociation().getId();
494    }
495
496    /**
497     * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
498     * are not represented by other properties, i.e. native, transient, volatile, synchronized,
499     * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
500     * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
501     * JDK5 compiler level.
502     * @see ModelElementFacade#getKeywords()
503     */
504    public Collection<String> getKeywords()
505    {
506        return this.getSuperEntityAssociation().getKeywords();
507    }
508
509    /**
510     * UML2: Retrieves a localized label for this named element.
511     * @see ModelElementFacade#getLabel()
512     */
513    public String getLabel()
514    {
515        return this.getSuperEntityAssociation().getLabel();
516    }
517
518    /**
519     * The language mappings that have been set for this model element.
520     * @see ModelElementFacade#getLanguageMappings()
521     */
522    public TypeMappings getLanguageMappings()
523    {
524        return this.getSuperEntityAssociation().getLanguageMappings();
525    }
526
527    /**
528     * Return the model containing this model element (multiple models may be loaded and processed
529     * at the same time).
530     * @see ModelElementFacade#getModel()
531     */
532    public ModelFacade getModel()
533    {
534        return this.getSuperEntityAssociation().getModel();
535    }
536
537    /**
538     * The name of the model element.
539     * @see ModelElementFacade#getName()
540     */
541    public String getName()
542    {
543        return this.getSuperEntityAssociation().getName();
544    }
545
546    /**
547     * Gets the package to which this model element belongs.
548     * @see ModelElementFacade#getPackage()
549     */
550    public ModelElementFacade getPackage()
551    {
552        return this.getSuperEntityAssociation().getPackage();
553    }
554
555    /**
556     * The name of this model element's package.
557     * @see ModelElementFacade#getPackageName()
558     */
559    public String getPackageName()
560    {
561        return this.getSuperEntityAssociation().getPackageName();
562    }
563
564    /**
565     * Gets the package name (optionally providing the ability to retrieve the model name and not
566     * the mapped name).
567     * @see ModelElementFacade#getPackageName(boolean modelName)
568     */
569    public String getPackageName(boolean modelName)
570    {
571        return this.getSuperEntityAssociation().getPackageName(modelName);
572    }
573
574    /**
575     * Returns the package as a path, the returned value always starts with out a slash '/'.
576     * @see ModelElementFacade#getPackagePath()
577     */
578    public String getPackagePath()
579    {
580        return this.getSuperEntityAssociation().getPackagePath();
581    }
582
583    /**
584     * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
585     * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
586     * the names of the containing namespaces starting at the root of the hierarchy and ending with
587     * the name of the NamedElement itself.
588     * @see ModelElementFacade#getQualifiedName()
589     */
590    public String getQualifiedName()
591    {
592        return this.getSuperEntityAssociation().getQualifiedName();
593    }
594
595    /**
596     * Gets the root package for the model element.
597     * @see ModelElementFacade#getRootPackage()
598     */
599    public PackageFacade getRootPackage()
600    {
601        return this.getSuperEntityAssociation().getRootPackage();
602    }
603
604    /**
605     * Gets the dependencies for which this model element is the source.
606     * @see ModelElementFacade#getSourceDependencies()
607     */
608    public Collection<DependencyFacade> getSourceDependencies()
609    {
610        return this.getSuperEntityAssociation().getSourceDependencies();
611    }
612
613    /**
614     * If this model element is the context of an activity graph, this represents that activity
615     * graph.
616     * @see ModelElementFacade#getStateMachineContext()
617     */
618    public StateMachineFacade getStateMachineContext()
619    {
620        return this.getSuperEntityAssociation().getStateMachineContext();
621    }
622
623    /**
624     * The collection of ALL stereotype names for this model element.
625     * @see ModelElementFacade#getStereotypeNames()
626     */
627    public Collection<String> getStereotypeNames()
628    {
629        return this.getSuperEntityAssociation().getStereotypeNames();
630    }
631
632    /**
633     * Gets all stereotypes for this model element.
634     * @see ModelElementFacade#getStereotypes()
635     */
636    public Collection<StereotypeFacade> getStereotypes()
637    {
638        return this.getSuperEntityAssociation().getStereotypes();
639    }
640
641    /**
642     * Return the TaggedValues associated with this model element, under all stereotypes.
643     * @see ModelElementFacade#getTaggedValues()
644     */
645    public Collection<TaggedValueFacade> getTaggedValues()
646    {
647        return this.getSuperEntityAssociation().getTaggedValues();
648    }
649
650    /**
651     * Gets the dependencies for which this model element is the target.
652     * @see ModelElementFacade#getTargetDependencies()
653     */
654    public Collection<DependencyFacade> getTargetDependencies()
655    {
656        return this.getSuperEntityAssociation().getTargetDependencies();
657    }
658
659    /**
660     * Get the template parameter for this model element having the parameterName
661     * @see ModelElementFacade#getTemplateParameter(String parameterName)
662     */
663    public Object getTemplateParameter(String parameterName)
664    {
665        return this.getSuperEntityAssociation().getTemplateParameter(parameterName);
666    }
667
668    /**
669     * Get the template parameters for this model element
670     * @see ModelElementFacade#getTemplateParameters()
671     */
672    public Collection<TemplateParameterFacade> getTemplateParameters()
673    {
674        return this.getSuperEntityAssociation().getTemplateParameters();
675    }
676
677    /**
678     * The visibility (i.e. public, private, protected or package) of the model element, will
679     * attempt a lookup for these values in the language mappings (if any).
680     * @see ModelElementFacade#getVisibility()
681     */
682    public String getVisibility()
683    {
684        return this.getSuperEntityAssociation().getVisibility();
685    }
686
687    /**
688     * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
689     * is taken into account when searching for the stereotype), false otherwise.
690     * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
691     */
692    public boolean hasExactStereotype(String stereotypeName)
693    {
694        return this.getSuperEntityAssociation().hasExactStereotype(stereotypeName);
695    }
696
697    /**
698     * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
699     * pipe, semicolon, or << >>
700     * @see ModelElementFacade#hasKeyword(String keywordName)
701     */
702    public boolean hasKeyword(String keywordName)
703    {
704        return this.getSuperEntityAssociation().hasKeyword(keywordName);
705    }
706
707    /**
708     * Returns true if the model element has the specified stereotype.  If the stereotype itself
709     * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
710     * one of the stereotype's ancestors has a matching name this method will return true, false
711     * otherwise.
712     * For example, if we have a certain stereotype called <<exception>> and a model element has a
713     * stereotype called <<applicationException>> which extends <<exception>>, when calling this
714     * method with 'stereotypeName' defined as 'exception' the method would return true since
715     * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
716     * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
717     * @see ModelElementFacade#hasStereotype(String stereotypeName)
718     */
719    public boolean hasStereotype(String stereotypeName)
720    {
721        return this.getSuperEntityAssociation().hasStereotype(stereotypeName);
722    }
723
724    /**
725     * True if there are target dependencies from this element that are instances of BindingFacade.
726     * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
727     * @see ModelElementFacade#isBindingDependenciesPresent()
728     */
729    public boolean isBindingDependenciesPresent()
730    {
731        return this.getSuperEntityAssociation().isBindingDependenciesPresent();
732    }
733
734    /**
735     * Indicates if any constraints are present on this model element.
736     * @see ModelElementFacade#isConstraintsPresent()
737     */
738    public boolean isConstraintsPresent()
739    {
740        return this.getSuperEntityAssociation().isConstraintsPresent();
741    }
742
743    /**
744     * Indicates if any documentation is present on this model element.
745     * @see ModelElementFacade#isDocumentationPresent()
746     */
747    public boolean isDocumentationPresent()
748    {
749        return this.getSuperEntityAssociation().isDocumentationPresent();
750    }
751
752    /**
753     * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
754     * @see ModelElementFacade#isReservedWord()
755     */
756    public boolean isReservedWord()
757    {
758        return this.getSuperEntityAssociation().isReservedWord();
759    }
760
761    /**
762     * True is there are template parameters on this model element. For UML2, applies to Class,
763     * Operation, Property, and Parameter.
764     * @see ModelElementFacade#isTemplateParametersPresent()
765     */
766    public boolean isTemplateParametersPresent()
767    {
768        return this.getSuperEntityAssociation().isTemplateParametersPresent();
769    }
770
771    /**
772     * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
773     * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
774     * Enumerations and Interfaces, optionally applies on other model elements.
775     * @see ModelElementFacade#isValidIdentifierName()
776     */
777    public boolean isValidIdentifierName()
778    {
779        return this.getSuperEntityAssociation().isValidIdentifierName();
780    }
781
782    /**
783     * Searches for the constraint with the specified 'name' on this model element, and if found
784     * translates it using the specified 'translation' from a translation library discovered by the
785     * framework.
786     * @see ModelElementFacade#translateConstraint(String name, String translation)
787     */
788    public String translateConstraint(String name, String translation)
789    {
790        return this.getSuperEntityAssociation().translateConstraint(name, translation);
791    }
792
793    /**
794     * Translates all constraints belonging to this model element with the given 'translation'.
795     * @see ModelElementFacade#translateConstraints(String translation)
796     */
797    public String[] translateConstraints(String translation)
798    {
799        return this.getSuperEntityAssociation().translateConstraints(translation);
800    }
801
802    /**
803     * Translates the constraints of the specified 'kind' belonging to this model element.
804     * @see ModelElementFacade#translateConstraints(String kind, String translation)
805     */
806    public String[] translateConstraints(String kind, String translation)
807    {
808        return this.getSuperEntityAssociation().translateConstraints(kind, translation);
809    }
810
811    /**
812     * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
813     */
814    @Override
815    public void initialize()
816    {
817        this.getSuperEntityAssociation().initialize();
818    }
819
820    /**
821     * @return Object getSuperEntityAssociation().getValidationOwner()
822     * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
823     */
824    @Override
825    public Object getValidationOwner()
826    {
827        Object owner = this.getSuperEntityAssociation().getValidationOwner();
828        return owner;
829    }
830
831    /**
832     * @return String getSuperEntityAssociation().getValidationName()
833     * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
834     */
835    @Override
836    public String getValidationName()
837    {
838        String name = this.getSuperEntityAssociation().getValidationName();
839        return name;
840    }
841
842    /**
843     * @param validationMessages Collection<ModelValidationMessage>
844     * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages)
845     */
846    @Override
847    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
848    {
849        this.getSuperEntityAssociation().validateInvariants(validationMessages);
850    }
851
852    /**
853     * The property that stores the name of the metafacade.
854     */
855    private static final String NAME_PROPERTY = "name";
856    private static final String FQNAME_PROPERTY = "fullyQualifiedName";
857
858    /**
859     * @see Object#toString()
860     */
861    @Override
862    public String toString()
863    {
864        final StringBuilder toString = new StringBuilder(this.getClass().getName());
865        toString.append("[");
866        try
867        {
868            toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
869        }
870        catch (final Throwable tryAgain)
871        {
872            try
873            {
874                toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
875            }
876            catch (final Throwable ignore)
877            {
878                // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
879            }
880        }
881        toString.append("]");
882        return toString.toString();
883    }
884}