View Javadoc

1   //
2   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
3   //
4   package org.andromda.metafacades.uml14;
5   
6   /***
7    * MetafacadeLogic for org.andromda.metafacades.uml.FrontEndActionState
8    *
9    * @see org.andromda.metafacades.uml.FrontEndActionState
10   */
11  public abstract class FrontEndActionStateLogic
12      extends org.andromda.metafacades.uml14.ActionStateFacadeLogicImpl
13      implements org.andromda.metafacades.uml.FrontEndActionState
14  {
15  
16      protected Object metaObject;
17  
18      public FrontEndActionStateLogic(Object metaObject, String context)
19      {
20          super((org.omg.uml.behavioralelements.activitygraphs.ActionState)metaObject, getContext(context));
21          this.metaObject = metaObject;
22      }
23  
24      /***
25       * Gets the context for this metafacade logic instance.
26       */
27      private static String getContext(String context)
28      {
29          if (context == null)
30          {
31              context = "org.andromda.metafacades.uml.FrontEndActionState";
32          }
33          return context;
34      }
35  
36      /***
37       * @see org.andromda.core.metafacade.MetafacadeBase
38       */
39      public void resetMetafacadeContext(String context)
40      {
41          if (!this.contextRoot) // reset context only for non-root metafacades
42          {
43              context = getContext(context);  // to have same value as in original constructor call
44              setMetafacadeContext (context);
45          }
46      }
47  
48      /***
49       * @see org.andromda.metafacades.uml.FrontEndActionState
50       */
51      public boolean isFrontEndActionStateMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.FrontEndActionState#isServerSide()
60      */
61      protected abstract boolean handleIsServerSide();
62  
63      private void handleIsServerSide1aPreCondition()
64      {
65      }
66  
67      private void handleIsServerSide1aPostCondition()
68      {
69      }
70  
71      private boolean __serverSide1a;
72      private boolean __serverSide1aSet = false;
73  
74      public final boolean isServerSide()
75      {
76          boolean serverSide1a = this.__serverSide1a;
77          if (!this.__serverSide1aSet)
78          {
79              handleIsServerSide1aPreCondition();
80              serverSide1a = handleIsServerSide();
81              handleIsServerSide1aPostCondition();
82              this.__serverSide1a = serverSide1a;
83              if (isMetafacadePropertyCachingEnabled())
84              {
85                  this.__serverSide1aSet = true;
86              }
87          }
88          return serverSide1a;
89      }
90  
91     /***
92      * @see org.andromda.metafacades.uml.FrontEndActionState#isContainedInFrontEndUseCase()
93      */
94      protected abstract boolean handleIsContainedInFrontEndUseCase();
95  
96      private void handleIsContainedInFrontEndUseCase2aPreCondition()
97      {
98      }
99  
100     private void handleIsContainedInFrontEndUseCase2aPostCondition()
101     {
102     }
103 
104     private boolean __containedInFrontEndUseCase2a;
105     private boolean __containedInFrontEndUseCase2aSet = false;
106 
107     public final boolean isContainedInFrontEndUseCase()
108     {
109         boolean containedInFrontEndUseCase2a = this.__containedInFrontEndUseCase2a;
110         if (!this.__containedInFrontEndUseCase2aSet)
111         {
112             handleIsContainedInFrontEndUseCase2aPreCondition();
113             containedInFrontEndUseCase2a = handleIsContainedInFrontEndUseCase();
114             handleIsContainedInFrontEndUseCase2aPostCondition();
115             this.__containedInFrontEndUseCase2a = containedInFrontEndUseCase2a;
116             if (isMetafacadePropertyCachingEnabled())
117             {
118                 this.__containedInFrontEndUseCase2aSet = true;
119             }
120         }
121         return containedInFrontEndUseCase2a;
122     }
123 
124    /***
125     * @see org.andromda.metafacades.uml.FrontEndActionState#getActionMethodName()
126     */
127     protected abstract java.lang.String handleGetActionMethodName();
128 
129     private void handleGetActionMethodName3aPreCondition()
130     {
131     }
132 
133     private void handleGetActionMethodName3aPostCondition()
134     {
135     }
136 
137     private java.lang.String __actionMethodName3a;
138     private boolean __actionMethodName3aSet = false;
139 
140     public final java.lang.String getActionMethodName()
141     {
142         java.lang.String actionMethodName3a = this.__actionMethodName3a;
143         if (!this.__actionMethodName3aSet)
144         {
145             handleGetActionMethodName3aPreCondition();
146             actionMethodName3a = handleGetActionMethodName();
147             handleGetActionMethodName3aPostCondition();
148             this.__actionMethodName3a = actionMethodName3a;
149             if (isMetafacadePropertyCachingEnabled())
150             {
151                 this.__actionMethodName3aSet = true;
152             }
153         }
154         return actionMethodName3a;
155     }
156 
157     // ------------- associations ------------------
158 
159     private void handleGetForward1rPreCondition()
160     {
161     }
162 
163     private void handleGetForward1rPostCondition()
164     {
165     }
166 
167     private org.andromda.metafacades.uml.FrontEndForward __getForward1r;
168     private boolean __getForward1rSet = false;
169 
170     public final org.andromda.metafacades.uml.FrontEndForward getForward()
171     {
172         org.andromda.metafacades.uml.FrontEndForward getForward1r = this.__getForward1r;
173         if (!this.__getForward1rSet)
174         {
175             handleGetForward1rPreCondition();
176             Object result = this.shieldedElement(handleGetForward());
177             try
178             {
179                 getForward1r = (org.andromda.metafacades.uml.FrontEndForward)result;
180             }
181             catch (ClassCastException ex)
182             {
183                 // ignore since the metafacade shouldn't
184                 // be set if its not of the correct type
185             }
186             handleGetForward1rPostCondition();
187             this.__getForward1r = getForward1r;
188             if (isMetafacadePropertyCachingEnabled())
189             {
190                 this.__getForward1rSet = true;
191             }
192         }
193         return getForward1r;
194     }
195 
196     protected abstract java.lang.Object handleGetForward();
197 
198     private void handleGetControllerCalls2rPreCondition()
199     {
200     }
201 
202     private void handleGetControllerCalls2rPostCondition()
203     {
204     }
205 
206     private java.util.List __getControllerCalls2r;
207     private boolean __getControllerCalls2rSet = false;
208 
209     public final java.util.List getControllerCalls()
210     {
211         java.util.List getControllerCalls2r = this.__getControllerCalls2r;
212         if (!this.__getControllerCalls2rSet)
213         {
214             handleGetControllerCalls2rPreCondition();
215             Object result = this.shieldedElements(handleGetControllerCalls());
216             try
217             {
218                 getControllerCalls2r = (java.util.List)result;
219             }
220             catch (ClassCastException ex)
221             {
222                 // ignore since the metafacade shouldn't
223                 // be set if its not of the correct type
224             }
225             handleGetControllerCalls2rPostCondition();
226             this.__getControllerCalls2r = getControllerCalls2r;
227             if (isMetafacadePropertyCachingEnabled())
228             {
229                 this.__getControllerCalls2rSet = true;
230             }
231         }
232         return getControllerCalls2r;
233     }
234 
235     protected abstract java.util.List handleGetControllerCalls();
236 
237     private void handleGetExceptions3rPreCondition()
238     {
239     }
240 
241     private void handleGetExceptions3rPostCondition()
242     {
243     }
244 
245     private java.util.List __getExceptions3r;
246     private boolean __getExceptions3rSet = false;
247 
248     public final java.util.List getExceptions()
249     {
250         java.util.List getExceptions3r = this.__getExceptions3r;
251         if (!this.__getExceptions3rSet)
252         {
253             handleGetExceptions3rPreCondition();
254             Object result = this.shieldedElements(handleGetExceptions());
255             try
256             {
257                 getExceptions3r = (java.util.List)result;
258             }
259             catch (ClassCastException ex)
260             {
261                 // ignore since the metafacade shouldn't
262                 // be set if its not of the correct type
263             }
264             handleGetExceptions3rPostCondition();
265             this.__getExceptions3r = getExceptions3r;
266             if (isMetafacadePropertyCachingEnabled())
267             {
268                 this.__getExceptions3rSet = true;
269             }
270         }
271         return getExceptions3r;
272     }
273 
274     protected abstract java.util.List handleGetExceptions();
275 
276     private void handleGetContainerActions4rPreCondition()
277     {
278     }
279 
280     private void handleGetContainerActions4rPostCondition()
281     {
282     }
283 
284     private java.util.List __getContainerActions4r;
285     private boolean __getContainerActions4rSet = false;
286 
287     public final java.util.List getContainerActions()
288     {
289         java.util.List getContainerActions4r = this.__getContainerActions4r;
290         if (!this.__getContainerActions4rSet)
291         {
292             handleGetContainerActions4rPreCondition();
293             Object result = this.shieldedElements(handleGetContainerActions());
294             try
295             {
296                 getContainerActions4r = (java.util.List)result;
297             }
298             catch (ClassCastException ex)
299             {
300                 // ignore since the metafacade shouldn't
301                 // be set if its not of the correct type
302             }
303             handleGetContainerActions4rPostCondition();
304             this.__getContainerActions4r = getContainerActions4r;
305             if (isMetafacadePropertyCachingEnabled())
306             {
307                 this.__getContainerActions4rSet = true;
308             }
309         }
310         return getContainerActions4r;
311     }
312 
313     protected abstract java.util.List handleGetContainerActions();
314 
315     /***
316      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
317      */
318     public void validateInvariants(java.util.Collection validationMessages)
319     {
320         super.validateInvariants(validationMessages);
321         {
322             final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.notEmpty(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"name"))); 
323             if (!constraintValid)
324                 validationMessages.add(
325                     new org.andromda.core.metafacade.ModelValidationMessage(
326                         (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
327                         "org::andromda::metafacades::uml::FrontEndActionState::each front-end action state must have a name",
328                         "A \"front-end\" action state must have a non-empty name."));
329         }
330         {
331             final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"serverSide"))).booleanValue()?(org.andromda.translation.ocl.validation.OCLExpressions.equal(org.andromda.translation.ocl.validation.OCLCollections.size(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"exceptions"))+1,org.andromda.translation.ocl.validation.OCLCollections.size(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"outgoing")))||org.andromda.translation.ocl.validation.OCLExpressions.equal(org.andromda.translation.ocl.validation.OCLCollections.size(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"exceptions")),org.andromda.translation.ocl.validation.OCLCollections.size(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"outgoing")))):true)); 
332             if (!constraintValid)
333                 validationMessages.add(
334                     new org.andromda.core.metafacade.ModelValidationMessage(
335                         (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
336                         "org::andromda::metafacades::uml::FrontEndActionState::front-end action states can have at most one outgoing transition",
337                         "A \"front-end\" action state needs at most one outgoing transition that is not an exception-transition."));
338         }
339     }
340     
341     /***
342      * The property that stores the name of the metafacade.
343      */
344     private static final String NAME_PROPERTY = "name";
345     
346     /***
347      * @see java.lang.Object#toString()
348      */
349     public String toString()
350     {
351         final StringBuffer toString = new StringBuffer(this.getClass().getName());
352         toString.append("[");
353         try
354         {
355             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
356         }
357         catch (final Throwable throwable)
358         {
359             // - just ignore when the metafacade doesn't have a name property
360         }
361         toString.append("]");
362         return toString.toString();
363     }
364 }