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