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.jsf.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.ActionFacade;
14  import org.andromda.metafacades.uml.ConstraintFacade;
15  import org.andromda.metafacades.uml.DependencyFacade;
16  import org.andromda.metafacades.uml.EventFacade;
17  import org.andromda.metafacades.uml.FrontEndAction;
18  import org.andromda.metafacades.uml.FrontEndExceptionHandler;
19  import org.andromda.metafacades.uml.FrontEndForward;
20  import org.andromda.metafacades.uml.FrontEndParameter;
21  import org.andromda.metafacades.uml.FrontEndUseCase;
22  import org.andromda.metafacades.uml.FrontEndView;
23  import org.andromda.metafacades.uml.ModelElementFacade;
24  import org.andromda.metafacades.uml.ModelFacade;
25  import org.andromda.metafacades.uml.OperationFacade;
26  import org.andromda.metafacades.uml.PackageFacade;
27  import org.andromda.metafacades.uml.PartitionFacade;
28  import org.andromda.metafacades.uml.StateFacade;
29  import org.andromda.metafacades.uml.StateMachineFacade;
30  import org.andromda.metafacades.uml.StereotypeFacade;
31  import org.andromda.metafacades.uml.TaggedValueFacade;
32  import org.andromda.metafacades.uml.TemplateParameterFacade;
33  import org.andromda.metafacades.uml.TransitionFacade;
34  import org.andromda.metafacades.uml.TypeMappings;
35  import org.andromda.translation.ocl.validation.OCLCollections;
36  import org.andromda.translation.ocl.validation.OCLIntrospector;
37  import org.andromda.translation.ocl.validation.OCLResultEnsurer;
38  import org.apache.commons.collections.Transformer;
39  import org.apache.log4j.Logger;
40  
41  /**
42   * Represents a JSF view for a front-end application.
43   * MetafacadeLogic for JSFView
44   *
45   * @see JSFView
46   */
47  public abstract class JSFViewLogic
48      extends MetafacadeBase
49      implements JSFView
50  {
51      /**
52       * The underlying UML object
53       * @see Object
54       */
55      protected Object metaObject;
56  
57      /** Create Metafacade implementation instance using the MetafacadeFactory from the context
58       * @param metaObjectIn
59       * @param context
60       */
61      protected JSFViewLogic(Object metaObjectIn, String context)
62      {
63          super(metaObjectIn, getContext(context));
64          this.superFrontEndView =
65             (FrontEndView)
66              MetafacadeFactory.getInstance().createFacadeImpl(
67                      "org.andromda.metafacades.uml.FrontEndView",
68                      metaObjectIn,
69                      getContext(context));
70          this.metaObject = metaObjectIn;
71      }
72  
73      /**
74       * The logger instance.
75       */
76      private static final Logger logger = Logger.getLogger(JSFViewLogic.class);
77  
78      /**
79       * Gets the context for this metafacade logic instance.
80       * @param context String. Set to JSFView if null
81       * @return context String
82       */
83      private static String getContext(String context)
84      {
85          if (context == null)
86          {
87              context = "org.andromda.cartridges.jsf.metafacades.JSFView";
88          }
89          return context;
90      }
91  
92      private FrontEndView superFrontEndView;
93      private boolean superFrontEndViewInitialized = false;
94  
95      /**
96       * Gets the FrontEndView parent instance.
97       * @return this.superFrontEndView FrontEndView
98       */
99      private FrontEndView getSuperFrontEndView()
100     {
101         if (!this.superFrontEndViewInitialized)
102         {
103             ((MetafacadeBase)this.superFrontEndView).setMetafacadeContext(this.getMetafacadeContext());
104             this.superFrontEndViewInitialized = true;
105         }
106         return this.superFrontEndView;
107     }
108 
109     /** Reset context only for non-root metafacades
110      * @param context
111      * @see MetafacadeBase#resetMetafacadeContext(String context)
112      */
113     @Override
114     public void resetMetafacadeContext(String context)
115     {
116         if (!this.contextRoot) // reset context only for non-root metafacades
117         {
118             context = getContext(context);  // to have same value as in original constructor call
119             setMetafacadeContext (context);
120             if (this.superFrontEndViewInitialized)
121             {
122                 ((MetafacadeBase)this.superFrontEndView).resetMetafacadeContext(context);
123             }
124         }
125     }
126 
127     /**
128      * @return boolean true always
129      * @see JSFView
130      */
131     public boolean isJSFViewMetaType()
132     {
133         return true;
134     }
135 
136     // --------------- attributes ---------------------
137 
138    /**
139     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getPath()
140     * @return String
141     */
142     protected abstract String handleGetPath();
143 
144     private String __path1a;
145     private boolean __path1aSet = false;
146 
147     /**
148      * The full path of the view resources (i.e. the JSP page).
149      * @return (String)handleGetPath()
150      */
151     public final String getPath()
152     {
153         String path1a = this.__path1a;
154         if (!this.__path1aSet)
155         {
156             // path has no pre constraints
157             path1a = handleGetPath();
158             // path has no post constraints
159             this.__path1a = path1a;
160             if (isMetafacadePropertyCachingEnabled())
161             {
162                 this.__path1aSet = true;
163             }
164         }
165         return path1a;
166     }
167 
168    /**
169     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getTitleKey()
170     * @return String
171     */
172     protected abstract String handleGetTitleKey();
173 
174     private String __titleKey2a;
175     private boolean __titleKey2aSet = false;
176 
177     /**
178      * A resource message key suited for the view's title.
179      * @return (String)handleGetTitleKey()
180      */
181     public final String getTitleKey()
182     {
183         String titleKey2a = this.__titleKey2a;
184         if (!this.__titleKey2aSet)
185         {
186             // titleKey has no pre constraints
187             titleKey2a = handleGetTitleKey();
188             // titleKey has no post constraints
189             this.__titleKey2a = titleKey2a;
190             if (isMetafacadePropertyCachingEnabled())
191             {
192                 this.__titleKey2aSet = true;
193             }
194         }
195         return titleKey2a;
196     }
197 
198    /**
199     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getTitleValue()
200     * @return String
201     */
202     protected abstract String handleGetTitleValue();
203 
204     private String __titleValue3a;
205     private boolean __titleValue3aSet = false;
206 
207     /**
208      * A default resource message value suited for the page's title.
209      * @return (String)handleGetTitleValue()
210      */
211     public final String getTitleValue()
212     {
213         String titleValue3a = this.__titleValue3a;
214         if (!this.__titleValue3aSet)
215         {
216             // titleValue has no pre constraints
217             titleValue3a = handleGetTitleValue();
218             // titleValue has no post constraints
219             this.__titleValue3a = titleValue3a;
220             if (isMetafacadePropertyCachingEnabled())
221             {
222                 this.__titleValue3aSet = true;
223             }
224         }
225         return titleValue3a;
226     }
227 
228    /**
229     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getMessageKey()
230     * @return String
231     */
232     protected abstract String handleGetMessageKey();
233 
234     private String __messageKey4a;
235     private boolean __messageKey4aSet = false;
236 
237     /**
238      * The default resource message key for this view.
239      * @return (String)handleGetMessageKey()
240      */
241     public final String getMessageKey()
242     {
243         String messageKey4a = this.__messageKey4a;
244         if (!this.__messageKey4aSet)
245         {
246             // messageKey has no pre constraints
247             messageKey4a = handleGetMessageKey();
248             // messageKey has no post constraints
249             this.__messageKey4a = messageKey4a;
250             if (isMetafacadePropertyCachingEnabled())
251             {
252                 this.__messageKey4aSet = true;
253             }
254         }
255         return messageKey4a;
256     }
257 
258    /**
259     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getDocumentationKey()
260     * @return String
261     */
262     protected abstract String handleGetDocumentationKey();
263 
264     private String __documentationKey5a;
265     private boolean __documentationKey5aSet = false;
266 
267     /**
268      * A resource message key suited for the page's documentation.
269      * @return (String)handleGetDocumentationKey()
270      */
271     public final String getDocumentationKey()
272     {
273         String documentationKey5a = this.__documentationKey5a;
274         if (!this.__documentationKey5aSet)
275         {
276             // documentationKey has no pre constraints
277             documentationKey5a = handleGetDocumentationKey();
278             // documentationKey has no post constraints
279             this.__documentationKey5a = documentationKey5a;
280             if (isMetafacadePropertyCachingEnabled())
281             {
282                 this.__documentationKey5aSet = true;
283             }
284         }
285         return documentationKey5a;
286     }
287 
288    /**
289     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getDocumentationValue()
290     * @return String
291     */
292     protected abstract String handleGetDocumentationValue();
293 
294     private String __documentationValue6a;
295     private boolean __documentationValue6aSet = false;
296 
297     /**
298      * A resource message value suited for the view's documentation.
299      * @return (String)handleGetDocumentationValue()
300      */
301     public final String getDocumentationValue()
302     {
303         String documentationValue6a = this.__documentationValue6a;
304         if (!this.__documentationValue6aSet)
305         {
306             // documentationValue has no pre constraints
307             documentationValue6a = handleGetDocumentationValue();
308             // documentationValue has no post constraints
309             this.__documentationValue6a = documentationValue6a;
310             if (isMetafacadePropertyCachingEnabled())
311             {
312                 this.__documentationValue6aSet = true;
313             }
314         }
315         return documentationValue6a;
316     }
317 
318    /**
319     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getMessageValue()
320     * @return String
321     */
322     protected abstract String handleGetMessageValue();
323 
324     private String __messageValue7a;
325     private boolean __messageValue7aSet = false;
326 
327     /**
328      * A displayable version of this view's name.
329      * @return (String)handleGetMessageValue()
330      */
331     public final String getMessageValue()
332     {
333         String messageValue7a = this.__messageValue7a;
334         if (!this.__messageValue7aSet)
335         {
336             // messageValue has no pre constraints
337             messageValue7a = handleGetMessageValue();
338             // messageValue has no post constraints
339             this.__messageValue7a = messageValue7a;
340             if (isMetafacadePropertyCachingEnabled())
341             {
342                 this.__messageValue7aSet = true;
343             }
344         }
345         return messageValue7a;
346     }
347 
348    /**
349     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getFullyQualifiedPopulator()
350     * @return String
351     */
352     protected abstract String handleGetFullyQualifiedPopulator();
353 
354     private String __fullyQualifiedPopulator8a;
355     private boolean __fullyQualifiedPopulator8aSet = false;
356 
357     /**
358      * The fully qualified name of this view's form populator.
359      * @return (String)handleGetFullyQualifiedPopulator()
360      */
361     public final String getFullyQualifiedPopulator()
362     {
363         String fullyQualifiedPopulator8a = this.__fullyQualifiedPopulator8a;
364         if (!this.__fullyQualifiedPopulator8aSet)
365         {
366             // fullyQualifiedPopulator has no pre constraints
367             fullyQualifiedPopulator8a = handleGetFullyQualifiedPopulator();
368             // fullyQualifiedPopulator has no post constraints
369             this.__fullyQualifiedPopulator8a = fullyQualifiedPopulator8a;
370             if (isMetafacadePropertyCachingEnabled())
371             {
372                 this.__fullyQualifiedPopulator8aSet = true;
373             }
374         }
375         return fullyQualifiedPopulator8a;
376     }
377 
378    /**
379     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getPopulator()
380     * @return String
381     */
382     protected abstract String handleGetPopulator();
383 
384     private String __populator9a;
385     private boolean __populator9aSet = false;
386 
387     /**
388      * The name of the form populator for this view.
389      * @return (String)handleGetPopulator()
390      */
391     public final String getPopulator()
392     {
393         String populator9a = this.__populator9a;
394         if (!this.__populator9aSet)
395         {
396             // populator has no pre constraints
397             populator9a = handleGetPopulator();
398             // populator has no post constraints
399             this.__populator9a = populator9a;
400             if (isMetafacadePropertyCachingEnabled())
401             {
402                 this.__populator9aSet = true;
403             }
404         }
405         return populator9a;
406     }
407 
408    /**
409     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getPopulatorPath()
410     * @return String
411     */
412     protected abstract String handleGetPopulatorPath();
413 
414     private String __populatorPath10a;
415     private boolean __populatorPath10aSet = false;
416 
417     /**
418      * The path to the form populator.
419      * @return (String)handleGetPopulatorPath()
420      */
421     public final String getPopulatorPath()
422     {
423         String populatorPath10a = this.__populatorPath10a;
424         if (!this.__populatorPath10aSet)
425         {
426             // populatorPath has no pre constraints
427             populatorPath10a = handleGetPopulatorPath();
428             // populatorPath has no post constraints
429             this.__populatorPath10a = populatorPath10a;
430             if (isMetafacadePropertyCachingEnabled())
431             {
432                 this.__populatorPath10aSet = true;
433             }
434         }
435         return populatorPath10a;
436     }
437 
438    /**
439     * @see org.andromda.cartridges.jsf.metafacades.JSFView#isPopulatorRequired()
440     * @return boolean
441     */
442     protected abstract boolean handleIsPopulatorRequired();
443 
444     private boolean __populatorRequired11a;
445     private boolean __populatorRequired11aSet = false;
446 
447     /**
448      * Indicates if a populator is required for this view.
449      * @return (boolean)handleIsPopulatorRequired()
450      */
451     public final boolean isPopulatorRequired()
452     {
453         boolean populatorRequired11a = this.__populatorRequired11a;
454         if (!this.__populatorRequired11aSet)
455         {
456             // populatorRequired has no pre constraints
457             populatorRequired11a = handleIsPopulatorRequired();
458             // populatorRequired has no post constraints
459             this.__populatorRequired11a = populatorRequired11a;
460             if (isMetafacadePropertyCachingEnabled())
461             {
462                 this.__populatorRequired11aSet = true;
463             }
464         }
465         return populatorRequired11a;
466     }
467 
468    /**
469     * @see org.andromda.cartridges.jsf.metafacades.JSFView#isValidationRequired()
470     * @return boolean
471     */
472     protected abstract boolean handleIsValidationRequired();
473 
474     private boolean __validationRequired12a;
475     private boolean __validationRequired12aSet = false;
476 
477     /**
478      * Indicates whether or not at least one parameter of an outgoing action in this view requires
479      * validation.
480      * @return (boolean)handleIsValidationRequired()
481      */
482     public final boolean isValidationRequired()
483     {
484         boolean validationRequired12a = this.__validationRequired12a;
485         if (!this.__validationRequired12aSet)
486         {
487             // validationRequired has no pre constraints
488             validationRequired12a = handleIsValidationRequired();
489             // validationRequired has no post constraints
490             this.__validationRequired12a = validationRequired12a;
491             if (isMetafacadePropertyCachingEnabled())
492             {
493                 this.__validationRequired12aSet = true;
494             }
495         }
496         return validationRequired12a;
497     }
498 
499    /**
500     * @see org.andromda.cartridges.jsf.metafacades.JSFView#isPopup()
501     * @return boolean
502     */
503     protected abstract boolean handleIsPopup();
504 
505     private boolean __popup13a;
506     private boolean __popup13aSet = false;
507 
508     /**
509      * Indicates if this view represents a popup.
510      * @return (boolean)handleIsPopup()
511      */
512     public final boolean isPopup()
513     {
514         boolean popup13a = this.__popup13a;
515         if (!this.__popup13aSet)
516         {
517             // popup has no pre constraints
518             popup13a = handleIsPopup();
519             // popup has no post constraints
520             this.__popup13a = popup13a;
521             if (isMetafacadePropertyCachingEnabled())
522             {
523                 this.__popup13aSet = true;
524             }
525         }
526         return popup13a;
527     }
528 
529    /**
530     * @see org.andromda.cartridges.jsf.metafacades.JSFView#isNonTableVariablesPresent()
531     * @return boolean
532     */
533     protected abstract boolean handleIsNonTableVariablesPresent();
534 
535     private boolean __nonTableVariablesPresent14a;
536     private boolean __nonTableVariablesPresent14aSet = false;
537 
538     /**
539      * Indicates whether or not any non-table view variables are present in this view.
540      * @return (boolean)handleIsNonTableVariablesPresent()
541      */
542     public final boolean isNonTableVariablesPresent()
543     {
544         boolean nonTableVariablesPresent14a = this.__nonTableVariablesPresent14a;
545         if (!this.__nonTableVariablesPresent14aSet)
546         {
547             // nonTableVariablesPresent has no pre constraints
548             nonTableVariablesPresent14a = handleIsNonTableVariablesPresent();
549             // nonTableVariablesPresent has no post constraints
550             this.__nonTableVariablesPresent14a = nonTableVariablesPresent14a;
551             if (isMetafacadePropertyCachingEnabled())
552             {
553                 this.__nonTableVariablesPresent14aSet = true;
554             }
555         }
556         return nonTableVariablesPresent14a;
557     }
558 
559    /**
560     * @see org.andromda.cartridges.jsf.metafacades.JSFView#isHasNameOfUseCase()
561     * @return boolean
562     */
563     protected abstract boolean handleIsHasNameOfUseCase();
564 
565     private boolean __hasNameOfUseCase15a;
566     private boolean __hasNameOfUseCase15aSet = false;
567 
568     /**
569      * Indicates whether or not this view has the same name as the use case in which it is
570      * contained.
571      * @return (boolean)handleIsHasNameOfUseCase()
572      */
573     public final boolean isHasNameOfUseCase()
574     {
575         boolean hasNameOfUseCase15a = this.__hasNameOfUseCase15a;
576         if (!this.__hasNameOfUseCase15aSet)
577         {
578             // hasNameOfUseCase has no pre constraints
579             hasNameOfUseCase15a = handleIsHasNameOfUseCase();
580             // hasNameOfUseCase has no post constraints
581             this.__hasNameOfUseCase15a = hasNameOfUseCase15a;
582             if (isMetafacadePropertyCachingEnabled())
583             {
584                 this.__hasNameOfUseCase15aSet = true;
585             }
586         }
587         return hasNameOfUseCase15a;
588     }
589 
590    /**
591     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getFormKey()
592     * @return String
593     */
594     protected abstract String handleGetFormKey();
595 
596     private String __formKey16a;
597     private boolean __formKey16aSet = false;
598 
599     /**
600      * The key that stores the form in which information is passed from one action to another.
601      * @return (String)handleGetFormKey()
602      */
603     public final String getFormKey()
604     {
605         String formKey16a = this.__formKey16a;
606         if (!this.__formKey16aSet)
607         {
608             // formKey has no pre constraints
609             formKey16a = handleGetFormKey();
610             // formKey has no post constraints
611             this.__formKey16a = formKey16a;
612             if (isMetafacadePropertyCachingEnabled())
613             {
614                 this.__formKey16aSet = true;
615             }
616         }
617         return formKey16a;
618     }
619 
620    /**
621     * @see org.andromda.cartridges.jsf.metafacades.JSFView#getFromOutcome()
622     * @return String
623     */
624     protected abstract String handleGetFromOutcome();
625 
626     private String __fromOutcome17a;
627     private boolean __fromOutcome17aSet = false;
628 
629     /**
630      * The name that corresponds to the from-outcome in an navigational rule.
631      * @return (String)handleGetFromOutcome()
632      */
633     public final String getFromOutcome()
634     {
635         String fromOutcome17a = this.__fromOutcome17a;
636         if (!this.__fromOutcome17aSet)
637         {
638             // fromOutcome has no pre constraints
639             fromOutcome17a = handleGetFromOutcome();
640             // fromOutcome has no post constraints
641             this.__fromOutcome17a = fromOutcome17a;
642             if (isMetafacadePropertyCachingEnabled())
643             {
644                 this.__fromOutcome17aSet = true;
645             }
646         }
647         return fromOutcome17a;
648     }
649 
650    /**
651     * @see org.andromda.cartridges.jsf.metafacades.JSFView#isNeedsFileUpload()
652     * @return boolean
653     */
654     protected abstract boolean handleIsNeedsFileUpload();
655 
656     private boolean __needsFileUpload18a;
657     private boolean __needsFileUpload18aSet = false;
658 
659     /**
660      * TODO: Model Documentation for org.andromda.cartridges.jsf.metafacades.JSFView.needsFileUpload
661      * @return (boolean)handleIsNeedsFileUpload()
662      */
663     public final boolean isNeedsFileUpload()
664     {
665         boolean needsFileUpload18a = this.__needsFileUpload18a;
666         if (!this.__needsFileUpload18aSet)
667         {
668             // needsFileUpload has no pre constraints
669             needsFileUpload18a = handleIsNeedsFileUpload();
670             // needsFileUpload has no post constraints
671             this.__needsFileUpload18a = needsFileUpload18a;
672             if (isMetafacadePropertyCachingEnabled())
673             {
674                 this.__needsFileUpload18aSet = true;
675             }
676         }
677         return needsFileUpload18a;
678     }
679 
680     // ------------- associations ------------------
681 
682     private List<JSFForward> __getForwards1r;
683     private boolean __getForwards1rSet = false;
684 
685     /**
686      * Represents a JSF view for a front-end application.
687      * @return (List<JSFForward>)handleGetForwards()
688      */
689     public final List<JSFForward> getForwards()
690     {
691         List<JSFForward> getForwards1r = this.__getForwards1r;
692         if (!this.__getForwards1rSet)
693         {
694             // jSFView has no pre constraints
695             List result = handleGetForwards();
696             List shieldedResult = this.shieldedElements(result);
697             try
698             {
699                 getForwards1r = (List<JSFForward>)shieldedResult;
700             }
701             catch (ClassCastException ex)
702             {
703                 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
704                 JSFViewLogic.logger.warn("incorrect metafacade cast for JSFViewLogic.getForwards List<JSFForward> " + result + ": " + shieldedResult);
705             }
706             // jSFView has no post constraints
707             this.__getForwards1r = getForwards1r;
708             if (isMetafacadePropertyCachingEnabled())
709             {
710                 this.__getForwards1rSet = true;
711             }
712         }
713         return getForwards1r;
714     }
715 
716     /**
717      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
718      * @return  List
719      */
720     protected abstract List handleGetForwards();
721 
722     /**
723      * Represents a JSF view for a front-end application.
724      * @return (List<JSFParameter>)handleGetBackingValueVariables()
725      */
726     public final List<JSFParameter> getBackingValueVariables()
727     {
728         List<JSFParameter> getBackingValueVariables2r = null;
729         // jSFView has no pre constraints
730         List result = handleGetBackingValueVariables();
731         List shieldedResult = this.shieldedElements(result);
732         try
733         {
734             getBackingValueVariables2r = (List<JSFParameter>)shieldedResult;
735         }
736         catch (ClassCastException ex)
737         {
738             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
739             JSFViewLogic.logger.warn("incorrect metafacade cast for JSFViewLogic.getBackingValueVariables List<JSFParameter> " + result + ": " + shieldedResult);
740         }
741         // jSFView has no post constraints
742         return getBackingValueVariables2r;
743     }
744 
745     /**
746      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
747      * @return  List
748      */
749     protected abstract List handleGetBackingValueVariables();
750 
751     private List<JSFAction> __getFormActions3r;
752     private boolean __getFormActions3rSet = false;
753 
754     /**
755      * Represents a JSF view for a front-end application.
756      * @return (List<JSFAction>)handleGetFormActions()
757      */
758     public final List<JSFAction> getFormActions()
759     {
760         List<JSFAction> getFormActions3r = this.__getFormActions3r;
761         if (!this.__getFormActions3rSet)
762         {
763             // jSFView has no pre constraints
764             List result = handleGetFormActions();
765             List shieldedResult = this.shieldedElements(result);
766             try
767             {
768                 getFormActions3r = (List<JSFAction>)shieldedResult;
769             }
770             catch (ClassCastException ex)
771             {
772                 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
773                 JSFViewLogic.logger.warn("incorrect metafacade cast for JSFViewLogic.getFormActions List<JSFAction> " + result + ": " + shieldedResult);
774             }
775             // jSFView has no post constraints
776             this.__getFormActions3r = getFormActions3r;
777             if (isMetafacadePropertyCachingEnabled())
778             {
779                 this.__getFormActions3rSet = true;
780             }
781         }
782         return getFormActions3r;
783     }
784 
785     /**
786      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
787      * @return  List
788      */
789     protected abstract List handleGetFormActions();
790 
791     private List<JSFAction> __getActionForwards4r;
792     private boolean __getActionForwards4rSet = false;
793 
794     /**
795      * Represents a JSF view for a front-end application.
796      * @return (List<JSFAction>)handleGetActionForwards()
797      */
798     public final List<JSFAction> getActionForwards()
799     {
800         List<JSFAction> getActionForwards4r = this.__getActionForwards4r;
801         if (!this.__getActionForwards4rSet)
802         {
803             // jSFView has no pre constraints
804             List result = handleGetActionForwards();
805             List shieldedResult = this.shieldedElements(result);
806             try
807             {
808                 getActionForwards4r = (List<JSFAction>)shieldedResult;
809             }
810             catch (ClassCastException ex)
811             {
812                 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
813                 JSFViewLogic.logger.warn("incorrect metafacade cast for JSFViewLogic.getActionForwards List<JSFAction> " + result + ": " + shieldedResult);
814             }
815             // jSFView has no post constraints
816             this.__getActionForwards4r = getActionForwards4r;
817             if (isMetafacadePropertyCachingEnabled())
818             {
819                 this.__getActionForwards4rSet = true;
820             }
821         }
822         return getActionForwards4r;
823     }
824 
825     /**
826      * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
827      * @return  List
828      */
829     protected abstract List handleGetActionForwards();
830 
831     /**
832      * @return true
833      * @see FrontEndView
834      */
835     public boolean isFrontEndViewMetaType()
836     {
837         return true;
838     }
839 
840     /**
841      * @return true
842      * @see org.andromda.metafacades.uml.FrontEndActionState
843      */
844     public boolean isFrontEndActionStateMetaType()
845     {
846         return true;
847     }
848 
849     /**
850      * @return true
851      * @see org.andromda.metafacades.uml.ActionStateFacade
852      */
853     public boolean isActionStateFacadeMetaType()
854     {
855         return true;
856     }
857 
858     /**
859      * @return true
860      * @see StateFacade
861      */
862     public boolean isStateFacadeMetaType()
863     {
864         return true;
865     }
866 
867     /**
868      * @return true
869      * @see org.andromda.metafacades.uml.StateVertexFacade
870      */
871     public boolean isStateVertexFacadeMetaType()
872     {
873         return true;
874     }
875 
876     /**
877      * @return true
878      * @see ModelElementFacade
879      */
880     public boolean isModelElementFacadeMetaType()
881     {
882         return true;
883     }
884 
885     // ----------- delegates to FrontEndView ------------
886     /**
887      * The entry action for this action state (if any).
888      * @see org.andromda.metafacades.uml.ActionStateFacade#getEntry()
889      */
890     public ActionFacade getEntry()
891     {
892         return this.getSuperFrontEndView().getEntry();
893     }
894 
895     /**
896      * The method name representing this action state.
897      * @see org.andromda.metafacades.uml.FrontEndActionState#getActionMethodName()
898      */
899     public String getActionMethodName()
900     {
901         return this.getSuperFrontEndView().getActionMethodName();
902     }
903 
904     /**
905      * The actions that pass through this action state.
906      * @see org.andromda.metafacades.uml.FrontEndActionState#getContainerActions()
907      */
908     public List<FrontEndAction> getContainerActions()
909     {
910         return this.getSuperFrontEndView().getContainerActions();
911     }
912 
913     /**
914      * All calls deferred to the controller by this action state.
915      * @see org.andromda.metafacades.uml.FrontEndActionState#getControllerCalls()
916      */
917     public List<OperationFacade> getControllerCalls()
918     {
919         return this.getSuperFrontEndView().getControllerCalls();
920     }
921 
922     /**
923      * All exceptions modelled on this action state.
924      * @see org.andromda.metafacades.uml.FrontEndActionState#getExceptions()
925      */
926     public List<FrontEndExceptionHandler> getExceptions()
927     {
928         return this.getSuperFrontEndView().getExceptions();
929     }
930 
931     /**
932      * The next transition, there can be only one transition going out of an action state, otherwise
933      * decision points should be used (triggers are not supported at the server-side).
934      * @see org.andromda.metafacades.uml.FrontEndActionState#getForward()
935      */
936     public FrontEndForward getForward()
937     {
938         return this.getSuperFrontEndView().getForward();
939     }
940 
941     /**
942      * All calls deferred to the services by this action state.
943      * @see org.andromda.metafacades.uml.FrontEndActionState#getServiceCalls()
944      */
945     public List<OperationFacade> getServiceCalls()
946     {
947         return this.getSuperFrontEndView().getServiceCalls();
948     }
949 
950     /**
951      * True if this element is contained in a FrontEndUseCase.
952      * @see org.andromda.metafacades.uml.FrontEndActionState#isContainedInFrontEndUseCase()
953      */
954     public boolean isContainedInFrontEndUseCase()
955     {
956         return this.getSuperFrontEndView().isContainedInFrontEndUseCase();
957     }
958 
959     /**
960      * Indicates whether or not this front end action state is server side. Pages, for example, are
961      * also action states but they return control to the client.
962      * @see org.andromda.metafacades.uml.FrontEndActionState#isServerSide()
963      */
964     public boolean isServerSide()
965     {
966         return this.getSuperFrontEndView().isServerSide();
967     }
968 
969     /**
970      * All actions that can be triggered on this view.
971      * @see FrontEndView#getActions()
972      */
973     public List<FrontEndAction> getActions()
974     {
975         return this.getSuperFrontEndView().getActions();
976     }
977 
978     /**
979      * All parameters for each action going out of this view.
980      * @see FrontEndView#getAllActionParameters()
981      */
982     public List<FrontEndParameter> getAllActionParameters()
983     {
984         return this.getSuperFrontEndView().getAllActionParameters();
985     }
986 
987     /**
988      * All fields from all forms on the given view.
989      * @see FrontEndView#getAllFormFields()
990      */
991     public List<FrontEndParameter> getAllFormFields()
992     {
993         return this.getSuperFrontEndView().getAllFormFields();
994     }
995 
996     /**
997      * All tables belonging to the front end view.
998      * @see FrontEndView#getTables()
999      */
1000     public List<FrontEndParameter> getTables()
1001     {
1002         return this.getSuperFrontEndView().getTables();
1003     }
1004 
1005     /**
1006      * The use-case of which this view is a member.
1007      * @see FrontEndView#getUseCase()
1008      */
1009     public FrontEndUseCase getUseCase()
1010     {
1011         return this.getSuperFrontEndView().getUseCase();
1012     }
1013 
1014     /**
1015      * All those variables that will be present as variables in the target view. These are the
1016      * trigger parameters on the incoming transitions.
1017      * @see FrontEndView#getVariables()
1018      */
1019     public List<FrontEndParameter> getVariables()
1020     {
1021         return this.getSuperFrontEndView().getVariables();
1022     }
1023 
1024     /**
1025      * True if this element carries the FrontEndView stereotype.
1026      * @see FrontEndView#isFrontEndView()
1027      */
1028     public boolean isFrontEndView()
1029     {
1030         return this.getSuperFrontEndView().isFrontEndView();
1031     }
1032 
1033     /**
1034      * Copies all tagged values from the given ModelElementFacade to this model element facade.
1035      * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
1036      */
1037     public void copyTaggedValues(ModelElementFacade element)
1038     {
1039         this.getSuperFrontEndView().copyTaggedValues(element);
1040     }
1041 
1042     /**
1043      * Finds the tagged value with the specified 'tagName'. In case there are more values the first
1044      * one found will be returned.
1045      * @see ModelElementFacade#findTaggedValue(String tagName)
1046      */
1047     public Object findTaggedValue(String tagName)
1048     {
1049         return this.getSuperFrontEndView().findTaggedValue(tagName);
1050     }
1051 
1052     /**
1053      * Returns all the values for the tagged value with the specified name. The returned collection
1054      * will contains only String instances, or will be empty. Never null.
1055      * @see ModelElementFacade#findTaggedValues(String tagName)
1056      */
1057     public Collection<Object> findTaggedValues(String tagName)
1058     {
1059         return this.getSuperFrontEndView().findTaggedValues(tagName);
1060     }
1061 
1062     /**
1063      * Returns the fully qualified name of the model element. The fully qualified name includes
1064      * complete package qualified name of the underlying model element. The templates parameter will
1065      * be replaced by the correct one given the binding relation of the parameter to this element.
1066      * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1067      */
1068     public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1069     {
1070         return this.getSuperFrontEndView().getBindedFullyQualifiedName(bindedElement);
1071     }
1072 
1073     /**
1074      * Gets all constraints belonging to the model element.
1075      * @see ModelElementFacade#getConstraints()
1076      */
1077     public Collection<ConstraintFacade> getConstraints()
1078     {
1079         return this.getSuperFrontEndView().getConstraints();
1080     }
1081 
1082     /**
1083      * Returns the constraints of the argument kind that have been placed onto this model. Typical
1084      * kinds are "inv", "pre" and "post". Other kinds are possible.
1085      * @see ModelElementFacade#getConstraints(String kind)
1086      */
1087     public Collection<ConstraintFacade> getConstraints(String kind)
1088     {
1089         return this.getSuperFrontEndView().getConstraints(kind);
1090     }
1091 
1092     /**
1093      * Gets the documentation for the model element, The indent argument is prefixed to each line.
1094      * By default this method wraps lines after 64 characters.
1095      * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
1096      * @see ModelElementFacade#getDocumentation(String indent)
1097      */
1098     public String getDocumentation(String indent)
1099     {
1100         return this.getSuperFrontEndView().getDocumentation(indent);
1101     }
1102 
1103     /**
1104      * This method returns the documentation for this model element, with the lines wrapped after
1105      * the specified number of characters, values of less than 1 will indicate no line wrapping is
1106      * required. By default paragraphs are returned as HTML.
1107      * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
1108      * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
1109      */
1110     public String getDocumentation(String indent, int lineLength)
1111     {
1112         return this.getSuperFrontEndView().getDocumentation(indent, lineLength);
1113     }
1114 
1115     /**
1116      * This method returns the documentation for this model element, with the lines wrapped after
1117      * the specified number of characters, values of less than 1 will indicate no line wrapping is
1118      * required. HTML style determines if HTML Escaping is applied.
1119      * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
1120      */
1121     public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
1122     {
1123         return this.getSuperFrontEndView().getDocumentation(indent, lineLength, htmlStyle);
1124     }
1125 
1126     /**
1127      * The fully qualified name of this model element.
1128      * @see ModelElementFacade#getFullyQualifiedName()
1129      */
1130     public String getFullyQualifiedName()
1131     {
1132         return this.getSuperFrontEndView().getFullyQualifiedName();
1133     }
1134 
1135     /**
1136      * Returns the fully qualified name of the model element. The fully qualified name includes
1137      * complete package qualified name of the underlying model element.  If modelName is true, then
1138      * the original name of the model element (the name contained within the model) will be the name
1139      * returned, otherwise a name from a language mapping will be returned.
1140      * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
1141      */
1142     public String getFullyQualifiedName(boolean modelName)
1143     {
1144         return this.getSuperFrontEndView().getFullyQualifiedName(modelName);
1145     }
1146 
1147     /**
1148      * Returns the fully qualified name as a path, the returned value always starts with out a slash
1149      * '/'.
1150      * @see ModelElementFacade#getFullyQualifiedNamePath()
1151      */
1152     public String getFullyQualifiedNamePath()
1153     {
1154         return this.getSuperFrontEndView().getFullyQualifiedNamePath();
1155     }
1156 
1157     /**
1158      * Gets the unique identifier of the underlying model element.
1159      * @see ModelElementFacade#getId()
1160      */
1161     public String getId()
1162     {
1163         return this.getSuperFrontEndView().getId();
1164     }
1165 
1166     /**
1167      * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
1168      * are not represented by other properties, i.e. native, transient, volatile, synchronized,
1169      * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
1170      * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
1171      * JDK5 compiler level.
1172      * @see ModelElementFacade#getKeywords()
1173      */
1174     public Collection<String> getKeywords()
1175     {
1176         return this.getSuperFrontEndView().getKeywords();
1177     }
1178 
1179     /**
1180      * UML2: Retrieves a localized label for this named element.
1181      * @see ModelElementFacade#getLabel()
1182      */
1183     public String getLabel()
1184     {
1185         return this.getSuperFrontEndView().getLabel();
1186     }
1187 
1188     /**
1189      * The language mappings that have been set for this model element.
1190      * @see ModelElementFacade#getLanguageMappings()
1191      */
1192     public TypeMappings getLanguageMappings()
1193     {
1194         return this.getSuperFrontEndView().getLanguageMappings();
1195     }
1196 
1197     /**
1198      * Return the model containing this model element (multiple models may be loaded and processed
1199      * at the same time).
1200      * @see ModelElementFacade#getModel()
1201      */
1202     public ModelFacade getModel()
1203     {
1204         return this.getSuperFrontEndView().getModel();
1205     }
1206 
1207     /**
1208      * The name of the model element.
1209      * @see ModelElementFacade#getName()
1210      */
1211     public String getName()
1212     {
1213         return this.getSuperFrontEndView().getName();
1214     }
1215 
1216     /**
1217      * Gets the package to which this model element belongs.
1218      * @see ModelElementFacade#getPackage()
1219      */
1220     public ModelElementFacade getPackage()
1221     {
1222         return this.getSuperFrontEndView().getPackage();
1223     }
1224 
1225     /**
1226      * The name of this model element's package.
1227      * @see ModelElementFacade#getPackageName()
1228      */
1229     public String getPackageName()
1230     {
1231         return this.getSuperFrontEndView().getPackageName();
1232     }
1233 
1234     /**
1235      * Gets the package name (optionally providing the ability to retrieve the model name and not
1236      * the mapped name).
1237      * @see ModelElementFacade#getPackageName(boolean modelName)
1238      */
1239     public String getPackageName(boolean modelName)
1240     {
1241         return this.getSuperFrontEndView().getPackageName(modelName);
1242     }
1243 
1244     /**
1245      * Returns the package as a path, the returned value always starts with out a slash '/'.
1246      * @see ModelElementFacade#getPackagePath()
1247      */
1248     public String getPackagePath()
1249     {
1250         return this.getSuperFrontEndView().getPackagePath();
1251     }
1252 
1253     /**
1254      * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
1255      * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
1256      * the names of the containing namespaces starting at the root of the hierarchy and ending with
1257      * the name of the NamedElement itself.
1258      * @see ModelElementFacade#getQualifiedName()
1259      */
1260     public String getQualifiedName()
1261     {
1262         return this.getSuperFrontEndView().getQualifiedName();
1263     }
1264 
1265     /**
1266      * Gets the root package for the model element.
1267      * @see ModelElementFacade#getRootPackage()
1268      */
1269     public PackageFacade getRootPackage()
1270     {
1271         return this.getSuperFrontEndView().getRootPackage();
1272     }
1273 
1274     /**
1275      * Gets the dependencies for which this model element is the source.
1276      * @see ModelElementFacade#getSourceDependencies()
1277      */
1278     public Collection<DependencyFacade> getSourceDependencies()
1279     {
1280         return this.getSuperFrontEndView().getSourceDependencies();
1281     }
1282 
1283     /**
1284      * If this model element is the context of an activity graph, this represents that activity
1285      * graph.
1286      * @see ModelElementFacade#getStateMachineContext()
1287      */
1288     public StateMachineFacade getStateMachineContext()
1289     {
1290         return this.getSuperFrontEndView().getStateMachineContext();
1291     }
1292 
1293     /**
1294      * The collection of ALL stereotype names for this model element.
1295      * @see ModelElementFacade#getStereotypeNames()
1296      */
1297     public Collection<String> getStereotypeNames()
1298     {
1299         return this.getSuperFrontEndView().getStereotypeNames();
1300     }
1301 
1302     /**
1303      * Gets all stereotypes for this model element.
1304      * @see ModelElementFacade#getStereotypes()
1305      */
1306     public Collection<StereotypeFacade> getStereotypes()
1307     {
1308         return this.getSuperFrontEndView().getStereotypes();
1309     }
1310 
1311     /**
1312      * Return the TaggedValues associated with this model element, under all stereotypes.
1313      * @see ModelElementFacade#getTaggedValues()
1314      */
1315     public Collection<TaggedValueFacade> getTaggedValues()
1316     {
1317         return this.getSuperFrontEndView().getTaggedValues();
1318     }
1319 
1320     /**
1321      * Gets the dependencies for which this model element is the target.
1322      * @see ModelElementFacade#getTargetDependencies()
1323      */
1324     public Collection<DependencyFacade> getTargetDependencies()
1325     {
1326         return this.getSuperFrontEndView().getTargetDependencies();
1327     }
1328 
1329     /**
1330      * Get the template parameter for this model element having the parameterName
1331      * @see ModelElementFacade#getTemplateParameter(String parameterName)
1332      */
1333     public Object getTemplateParameter(String parameterName)
1334     {
1335         return this.getSuperFrontEndView().getTemplateParameter(parameterName);
1336     }
1337 
1338     /**
1339      * Get the template parameters for this model element
1340      * @see ModelElementFacade#getTemplateParameters()
1341      */
1342     public Collection<TemplateParameterFacade> getTemplateParameters()
1343     {
1344         return this.getSuperFrontEndView().getTemplateParameters();
1345     }
1346 
1347     /**
1348      * The visibility (i.e. public, private, protected or package) of the model element, will
1349      * attempt a lookup for these values in the language mappings (if any).
1350      * @see ModelElementFacade#getVisibility()
1351      */
1352     public String getVisibility()
1353     {
1354         return this.getSuperFrontEndView().getVisibility();
1355     }
1356 
1357     /**
1358      * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
1359      * is taken into account when searching for the stereotype), false otherwise.
1360      * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
1361      */
1362     public boolean hasExactStereotype(String stereotypeName)
1363     {
1364         return this.getSuperFrontEndView().hasExactStereotype(stereotypeName);
1365     }
1366 
1367     /**
1368      * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1369      * pipe, semicolon, or << >>
1370      * @see ModelElementFacade#hasKeyword(String keywordName)
1371      */
1372     public boolean hasKeyword(String keywordName)
1373     {
1374         return this.getSuperFrontEndView().hasKeyword(keywordName);
1375     }
1376 
1377     /**
1378      * Returns true if the model element has the specified stereotype.  If the stereotype itself
1379      * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
1380      * one of the stereotype's ancestors has a matching name this method will return true, false
1381      * otherwise.
1382      * For example, if we have a certain stereotype called <<exception>> and a model element has a
1383      * stereotype called <<applicationException>> which extends <<exception>>, when calling this
1384      * method with 'stereotypeName' defined as 'exception' the method would return true since
1385      * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
1386      * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
1387      * @see ModelElementFacade#hasStereotype(String stereotypeName)
1388      */
1389     public boolean hasStereotype(String stereotypeName)
1390     {
1391         return this.getSuperFrontEndView().hasStereotype(stereotypeName);
1392     }
1393 
1394     /**
1395      * True if there are target dependencies from this element that are instances of BindingFacade.
1396      * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
1397      * @see ModelElementFacade#isBindingDependenciesPresent()
1398      */
1399     public boolean isBindingDependenciesPresent()
1400     {
1401         return this.getSuperFrontEndView().isBindingDependenciesPresent();
1402     }
1403 
1404     /**
1405      * Indicates if any constraints are present on this model element.
1406      * @see ModelElementFacade#isConstraintsPresent()
1407      */
1408     public boolean isConstraintsPresent()
1409     {
1410         return this.getSuperFrontEndView().isConstraintsPresent();
1411     }
1412 
1413     /**
1414      * Indicates if any documentation is present on this model element.
1415      * @see ModelElementFacade#isDocumentationPresent()
1416      */
1417     public boolean isDocumentationPresent()
1418     {
1419         return this.getSuperFrontEndView().isDocumentationPresent();
1420     }
1421 
1422     /**
1423      * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
1424      * @see ModelElementFacade#isReservedWord()
1425      */
1426     public boolean isReservedWord()
1427     {
1428         return this.getSuperFrontEndView().isReservedWord();
1429     }
1430 
1431     /**
1432      * True is there are template parameters on this model element. For UML2, applies to Class,
1433      * Operation, Property, and Parameter.
1434      * @see ModelElementFacade#isTemplateParametersPresent()
1435      */
1436     public boolean isTemplateParametersPresent()
1437     {
1438         return this.getSuperFrontEndView().isTemplateParametersPresent();
1439     }
1440 
1441     /**
1442      * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
1443      * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
1444      * Enumerations and Interfaces, optionally applies on other model elements.
1445      * @see ModelElementFacade#isValidIdentifierName()
1446      */
1447     public boolean isValidIdentifierName()
1448     {
1449         return this.getSuperFrontEndView().isValidIdentifierName();
1450     }
1451 
1452     /**
1453      * Searches for the constraint with the specified 'name' on this model element, and if found
1454      * translates it using the specified 'translation' from a translation library discovered by the
1455      * framework.
1456      * @see ModelElementFacade#translateConstraint(String name, String translation)
1457      */
1458     public String translateConstraint(String name, String translation)
1459     {
1460         return this.getSuperFrontEndView().translateConstraint(name, translation);
1461     }
1462 
1463     /**
1464      * Translates all constraints belonging to this model element with the given 'translation'.
1465      * @see ModelElementFacade#translateConstraints(String translation)
1466      */
1467     public String[] translateConstraints(String translation)
1468     {
1469         return this.getSuperFrontEndView().translateConstraints(translation);
1470     }
1471 
1472     /**
1473      * Translates the constraints of the specified 'kind' belonging to this model element.
1474      * @see ModelElementFacade#translateConstraints(String kind, String translation)
1475      */
1476     public String[] translateConstraints(String kind, String translation)
1477     {
1478         return this.getSuperFrontEndView().translateConstraints(kind, translation);
1479     }
1480 
1481     /**
1482      * Events to which is being deferred in this action state.
1483      * @see StateFacade#getDeferrableEvents()
1484      */
1485     public Collection<EventFacade> getDeferrableEvents()
1486     {
1487         return this.getSuperFrontEndView().getDeferrableEvents();
1488     }
1489 
1490     /**
1491      * Models a situation during which some (usually implicit) invariant condition holds. The states
1492      * of
1493      * protocol state machines are exposed to the users of their context classifiers. A protocol
1494      * state
1495      * represents an exposed stable situation of its context classifier: when an instance of the
1496      * classifier
1497      * is not processing any operation, users of this instance can always know its state
1498      * configuration.
1499      * @see org.andromda.metafacades.uml.StateVertexFacade#getContainer()
1500      */
1501     public StateFacade getContainer()
1502     {
1503         return this.getSuperFrontEndView().getContainer();
1504     }
1505 
1506     /**
1507      * A directed relationship between a source vertex and a target vertex. It may be part of a
1508      * compound
1509      * transition, which takes the state machine from one state configuration to another,
1510      * representing the
1511      * complete response of the state machine to an occurrence of an event of a particular type.
1512      * @see org.andromda.metafacades.uml.StateVertexFacade#getIncomings()
1513      */
1514     public Collection<TransitionFacade> getIncomings()
1515     {
1516         return this.getSuperFrontEndView().getIncomings();
1517     }
1518 
1519     /**
1520      * A directed relationship between a source vertex and a target vertex. It may be part of a
1521      * compound
1522      * transition, which takes the state machine from one state configuration to another,
1523      * representing the
1524      * complete response of the state machine to an occurrence of an event of a particular type.
1525      * @see org.andromda.metafacades.uml.StateVertexFacade#getOutgoings()
1526      */
1527     public Collection<TransitionFacade> getOutgoings()
1528     {
1529         return this.getSuperFrontEndView().getOutgoings();
1530     }
1531 
1532     /**
1533      * The partition (if any) to which this vertex belongs.
1534      * @see org.andromda.metafacades.uml.StateVertexFacade#getPartition()
1535      */
1536     public PartitionFacade getPartition()
1537     {
1538         return this.getSuperFrontEndView().getPartition();
1539     }
1540 
1541     /**
1542      * State machines can be used to express the behavior of part of a system. Behavior is modeled
1543      * as a
1544      * traversal of a graph of state nodes interconnected by one or more joined transition arcs that
1545      * are
1546      * triggered by the dispatching of series of (event) occurrences. During this traversal, the
1547      * state
1548      * machine executes a series of activities associated with various elements of the state
1549      * machine.
1550      * @see org.andromda.metafacades.uml.StateVertexFacade#getStateMachine()
1551      */
1552     public StateMachineFacade getStateMachine()
1553     {
1554         return this.getSuperFrontEndView().getStateMachine();
1555     }
1556 
1557     /**
1558      * @see MetafacadeBase#initialize()
1559      */
1560     @Override
1561     public void initialize()
1562     {
1563         this.getSuperFrontEndView().initialize();
1564     }
1565 
1566     /**
1567      * @return Object getSuperFrontEndView().getValidationOwner()
1568      * @see MetafacadeBase#getValidationOwner()
1569      */
1570     @Override
1571     public Object getValidationOwner()
1572     {
1573         Object owner = this.getSuperFrontEndView().getValidationOwner();
1574         return owner;
1575     }
1576 
1577     /**
1578      * @return String getSuperFrontEndView().getValidationName()
1579      * @see MetafacadeBase#getValidationName()
1580      */
1581     @Override
1582     public String getValidationName()
1583     {
1584         String name = this.getSuperFrontEndView().getValidationName();
1585         return name;
1586     }
1587 
1588     /**
1589      * <p><b>Constraint:</b> org::andromda::cartridges::jsf::metafacades::JSFView::duplicate view action names not allowed</p>
1590      * <p><b>Error:</b> Each view must contain actions which each have a unique name, this view has actions with duplicate names or names that cause an action name to be duplicated in faces-config.xml.</p>
1591      * <p><b>OCL:</b> context JSFView inv: actions->isUnique(name)</p>
1592      * @param validationMessages Collection<ModelValidationMessage>
1593      * @see MetafacadeBase#validateInvariants(Collection validationMessages)
1594      */
1595     @Override
1596     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1597     {
1598         this.getSuperFrontEndView().validateInvariants(validationMessages);
1599         try
1600         {
1601             final Object contextElement = this.THIS();
1602             boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.isUnique(OCLIntrospector.invoke(contextElement,"actions"),new Transformer(){public Object transform(Object object){return OCLIntrospector.invoke(object,"name");}}));
1603             if (!constraintValid)
1604             {
1605                 validationMessages.add(
1606                     new ModelValidationMessage(
1607                         (MetafacadeBase)contextElement ,
1608                         "org::andromda::cartridges::jsf::metafacades::JSFView::duplicate view action names not allowed",
1609                         "Each view must contain actions which each have a unique name, this view has actions with duplicate names or names that cause an action name to be duplicated in faces-config.xml."));
1610             }
1611         }
1612         catch (Throwable th)
1613         {
1614             Throwable cause = th.getCause();
1615             int depth = 0; // Some throwables have infinite recursion
1616             while (cause != null && depth < 7)
1617             {
1618                 th = cause;
1619                 depth++;
1620             }
1621             logger.error("Error validating constraint 'org::andromda::cartridges::jsf::metafacades::JSFView::duplicate view action names not allowed' ON "
1622                 + this.THIS().toString() + ": " + th.getMessage(), th);
1623         }
1624     }
1625 
1626     /**
1627      * The property that stores the name of the metafacade.
1628      */
1629     private static final String NAME_PROPERTY = "name";
1630     private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1631 
1632     /**
1633      * @see Object#toString()
1634      */
1635     @Override
1636     public String toString()
1637     {
1638         final StringBuilder toString = new StringBuilder(this.getClass().getName());
1639         toString.append("[");
1640         try
1641         {
1642             toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1643         }
1644         catch (final Throwable tryAgain)
1645         {
1646             try
1647             {
1648                 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1649             }
1650             catch (final Throwable ignore)
1651             {
1652                 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1653             }
1654         }
1655         toString.append("]");
1656         return toString.toString();
1657     }
1658 }