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