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.StateMachineFacade
8    *
9    * @see org.andromda.metafacades.uml.StateMachineFacade
10   */
11  public abstract class StateMachineFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.StateMachineFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.statemachines.StateMachine metaObject;
17  
18      public StateMachineFacadeLogic(org.omg.uml.behavioralelements.statemachines.StateMachine metaObject, String context)
19      {
20          super(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.StateMachineFacade";
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.StateMachineFacade
50       */
51      public boolean isStateMachineFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetContextElement1rPreCondition()
59      {
60      }
61  
62      private void handleGetContextElement1rPostCondition()
63      {
64      }
65  
66      public final org.andromda.metafacades.uml.ModelElementFacade getContextElement()
67      {
68          org.andromda.metafacades.uml.ModelElementFacade getContextElement1r = null;
69          handleGetContextElement1rPreCondition();
70          Object result = this.shieldedElement(handleGetContextElement());
71          try
72          {
73              getContextElement1r = (org.andromda.metafacades.uml.ModelElementFacade)result;
74          }
75          catch (ClassCastException ex)
76          {
77              // ignore since the metafacade shouldn't
78              // be set if its not of the correct type
79          }
80          handleGetContextElement1rPostCondition();
81          return getContextElement1r;
82      }
83  
84      protected abstract java.lang.Object handleGetContextElement();
85  
86      private void handleGetFinalStates2rPreCondition()
87      {
88      }
89  
90      private void handleGetFinalStates2rPostCondition()
91      {
92      }
93  
94      public final java.util.Collection getFinalStates()
95      {
96          java.util.Collection getFinalStates2r = null;
97          handleGetFinalStates2rPreCondition();
98          Object result = this.shieldedElements(handleGetFinalStates());
99          try
100         {
101             getFinalStates2r = (java.util.Collection)result;
102         }
103         catch (ClassCastException ex)
104         {
105             // ignore since the metafacade shouldn't
106             // be set if its not of the correct type
107         }
108         handleGetFinalStates2rPostCondition();
109         return getFinalStates2r;
110     }
111 
112     protected abstract java.util.Collection handleGetFinalStates();
113 
114     private void handleGetInitialTransition4rPreCondition()
115     {
116     }
117 
118     private void handleGetInitialTransition4rPostCondition()
119     {
120     }
121 
122     private org.andromda.metafacades.uml.TransitionFacade __getInitialTransition4r;
123     private boolean __getInitialTransition4rSet = false;
124 
125     public final org.andromda.metafacades.uml.TransitionFacade getInitialTransition()
126     {
127         org.andromda.metafacades.uml.TransitionFacade getInitialTransition4r = this.__getInitialTransition4r;
128         if (!this.__getInitialTransition4rSet)
129         {
130             handleGetInitialTransition4rPreCondition();
131             Object result = this.shieldedElement(handleGetInitialTransition());
132             try
133             {
134                 getInitialTransition4r = (org.andromda.metafacades.uml.TransitionFacade)result;
135             }
136             catch (ClassCastException ex)
137             {
138                 // ignore since the metafacade shouldn't
139                 // be set if its not of the correct type
140             }
141             handleGetInitialTransition4rPostCondition();
142             this.__getInitialTransition4r = getInitialTransition4r;
143             if (isMetafacadePropertyCachingEnabled())
144             {
145                 this.__getInitialTransition4rSet = true;
146             }
147         }
148         return getInitialTransition4r;
149     }
150 
151     protected abstract java.lang.Object handleGetInitialTransition();
152 
153     private void handleGetTransitions5rPreCondition()
154     {
155     }
156 
157     private void handleGetTransitions5rPostCondition()
158     {
159     }
160 
161     public final java.util.Collection getTransitions()
162     {
163         java.util.Collection getTransitions5r = null;
164         handleGetTransitions5rPreCondition();
165         Object result = this.shieldedElements(handleGetTransitions());
166         try
167         {
168             getTransitions5r = (java.util.Collection)result;
169         }
170         catch (ClassCastException ex)
171         {
172             // ignore since the metafacade shouldn't
173             // be set if its not of the correct type
174         }
175         handleGetTransitions5rPostCondition();
176         return getTransitions5r;
177     }
178 
179     protected abstract java.util.Collection handleGetTransitions();
180 
181     private void handleGetInitialStates6rPreCondition()
182     {
183     }
184 
185     private void handleGetInitialStates6rPostCondition()
186     {
187     }
188 
189     public final java.util.Collection getInitialStates()
190     {
191         java.util.Collection getInitialStates6r = null;
192         handleGetInitialStates6rPreCondition();
193         Object result = this.shieldedElements(handleGetInitialStates());
194         try
195         {
196             getInitialStates6r = (java.util.Collection)result;
197         }
198         catch (ClassCastException ex)
199         {
200             // ignore since the metafacade shouldn't
201             // be set if its not of the correct type
202         }
203         handleGetInitialStates6rPostCondition();
204         return getInitialStates6r;
205     }
206 
207     protected abstract java.util.Collection handleGetInitialStates();
208 
209     private void handleGetInitialState7rPreCondition()
210     {
211     }
212 
213     private void handleGetInitialState7rPostCondition()
214     {
215     }
216 
217     private org.andromda.metafacades.uml.PseudostateFacade __getInitialState7r;
218     private boolean __getInitialState7rSet = false;
219 
220     public final org.andromda.metafacades.uml.PseudostateFacade getInitialState()
221     {
222         org.andromda.metafacades.uml.PseudostateFacade getInitialState7r = this.__getInitialState7r;
223         if (!this.__getInitialState7rSet)
224         {
225             handleGetInitialState7rPreCondition();
226             Object result = this.shieldedElement(handleGetInitialState());
227             try
228             {
229                 getInitialState7r = (org.andromda.metafacades.uml.PseudostateFacade)result;
230             }
231             catch (ClassCastException ex)
232             {
233                 // ignore since the metafacade shouldn't
234                 // be set if its not of the correct type
235             }
236             handleGetInitialState7rPostCondition();
237             this.__getInitialState7r = getInitialState7r;
238             if (isMetafacadePropertyCachingEnabled())
239             {
240                 this.__getInitialState7rSet = true;
241             }
242         }
243         return getInitialState7r;
244     }
245 
246     protected abstract java.lang.Object handleGetInitialState();
247 
248     private void handleGetPseudostates8rPreCondition()
249     {
250     }
251 
252     private void handleGetPseudostates8rPostCondition()
253     {
254     }
255 
256     public final java.util.Collection getPseudostates()
257     {
258         java.util.Collection getPseudostates8r = null;
259         handleGetPseudostates8rPreCondition();
260         Object result = this.shieldedElements(handleGetPseudostates());
261         try
262         {
263             getPseudostates8r = (java.util.Collection)result;
264         }
265         catch (ClassCastException ex)
266         {
267             // ignore since the metafacade shouldn't
268             // be set if its not of the correct type
269         }
270         handleGetPseudostates8rPostCondition();
271         return getPseudostates8r;
272     }
273 
274     protected abstract java.util.Collection handleGetPseudostates();
275 
276     private void handleGetStates10rPreCondition()
277     {
278     }
279 
280     private void handleGetStates10rPostCondition()
281     {
282     }
283 
284     private java.util.Collection __getStates10r;
285     private boolean __getStates10rSet = false;
286 
287     public final java.util.Collection getStates()
288     {
289         java.util.Collection getStates10r = this.__getStates10r;
290         if (!this.__getStates10rSet)
291         {
292             handleGetStates10rPreCondition();
293             Object result = this.shieldedElements(handleGetStates());
294             try
295             {
296                 getStates10r = (java.util.Collection)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             handleGetStates10rPostCondition();
304             this.__getStates10r = getStates10r;
305             if (isMetafacadePropertyCachingEnabled())
306             {
307                 this.__getStates10rSet = true;
308             }
309         }
310         return getStates10r;
311     }
312 
313     protected abstract java.util.Collection handleGetStates();
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     
323     /***
324      * The property that stores the name of the metafacade.
325      */
326     private static final String NAME_PROPERTY = "name";
327     
328     /***
329      * @see java.lang.Object#toString()
330      */
331     public String toString()
332     {
333         final StringBuffer toString = new StringBuffer(this.getClass().getName());
334         toString.append("[");
335         try
336         {
337             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
338         }
339         catch (final Throwable throwable)
340         {
341             // - just ignore when the metafacade doesn't have a name property
342         }
343         toString.append("]");
344         return toString.toString();
345     }
346 }