001// license-header java merge-point
002//
003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
004//
005package org.andromda.cartridges.jbpm.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.ConstraintFacade;
014import org.andromda.metafacades.uml.DependencyFacade;
015import org.andromda.metafacades.uml.EventFacade;
016import org.andromda.metafacades.uml.ModelElementFacade;
017import org.andromda.metafacades.uml.ModelFacade;
018import org.andromda.metafacades.uml.PackageFacade;
019import org.andromda.metafacades.uml.PartitionFacade;
020import org.andromda.metafacades.uml.StateFacade;
021import org.andromda.metafacades.uml.StateMachineFacade;
022import org.andromda.metafacades.uml.StereotypeFacade;
023import org.andromda.metafacades.uml.TaggedValueFacade;
024import org.andromda.metafacades.uml.TemplateParameterFacade;
025import org.andromda.metafacades.uml.TransitionFacade;
026import org.andromda.metafacades.uml.TypeMappings;
027import org.apache.log4j.Logger;
028
029/**
030 * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmEventState
031 * MetafacadeLogic for JBpmEventState
032 *
033 * @see JBpmEventState
034 */
035public abstract class JBpmEventStateLogic
036    extends MetafacadeBase
037    implements JBpmEventState
038{
039    /**
040     * The underlying UML object
041     * @see Object
042     */
043    protected Object metaObject;
044
045    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
046     * @param metaObjectIn
047     * @param context
048     */
049    protected JBpmEventStateLogic(Object metaObjectIn, String context)
050    {
051        super(metaObjectIn, getContext(context));
052        this.superStateFacade =
053           (StateFacade)
054            MetafacadeFactory.getInstance().createFacadeImpl(
055                    "org.andromda.metafacades.uml.StateFacade",
056                    metaObjectIn,
057                    getContext(context));
058        this.superJBpmStateVertex =
059           (JBpmStateVertex)
060            MetafacadeFactory.getInstance().createFacadeImpl(
061                    "org.andromda.cartridges.jbpm.metafacades.JBpmStateVertex",
062                    metaObjectIn,
063                    getContext(context));
064        this.metaObject = metaObjectIn;
065    }
066
067    /**
068     * The logger instance.
069     */
070    private static final Logger logger = Logger.getLogger(JBpmEventStateLogic.class);
071
072    /**
073     * Gets the context for this metafacade logic instance.
074     * @param context String. Set to JBpmEventState if null
075     * @return context String
076     */
077    private static String getContext(String context)
078    {
079        if (context == null)
080        {
081            context = "org.andromda.cartridges.jbpm.metafacades.JBpmEventState";
082        }
083        return context;
084    }
085
086    private StateFacade superStateFacade;
087    private boolean superStateFacadeInitialized = false;
088
089    /**
090     * Gets the StateFacade parent instance.
091     * @return this.superStateFacade StateFacade
092     */
093    protected StateFacade getSuperStateFacade()
094    {
095        if (!this.superStateFacadeInitialized)
096        {
097            ((MetafacadeBase)this.superStateFacade).setMetafacadeContext(this.getMetafacadeContext());
098            this.superStateFacadeInitialized = true;
099        }
100        return this.superStateFacade;
101    }
102
103    private JBpmStateVertex superJBpmStateVertex;
104    private boolean superJBpmStateVertexInitialized = false;
105
106    /**
107     * Gets the JBpmStateVertex parent instance.
108     * @return this.superJBpmStateVertex JBpmStateVertex
109     */
110    protected JBpmStateVertex getSuperJBpmStateVertex()
111    {
112        if (!this.superJBpmStateVertexInitialized)
113        {
114            ((MetafacadeBase)this.superJBpmStateVertex).setMetafacadeContext(this.getMetafacadeContext());
115            this.superJBpmStateVertexInitialized = true;
116        }
117        return this.superJBpmStateVertex;
118    }
119
120    /** Reset context only for non-root metafacades
121     * @param context
122     * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context)
123     */
124    @Override
125    public void resetMetafacadeContext(String context)
126    {
127        if (!this.contextRoot) // reset context only for non-root metafacades
128        {
129            context = getContext(context);  // to have same value as in original constructor call
130            setMetafacadeContext (context);
131            if (this.superStateFacadeInitialized)
132            {
133                ((MetafacadeBase)this.superStateFacade).resetMetafacadeContext(context);
134            }
135            if (this.superJBpmStateVertexInitialized)
136            {
137                ((MetafacadeBase)this.superJBpmStateVertex).resetMetafacadeContext(context);
138            }
139        }
140    }
141
142    /**
143     * @return boolean true always
144     * @see JBpmEventState
145     */
146    public boolean isJBpmEventStateMetaType()
147    {
148        return true;
149    }
150
151    // ------------- associations ------------------
152
153    private List<JBpmAction> __getNodeEnters1r;
154    private boolean __getNodeEnters1rSet = false;
155
156    /**
157     * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmEventState
158     * @return (List<JBpmAction>)handleGetNodeEnters()
159     */
160    public final List<JBpmAction> getNodeEnters()
161    {
162        List<JBpmAction> getNodeEnters1r = this.__getNodeEnters1r;
163        if (!this.__getNodeEnters1rSet)
164        {
165            // jBpmEventState has no pre constraints
166            List result = handleGetNodeEnters();
167            List shieldedResult = this.shieldedElements(result);
168            try
169            {
170                getNodeEnters1r = (List<JBpmAction>)shieldedResult;
171            }
172            catch (ClassCastException ex)
173            {
174                // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
175                JBpmEventStateLogic.logger.warn("incorrect metafacade cast for JBpmEventStateLogic.getNodeEnters List<JBpmAction> " + result + ": " + shieldedResult);
176            }
177            // jBpmEventState has no post constraints
178            this.__getNodeEnters1r = getNodeEnters1r;
179            if (isMetafacadePropertyCachingEnabled())
180            {
181                this.__getNodeEnters1rSet = true;
182            }
183        }
184        return getNodeEnters1r;
185    }
186
187    /**
188     * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
189     * @return  List
190     */
191    protected abstract List handleGetNodeEnters();
192
193    private List<JBpmAction> __getBeforeSignals2r;
194    private boolean __getBeforeSignals2rSet = false;
195
196    /**
197     * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmEventState
198     * @return (List<JBpmAction>)handleGetBeforeSignals()
199     */
200    public final List<JBpmAction> getBeforeSignals()
201    {
202        List<JBpmAction> getBeforeSignals2r = this.__getBeforeSignals2r;
203        if (!this.__getBeforeSignals2rSet)
204        {
205            // jBpmEventState has no pre constraints
206            List result = handleGetBeforeSignals();
207            List shieldedResult = this.shieldedElements(result);
208            try
209            {
210                getBeforeSignals2r = (List<JBpmAction>)shieldedResult;
211            }
212            catch (ClassCastException ex)
213            {
214                // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
215                JBpmEventStateLogic.logger.warn("incorrect metafacade cast for JBpmEventStateLogic.getBeforeSignals List<JBpmAction> " + result + ": " + shieldedResult);
216            }
217            // jBpmEventState has no post constraints
218            this.__getBeforeSignals2r = getBeforeSignals2r;
219            if (isMetafacadePropertyCachingEnabled())
220            {
221                this.__getBeforeSignals2rSet = true;
222            }
223        }
224        return getBeforeSignals2r;
225    }
226
227    /**
228     * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
229     * @return  List
230     */
231    protected abstract List handleGetBeforeSignals();
232
233    private List<JBpmAction> __getTasks3r;
234    private boolean __getTasks3rSet = false;
235
236    /**
237     * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmEventState
238     * @return (List<JBpmAction>)handleGetTasks()
239     */
240    public final List<JBpmAction> getTasks()
241    {
242        List<JBpmAction> getTasks3r = this.__getTasks3r;
243        if (!this.__getTasks3rSet)
244        {
245            // jBpmEventState has no pre constraints
246            List result = handleGetTasks();
247            List shieldedResult = this.shieldedElements(result);
248            try
249            {
250                getTasks3r = (List<JBpmAction>)shieldedResult;
251            }
252            catch (ClassCastException ex)
253            {
254                // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
255                JBpmEventStateLogic.logger.warn("incorrect metafacade cast for JBpmEventStateLogic.getTasks List<JBpmAction> " + result + ": " + shieldedResult);
256            }
257            // jBpmEventState has no post constraints
258            this.__getTasks3r = getTasks3r;
259            if (isMetafacadePropertyCachingEnabled())
260            {
261                this.__getTasks3rSet = true;
262            }
263        }
264        return getTasks3r;
265    }
266
267    /**
268     * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
269     * @return  List
270     */
271    protected abstract List handleGetTasks();
272
273    private List<JBpmAction> __getTimers4r;
274    private boolean __getTimers4rSet = false;
275
276    /**
277     * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmEventState
278     * @return (List<JBpmAction>)handleGetTimers()
279     */
280    public final List<JBpmAction> getTimers()
281    {
282        List<JBpmAction> getTimers4r = this.__getTimers4r;
283        if (!this.__getTimers4rSet)
284        {
285            // jBpmEventState has no pre constraints
286            List result = handleGetTimers();
287            List shieldedResult = this.shieldedElements(result);
288            try
289            {
290                getTimers4r = (List<JBpmAction>)shieldedResult;
291            }
292            catch (ClassCastException ex)
293            {
294                // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
295                JBpmEventStateLogic.logger.warn("incorrect metafacade cast for JBpmEventStateLogic.getTimers List<JBpmAction> " + result + ": " + shieldedResult);
296            }
297            // jBpmEventState has no post constraints
298            this.__getTimers4r = getTimers4r;
299            if (isMetafacadePropertyCachingEnabled())
300            {
301                this.__getTimers4rSet = true;
302            }
303        }
304        return getTimers4r;
305    }
306
307    /**
308     * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
309     * @return  List
310     */
311    protected abstract List handleGetTimers();
312
313    private List<JBpmAction> __getNodeLeaves5r;
314    private boolean __getNodeLeaves5rSet = false;
315
316    /**
317     * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmEventState
318     * @return (List<JBpmAction>)handleGetNodeLeaves()
319     */
320    public final List<JBpmAction> getNodeLeaves()
321    {
322        List<JBpmAction> getNodeLeaves5r = this.__getNodeLeaves5r;
323        if (!this.__getNodeLeaves5rSet)
324        {
325            // jBpmEventState has no pre constraints
326            List result = handleGetNodeLeaves();
327            List shieldedResult = this.shieldedElements(result);
328            try
329            {
330                getNodeLeaves5r = (List<JBpmAction>)shieldedResult;
331            }
332            catch (ClassCastException ex)
333            {
334                // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
335                JBpmEventStateLogic.logger.warn("incorrect metafacade cast for JBpmEventStateLogic.getNodeLeaves List<JBpmAction> " + result + ": " + shieldedResult);
336            }
337            // jBpmEventState has no post constraints
338            this.__getNodeLeaves5r = getNodeLeaves5r;
339            if (isMetafacadePropertyCachingEnabled())
340            {
341                this.__getNodeLeaves5rSet = true;
342            }
343        }
344        return getNodeLeaves5r;
345    }
346
347    /**
348     * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
349     * @return  List
350     */
351    protected abstract List handleGetNodeLeaves();
352
353    private List<JBpmAction> __getAfterSignals6r;
354    private boolean __getAfterSignals6rSet = false;
355
356    /**
357     * TODO: Model Documentation for org.andromda.cartridges.jbpm.metafacades.JBpmEventState
358     * @return (List<JBpmAction>)handleGetAfterSignals()
359     */
360    public final List<JBpmAction> getAfterSignals()
361    {
362        List<JBpmAction> getAfterSignals6r = this.__getAfterSignals6r;
363        if (!this.__getAfterSignals6rSet)
364        {
365            // jBpmEventState has no pre constraints
366            List result = handleGetAfterSignals();
367            List shieldedResult = this.shieldedElements(result);
368            try
369            {
370                getAfterSignals6r = (List<JBpmAction>)shieldedResult;
371            }
372            catch (ClassCastException ex)
373            {
374                // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
375                JBpmEventStateLogic.logger.warn("incorrect metafacade cast for JBpmEventStateLogic.getAfterSignals List<JBpmAction> " + result + ": " + shieldedResult);
376            }
377            // jBpmEventState has no post constraints
378            this.__getAfterSignals6r = getAfterSignals6r;
379            if (isMetafacadePropertyCachingEnabled())
380            {
381                this.__getAfterSignals6rSet = true;
382            }
383        }
384        return getAfterSignals6r;
385    }
386
387    /**
388     * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
389     * @return  List
390     */
391    protected abstract List handleGetAfterSignals();
392
393    /**
394     * @return true
395     * @see StateFacade
396     */
397    public boolean isStateFacadeMetaType()
398    {
399        return true;
400    }
401
402    /**
403     * @return true
404     * @see JBpmStateVertex
405     */
406    public boolean isJBpmStateVertexMetaType()
407    {
408        return true;
409    }
410
411    /**
412     * @return true
413     * @see org.andromda.metafacades.uml.StateVertexFacade
414     */
415    public boolean isStateVertexFacadeMetaType()
416    {
417        return true;
418    }
419
420    /**
421     * @return true
422     * @see ModelElementFacade
423     */
424    public boolean isModelElementFacadeMetaType()
425    {
426        return true;
427    }
428
429    // ----------- delegates to StateFacade ------------
430    /**
431     * Copies all tagged values from the given ModelElementFacade to this model element facade.
432     * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
433     */
434    public void copyTaggedValues(ModelElementFacade element)
435    {
436        this.getSuperStateFacade().copyTaggedValues(element);
437    }
438
439    /**
440     * Finds the tagged value with the specified 'tagName'. In case there are more values the first
441     * one found will be returned.
442     * @see ModelElementFacade#findTaggedValue(String tagName)
443     */
444    public Object findTaggedValue(String tagName)
445    {
446        return this.getSuperStateFacade().findTaggedValue(tagName);
447    }
448
449    /**
450     * Returns all the values for the tagged value with the specified name. The returned collection
451     * will contains only String instances, or will be empty. Never null.
452     * @see ModelElementFacade#findTaggedValues(String tagName)
453     */
454    public Collection<Object> findTaggedValues(String tagName)
455    {
456        return this.getSuperStateFacade().findTaggedValues(tagName);
457    }
458
459    /**
460     * Returns the fully qualified name of the model element. The fully qualified name includes
461     * complete package qualified name of the underlying model element. The templates parameter will
462     * be replaced by the correct one given the binding relation of the parameter to this element.
463     * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
464     */
465    public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
466    {
467        return this.getSuperStateFacade().getBindedFullyQualifiedName(bindedElement);
468    }
469
470    /**
471     * Gets all constraints belonging to the model element.
472     * @see ModelElementFacade#getConstraints()
473     */
474    public Collection<ConstraintFacade> getConstraints()
475    {
476        return this.getSuperStateFacade().getConstraints();
477    }
478
479    /**
480     * Returns the constraints of the argument kind that have been placed onto this model. Typical
481     * kinds are "inv", "pre" and "post". Other kinds are possible.
482     * @see ModelElementFacade#getConstraints(String kind)
483     */
484    public Collection<ConstraintFacade> getConstraints(String kind)
485    {
486        return this.getSuperStateFacade().getConstraints(kind);
487    }
488
489    /**
490     * Gets the documentation for the model element, The indent argument is prefixed to each line.
491     * By default this method wraps lines after 64 characters.
492     * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
493     * @see ModelElementFacade#getDocumentation(String indent)
494     */
495    public String getDocumentation(String indent)
496    {
497        return this.getSuperStateFacade().getDocumentation(indent);
498    }
499
500    /**
501     * This method returns the documentation for this model element, with the lines wrapped after
502     * the specified number of characters, values of less than 1 will indicate no line wrapping is
503     * required. By default paragraphs are returned as HTML.
504     * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
505     * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
506     */
507    public String getDocumentation(String indent, int lineLength)
508    {
509        return this.getSuperStateFacade().getDocumentation(indent, lineLength);
510    }
511
512    /**
513     * This method returns the documentation for this model element, with the lines wrapped after
514     * the specified number of characters, values of less than 1 will indicate no line wrapping is
515     * required. HTML style determines if HTML Escaping is applied.
516     * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
517     */
518    public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
519    {
520        return this.getSuperStateFacade().getDocumentation(indent, lineLength, htmlStyle);
521    }
522
523    /**
524     * The fully qualified name of this model element.
525     * @see ModelElementFacade#getFullyQualifiedName()
526     */
527    public String getFullyQualifiedName()
528    {
529        return this.getSuperStateFacade().getFullyQualifiedName();
530    }
531
532    /**
533     * Returns the fully qualified name of the model element. The fully qualified name includes
534     * complete package qualified name of the underlying model element.  If modelName is true, then
535     * the original name of the model element (the name contained within the model) will be the name
536     * returned, otherwise a name from a language mapping will be returned.
537     * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
538     */
539    public String getFullyQualifiedName(boolean modelName)
540    {
541        return this.getSuperStateFacade().getFullyQualifiedName(modelName);
542    }
543
544    /**
545     * Returns the fully qualified name as a path, the returned value always starts with out a slash
546     * '/'.
547     * @see ModelElementFacade#getFullyQualifiedNamePath()
548     */
549    public String getFullyQualifiedNamePath()
550    {
551        return this.getSuperStateFacade().getFullyQualifiedNamePath();
552    }
553
554    /**
555     * Gets the unique identifier of the underlying model element.
556     * @see ModelElementFacade#getId()
557     */
558    public String getId()
559    {
560        return this.getSuperStateFacade().getId();
561    }
562
563    /**
564     * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
565     * are not represented by other properties, i.e. native, transient, volatile, synchronized,
566     * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
567     * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
568     * JDK5 compiler level.
569     * @see ModelElementFacade#getKeywords()
570     */
571    public Collection<String> getKeywords()
572    {
573        return this.getSuperStateFacade().getKeywords();
574    }
575
576    /**
577     * UML2: Retrieves a localized label for this named element.
578     * @see ModelElementFacade#getLabel()
579     */
580    public String getLabel()
581    {
582        return this.getSuperStateFacade().getLabel();
583    }
584
585    /**
586     * The language mappings that have been set for this model element.
587     * @see ModelElementFacade#getLanguageMappings()
588     */
589    public TypeMappings getLanguageMappings()
590    {
591        return this.getSuperStateFacade().getLanguageMappings();
592    }
593
594    /**
595     * Return the model containing this model element (multiple models may be loaded and processed
596     * at the same time).
597     * @see ModelElementFacade#getModel()
598     */
599    public ModelFacade getModel()
600    {
601        return this.getSuperStateFacade().getModel();
602    }
603
604    /**
605     * The name of the model element.
606     * @see ModelElementFacade#getName()
607     */
608    public String getName()
609    {
610        return this.getSuperStateFacade().getName();
611    }
612
613    /**
614     * Gets the package to which this model element belongs.
615     * @see ModelElementFacade#getPackage()
616     */
617    public ModelElementFacade getPackage()
618    {
619        return this.getSuperStateFacade().getPackage();
620    }
621
622    /**
623     * The name of this model element's package.
624     * @see ModelElementFacade#getPackageName()
625     */
626    public String getPackageName()
627    {
628        return this.getSuperStateFacade().getPackageName();
629    }
630
631    /**
632     * Gets the package name (optionally providing the ability to retrieve the model name and not
633     * the mapped name).
634     * @see ModelElementFacade#getPackageName(boolean modelName)
635     */
636    public String getPackageName(boolean modelName)
637    {
638        return this.getSuperStateFacade().getPackageName(modelName);
639    }
640
641    /**
642     * Returns the package as a path, the returned value always starts with out a slash '/'.
643     * @see ModelElementFacade#getPackagePath()
644     */
645    public String getPackagePath()
646    {
647        return this.getSuperStateFacade().getPackagePath();
648    }
649
650    /**
651     * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
652     * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
653     * the names of the containing namespaces starting at the root of the hierarchy and ending with
654     * the name of the NamedElement itself.
655     * @see ModelElementFacade#getQualifiedName()
656     */
657    public String getQualifiedName()
658    {
659        return this.getSuperStateFacade().getQualifiedName();
660    }
661
662    /**
663     * Gets the root package for the model element.
664     * @see ModelElementFacade#getRootPackage()
665     */
666    public PackageFacade getRootPackage()
667    {
668        return this.getSuperStateFacade().getRootPackage();
669    }
670
671    /**
672     * Gets the dependencies for which this model element is the source.
673     * @see ModelElementFacade#getSourceDependencies()
674     */
675    public Collection<DependencyFacade> getSourceDependencies()
676    {
677        return this.getSuperStateFacade().getSourceDependencies();
678    }
679
680    /**
681     * If this model element is the context of an activity graph, this represents that activity
682     * graph.
683     * @see ModelElementFacade#getStateMachineContext()
684     */
685    public StateMachineFacade getStateMachineContext()
686    {
687        return this.getSuperStateFacade().getStateMachineContext();
688    }
689
690    /**
691     * The collection of ALL stereotype names for this model element.
692     * @see ModelElementFacade#getStereotypeNames()
693     */
694    public Collection<String> getStereotypeNames()
695    {
696        return this.getSuperStateFacade().getStereotypeNames();
697    }
698
699    /**
700     * Gets all stereotypes for this model element.
701     * @see ModelElementFacade#getStereotypes()
702     */
703    public Collection<StereotypeFacade> getStereotypes()
704    {
705        return this.getSuperStateFacade().getStereotypes();
706    }
707
708    /**
709     * Return the TaggedValues associated with this model element, under all stereotypes.
710     * @see ModelElementFacade#getTaggedValues()
711     */
712    public Collection<TaggedValueFacade> getTaggedValues()
713    {
714        return this.getSuperStateFacade().getTaggedValues();
715    }
716
717    /**
718     * Gets the dependencies for which this model element is the target.
719     * @see ModelElementFacade#getTargetDependencies()
720     */
721    public Collection<DependencyFacade> getTargetDependencies()
722    {
723        return this.getSuperStateFacade().getTargetDependencies();
724    }
725
726    /**
727     * Get the template parameter for this model element having the parameterName
728     * @see ModelElementFacade#getTemplateParameter(String parameterName)
729     */
730    public Object getTemplateParameter(String parameterName)
731    {
732        return this.getSuperStateFacade().getTemplateParameter(parameterName);
733    }
734
735    /**
736     * Get the template parameters for this model element
737     * @see ModelElementFacade#getTemplateParameters()
738     */
739    public Collection<TemplateParameterFacade> getTemplateParameters()
740    {
741        return this.getSuperStateFacade().getTemplateParameters();
742    }
743
744    /**
745     * The visibility (i.e. public, private, protected or package) of the model element, will
746     * attempt a lookup for these values in the language mappings (if any).
747     * @see ModelElementFacade#getVisibility()
748     */
749    public String getVisibility()
750    {
751        return this.getSuperStateFacade().getVisibility();
752    }
753
754    /**
755     * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
756     * is taken into account when searching for the stereotype), false otherwise.
757     * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
758     */
759    public boolean hasExactStereotype(String stereotypeName)
760    {
761        return this.getSuperStateFacade().hasExactStereotype(stereotypeName);
762    }
763
764    /**
765     * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
766     * pipe, semicolon, or << >>
767     * @see ModelElementFacade#hasKeyword(String keywordName)
768     */
769    public boolean hasKeyword(String keywordName)
770    {
771        return this.getSuperStateFacade().hasKeyword(keywordName);
772    }
773
774    /**
775     * Returns true if the model element has the specified stereotype.  If the stereotype itself
776     * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
777     * one of the stereotype's ancestors has a matching name this method will return true, false
778     * otherwise.
779     * For example, if we have a certain stereotype called <<exception>> and a model element has a
780     * stereotype called <<applicationException>> which extends <<exception>>, when calling this
781     * method with 'stereotypeName' defined as 'exception' the method would return true since
782     * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
783     * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
784     * @see ModelElementFacade#hasStereotype(String stereotypeName)
785     */
786    public boolean hasStereotype(String stereotypeName)
787    {
788        return this.getSuperStateFacade().hasStereotype(stereotypeName);
789    }
790
791    /**
792     * True if there are target dependencies from this element that are instances of BindingFacade.
793     * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
794     * @see ModelElementFacade#isBindingDependenciesPresent()
795     */
796    public boolean isBindingDependenciesPresent()
797    {
798        return this.getSuperStateFacade().isBindingDependenciesPresent();
799    }
800
801    /**
802     * Indicates if any constraints are present on this model element.
803     * @see ModelElementFacade#isConstraintsPresent()
804     */
805    public boolean isConstraintsPresent()
806    {
807        return this.getSuperStateFacade().isConstraintsPresent();
808    }
809
810    /**
811     * Indicates if any documentation is present on this model element.
812     * @see ModelElementFacade#isDocumentationPresent()
813     */
814    public boolean isDocumentationPresent()
815    {
816        return this.getSuperStateFacade().isDocumentationPresent();
817    }
818
819    /**
820     * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
821     * @see ModelElementFacade#isReservedWord()
822     */
823    public boolean isReservedWord()
824    {
825        return this.getSuperStateFacade().isReservedWord();
826    }
827
828    /**
829     * True is there are template parameters on this model element. For UML2, applies to Class,
830     * Operation, Property, and Parameter.
831     * @see ModelElementFacade#isTemplateParametersPresent()
832     */
833    public boolean isTemplateParametersPresent()
834    {
835        return this.getSuperStateFacade().isTemplateParametersPresent();
836    }
837
838    /**
839     * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
840     * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
841     * Enumerations and Interfaces, optionally applies on other model elements.
842     * @see ModelElementFacade#isValidIdentifierName()
843     */
844    public boolean isValidIdentifierName()
845    {
846        return this.getSuperStateFacade().isValidIdentifierName();
847    }
848
849    /**
850     * Searches for the constraint with the specified 'name' on this model element, and if found
851     * translates it using the specified 'translation' from a translation library discovered by the
852     * framework.
853     * @see ModelElementFacade#translateConstraint(String name, String translation)
854     */
855    public String translateConstraint(String name, String translation)
856    {
857        return this.getSuperStateFacade().translateConstraint(name, translation);
858    }
859
860    /**
861     * Translates all constraints belonging to this model element with the given 'translation'.
862     * @see ModelElementFacade#translateConstraints(String translation)
863     */
864    public String[] translateConstraints(String translation)
865    {
866        return this.getSuperStateFacade().translateConstraints(translation);
867    }
868
869    /**
870     * Translates the constraints of the specified 'kind' belonging to this model element.
871     * @see ModelElementFacade#translateConstraints(String kind, String translation)
872     */
873    public String[] translateConstraints(String kind, String translation)
874    {
875        return this.getSuperStateFacade().translateConstraints(kind, translation);
876    }
877
878    /**
879     * Events to which is being deferred in this action state.
880     * @see StateFacade#getDeferrableEvents()
881     */
882    public Collection<EventFacade> getDeferrableEvents()
883    {
884        return this.getSuperStateFacade().getDeferrableEvents();
885    }
886
887    /**
888     * Models a situation during which some (usually implicit) invariant condition holds. The states
889     * of
890     * protocol state machines are exposed to the users of their context classifiers. A protocol
891     * state
892     * represents an exposed stable situation of its context classifier: when an instance of the
893     * classifier
894     * is not processing any operation, users of this instance can always know its state
895     * configuration.
896     * @see org.andromda.metafacades.uml.StateVertexFacade#getContainer()
897     */
898    public StateFacade getContainer()
899    {
900        return this.getSuperStateFacade().getContainer();
901    }
902
903    /**
904     * A directed relationship between a source vertex and a target vertex. It may be part of a
905     * compound
906     * transition, which takes the state machine from one state configuration to another,
907     * representing the
908     * complete response of the state machine to an occurrence of an event of a particular type.
909     * @see org.andromda.metafacades.uml.StateVertexFacade#getIncomings()
910     */
911    public Collection<TransitionFacade> getIncomings()
912    {
913        return this.getSuperStateFacade().getIncomings();
914    }
915
916    /**
917     * A directed relationship between a source vertex and a target vertex. It may be part of a
918     * compound
919     * transition, which takes the state machine from one state configuration to another,
920     * representing the
921     * complete response of the state machine to an occurrence of an event of a particular type.
922     * @see org.andromda.metafacades.uml.StateVertexFacade#getOutgoings()
923     */
924    public Collection<TransitionFacade> getOutgoings()
925    {
926        return this.getSuperStateFacade().getOutgoings();
927    }
928
929    /**
930     * The partition (if any) to which this vertex belongs.
931     * @see org.andromda.metafacades.uml.StateVertexFacade#getPartition()
932     */
933    public PartitionFacade getPartition()
934    {
935        return this.getSuperStateFacade().getPartition();
936    }
937
938    /**
939     * State machines can be used to express the behavior of part of a system. Behavior is modeled
940     * as a
941     * traversal of a graph of state nodes interconnected by one or more joined transition arcs that
942     * are
943     * triggered by the dispatching of series of (event) occurrences. During this traversal, the
944     * state
945     * machine executes a series of activities associated with various elements of the state
946     * machine.
947     * @see org.andromda.metafacades.uml.StateVertexFacade#getStateMachine()
948     */
949    public StateMachineFacade getStateMachine()
950    {
951        return this.getSuperStateFacade().getStateMachine();
952    }
953
954    // ----------- delegates to JBpmStateVertex ------------
955    /**
956     * TODO: Model Documentation for
957     * JBpmStateVertex.nodeClassName
958     * @see JBpmStateVertex#getNodeClassName()
959     */
960    public String getNodeClassName()
961    {
962        return this.getSuperJBpmStateVertex().getNodeClassName();
963    }
964
965    /**
966     * TODO: Model Documentation for
967     * JBpmStateVertex.nodePackageName
968     * @see JBpmStateVertex#getNodePackageName()
969     */
970    public String getNodePackageName()
971    {
972        return this.getSuperJBpmStateVertex().getNodePackageName();
973    }
974
975    /**
976     * TODO: Model Documentation for JBpmProcessDefinition
977     * @see JBpmStateVertex#getProcessDefinition()
978     */
979    public JBpmProcessDefinition getProcessDefinition()
980    {
981        return this.getSuperJBpmStateVertex().getProcessDefinition();
982    }
983
984    /**
985     * True if this element is part of a business process usecase.
986     * @see JBpmStateVertex#isContainedInBusinessProcess()
987     */
988    public boolean isContainedInBusinessProcess()
989    {
990        return this.getSuperJBpmStateVertex().isContainedInBusinessProcess();
991    }
992
993    /**
994     * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
995     */
996    @Override
997    public void initialize()
998    {
999        this.getSuperStateFacade().initialize();
1000        this.getSuperJBpmStateVertex().initialize();
1001    }
1002
1003    /**
1004     * @return Object getSuperStateFacade().getValidationOwner()
1005     * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
1006     */
1007    @Override
1008    public Object getValidationOwner()
1009    {
1010        Object owner = this.getSuperStateFacade().getValidationOwner();
1011        if (owner == null)
1012        {
1013            owner = this.getSuperJBpmStateVertex().getValidationOwner();
1014        }
1015        return owner;
1016    }
1017
1018    /**
1019     * @return String getSuperStateFacade().getValidationName()
1020     * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
1021     */
1022    @Override
1023    public String getValidationName()
1024    {
1025        String name = this.getSuperStateFacade().getValidationName();
1026        if (name == null)
1027        {
1028            name = this.getSuperJBpmStateVertex().getValidationName();
1029        }
1030        return name;
1031    }
1032
1033    /**
1034     * @param validationMessages Collection<ModelValidationMessage>
1035     * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages)
1036     */
1037    @Override
1038    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1039    {
1040        this.getSuperStateFacade().validateInvariants(validationMessages);
1041        this.getSuperJBpmStateVertex().validateInvariants(validationMessages);
1042    }
1043
1044    /**
1045     * The property that stores the name of the metafacade.
1046     */
1047    private static final String NAME_PROPERTY = "name";
1048    private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1049
1050    /**
1051     * @see Object#toString()
1052     */
1053    @Override
1054    public String toString()
1055    {
1056        final StringBuilder toString = new StringBuilder(this.getClass().getName());
1057        toString.append("[");
1058        try
1059        {
1060            toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1061        }
1062        catch (final Throwable tryAgain)
1063        {
1064            try
1065            {
1066                toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1067            }
1068            catch (final Throwable ignore)
1069            {
1070                // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1071            }
1072        }
1073        toString.append("]");
1074        return toString.toString();
1075    }
1076}