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.ModelFacade
8    *
9    * @see org.andromda.metafacades.uml.ModelFacade
10   */
11  public abstract class ModelFacadeLogic
12      extends org.andromda.core.metafacade.MetafacadeBase
13      implements org.andromda.metafacades.uml.ModelFacade
14  {
15  
16      protected org.omg.uml.UmlPackage metaObject;
17  
18      public ModelFacadeLogic(org.omg.uml.UmlPackage 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.ModelFacade";
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.ModelFacade
50       */
51      public boolean isModelFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ---------------- business methods ----------------------
57  
58      protected abstract org.andromda.metafacades.uml.UseCaseFacade handleFindUseCaseWithTaggedValueOrHyperlink(java.lang.String tag, java.lang.String value);
59  
60      private void handleFindUseCaseWithTaggedValueOrHyperlink1oPreCondition()
61      {
62      }
63  
64      private void handleFindUseCaseWithTaggedValueOrHyperlink1oPostCondition()
65      {
66      }
67  
68      public org.andromda.metafacades.uml.UseCaseFacade findUseCaseWithTaggedValueOrHyperlink(java.lang.String tag, java.lang.String value)
69      {
70          handleFindUseCaseWithTaggedValueOrHyperlink1oPreCondition();
71          org.andromda.metafacades.uml.UseCaseFacade returnValue = handleFindUseCaseWithTaggedValueOrHyperlink(tag, value);
72          handleFindUseCaseWithTaggedValueOrHyperlink1oPostCondition();
73          return returnValue;
74      }
75  
76      protected abstract org.andromda.metafacades.uml.ClassifierFacade handleFindClassWithTaggedValueOrHyperlink(java.lang.String tag, java.lang.String value);
77  
78      private void handleFindClassWithTaggedValueOrHyperlink2oPreCondition()
79      {
80      }
81  
82      private void handleFindClassWithTaggedValueOrHyperlink2oPostCondition()
83      {
84      }
85  
86      public org.andromda.metafacades.uml.ClassifierFacade findClassWithTaggedValueOrHyperlink(java.lang.String tag, java.lang.String value)
87      {
88          handleFindClassWithTaggedValueOrHyperlink2oPreCondition();
89          org.andromda.metafacades.uml.ClassifierFacade returnValue = handleFindClassWithTaggedValueOrHyperlink(tag, value);
90          handleFindClassWithTaggedValueOrHyperlink2oPostCondition();
91          return returnValue;
92      }
93  
94      protected abstract org.andromda.metafacades.uml.ActivityGraphFacade handleFindActivityGraphByName(java.lang.String name);
95  
96      private void handleFindActivityGraphByName3oPreCondition()
97      {
98      }
99  
100     private void handleFindActivityGraphByName3oPostCondition()
101     {
102     }
103 
104     public org.andromda.metafacades.uml.ActivityGraphFacade findActivityGraphByName(java.lang.String name)
105     {
106         handleFindActivityGraphByName3oPreCondition();
107         org.andromda.metafacades.uml.ActivityGraphFacade returnValue = handleFindActivityGraphByName(name);
108         handleFindActivityGraphByName3oPostCondition();
109         return returnValue;
110     }
111 
112     protected abstract org.andromda.metafacades.uml.ActivityGraphFacade handleFindActivityGraphByNameAndStereotype(java.lang.String name, java.lang.String stereotypeName);
113 
114     private void handleFindActivityGraphByNameAndStereotype4oPreCondition()
115     {
116     }
117 
118     private void handleFindActivityGraphByNameAndStereotype4oPostCondition()
119     {
120     }
121 
122     public org.andromda.metafacades.uml.ActivityGraphFacade findActivityGraphByNameAndStereotype(java.lang.String name, java.lang.String stereotypeName)
123     {
124         handleFindActivityGraphByNameAndStereotype4oPreCondition();
125         org.andromda.metafacades.uml.ActivityGraphFacade returnValue = handleFindActivityGraphByNameAndStereotype(name, stereotypeName);
126         handleFindActivityGraphByNameAndStereotype4oPostCondition();
127         return returnValue;
128     }
129 
130     protected abstract org.andromda.metafacades.uml.UseCaseFacade handleFindUseCaseByName(java.lang.String name);
131 
132     private void handleFindUseCaseByName5oPreCondition()
133     {
134     }
135 
136     private void handleFindUseCaseByName5oPostCondition()
137     {
138     }
139 
140     public org.andromda.metafacades.uml.UseCaseFacade findUseCaseByName(java.lang.String name)
141     {
142         handleFindUseCaseByName5oPreCondition();
143         org.andromda.metafacades.uml.UseCaseFacade returnValue = handleFindUseCaseByName(name);
144         handleFindUseCaseByName5oPostCondition();
145         return returnValue;
146     }
147 
148     protected abstract org.andromda.metafacades.uml.UseCaseFacade handleFindUseCaseWithNameAndStereotype(java.lang.String name, java.lang.String stereotypeName);
149 
150     private void handleFindUseCaseWithNameAndStereotype6oPreCondition()
151     {
152     }
153 
154     private void handleFindUseCaseWithNameAndStereotype6oPostCondition()
155     {
156     }
157 
158     public org.andromda.metafacades.uml.UseCaseFacade findUseCaseWithNameAndStereotype(java.lang.String name, java.lang.String stereotypeName)
159     {
160         handleFindUseCaseWithNameAndStereotype6oPreCondition();
161         org.andromda.metafacades.uml.UseCaseFacade returnValue = handleFindUseCaseWithNameAndStereotype(name, stereotypeName);
162         handleFindUseCaseWithNameAndStereotype6oPostCondition();
163         return returnValue;
164     }
165 
166     protected abstract java.util.Collection handleFindFinalStatesWithNameOrHyperlink(org.andromda.metafacades.uml.UseCaseFacade useCase);
167 
168     private void handleFindFinalStatesWithNameOrHyperlink7oPreCondition()
169     {
170     }
171 
172     private void handleFindFinalStatesWithNameOrHyperlink7oPostCondition()
173     {
174     }
175 
176     public java.util.Collection findFinalStatesWithNameOrHyperlink(org.andromda.metafacades.uml.UseCaseFacade useCase)
177     {
178         handleFindFinalStatesWithNameOrHyperlink7oPreCondition();
179         java.util.Collection returnValue = handleFindFinalStatesWithNameOrHyperlink(useCase);
180         handleFindFinalStatesWithNameOrHyperlink7oPostCondition();
181         return returnValue;
182     }
183 
184     protected abstract java.util.Collection handleGetAllActionStatesWithStereotype(org.andromda.metafacades.uml.ActivityGraphFacade activityGraph, java.lang.String stereotypeName);
185 
186     private void handleGetAllActionStatesWithStereotype8oPreCondition()
187     {
188     }
189 
190     private void handleGetAllActionStatesWithStereotype8oPostCondition()
191     {
192     }
193 
194     public java.util.Collection getAllActionStatesWithStereotype(org.andromda.metafacades.uml.ActivityGraphFacade activityGraph, java.lang.String stereotypeName)
195     {
196         handleGetAllActionStatesWithStereotype8oPreCondition();
197         java.util.Collection returnValue = handleGetAllActionStatesWithStereotype(activityGraph, stereotypeName);
198         handleGetAllActionStatesWithStereotype8oPostCondition();
199         return returnValue;
200     }
201 
202     // ------------- associations ------------------
203 
204     private void handleGetRootPackage1rPreCondition()
205     {
206     }
207 
208     private void handleGetRootPackage1rPostCondition()
209     {
210     }
211 
212     public final org.andromda.metafacades.uml.PackageFacade getRootPackage()
213     {
214         org.andromda.metafacades.uml.PackageFacade getRootPackage1r = null;
215         handleGetRootPackage1rPreCondition();
216         Object result = this.shieldedElement(handleGetRootPackage());
217         try
218         {
219             getRootPackage1r = (org.andromda.metafacades.uml.PackageFacade)result;
220         }
221         catch (ClassCastException ex)
222         {
223             // ignore since the metafacade shouldn't
224             // be set if its not of the correct type
225         }
226         handleGetRootPackage1rPostCondition();
227         return getRootPackage1r;
228     }
229 
230     protected abstract java.lang.Object handleGetRootPackage();
231 
232     private void handleGetAllActors3rPreCondition()
233     {
234     }
235 
236     private void handleGetAllActors3rPostCondition()
237     {
238     }
239 
240     public final java.util.Collection getAllActors()
241     {
242         java.util.Collection getAllActors3r = null;
243         handleGetAllActors3rPreCondition();
244         Object result = this.shieldedElements(handleGetAllActors());
245         try
246         {
247             getAllActors3r = (java.util.Collection)result;
248         }
249         catch (ClassCastException ex)
250         {
251             // ignore since the metafacade shouldn't
252             // be set if its not of the correct type
253         }
254         handleGetAllActors3rPostCondition();
255         return getAllActors3r;
256     }
257 
258     protected abstract java.util.Collection handleGetAllActors();
259 
260     private void handleGetAllUseCases4rPreCondition()
261     {
262     }
263 
264     private void handleGetAllUseCases4rPostCondition()
265     {
266     }
267 
268     public final java.util.Collection getAllUseCases()
269     {
270         java.util.Collection getAllUseCases4r = null;
271         handleGetAllUseCases4rPreCondition();
272         Object result = this.shieldedElements(handleGetAllUseCases());
273         try
274         {
275             getAllUseCases4r = (java.util.Collection)result;
276         }
277         catch (ClassCastException ex)
278         {
279             // ignore since the metafacade shouldn't
280             // be set if its not of the correct type
281         }
282         handleGetAllUseCases4rPostCondition();
283         return getAllUseCases4r;
284     }
285 
286     protected abstract java.util.Collection handleGetAllUseCases();
287 
288     private void handleGetAllActionStates5rPreCondition()
289     {
290     }
291 
292     private void handleGetAllActionStates5rPostCondition()
293     {
294     }
295 
296     public final java.util.Collection getAllActionStates()
297     {
298         java.util.Collection getAllActionStates5r = null;
299         handleGetAllActionStates5rPreCondition();
300         Object result = this.shieldedElements(handleGetAllActionStates());
301         try
302         {
303             getAllActionStates5r = (java.util.Collection)result;
304         }
305         catch (ClassCastException ex)
306         {
307             // ignore since the metafacade shouldn't
308             // be set if its not of the correct type
309         }
310         handleGetAllActionStates5rPostCondition();
311         return getAllActionStates5r;
312     }
313 
314     protected abstract java.util.Collection handleGetAllActionStates();
315 
316     private void handleGetAllClasses6rPreCondition()
317     {
318     }
319 
320     private void handleGetAllClasses6rPostCondition()
321     {
322     }
323 
324     private java.util.Collection __getAllClasses6r;
325     private boolean __getAllClasses6rSet = false;
326 
327     public final java.util.Collection getAllClasses()
328     {
329         java.util.Collection getAllClasses6r = this.__getAllClasses6r;
330         if (!this.__getAllClasses6rSet)
331         {
332             handleGetAllClasses6rPreCondition();
333             Object result = this.shieldedElements(handleGetAllClasses());
334             try
335             {
336                 getAllClasses6r = (java.util.Collection)result;
337             }
338             catch (ClassCastException ex)
339             {
340                 // ignore since the metafacade shouldn't
341                 // be set if its not of the correct type
342             }
343             handleGetAllClasses6rPostCondition();
344             this.__getAllClasses6r = getAllClasses6r;
345             if (isMetafacadePropertyCachingEnabled())
346             {
347                 this.__getAllClasses6rSet = true;
348             }
349         }
350         return getAllClasses6r;
351     }
352 
353     protected abstract java.util.Collection handleGetAllClasses();
354 
355     private void handleGetAllObjectFlowStates7rPreCondition()
356     {
357     }
358 
359     private void handleGetAllObjectFlowStates7rPostCondition()
360     {
361     }
362 
363     private java.util.Collection __getAllObjectFlowStates7r;
364     private boolean __getAllObjectFlowStates7rSet = false;
365 
366     public final java.util.Collection getAllObjectFlowStates()
367     {
368         java.util.Collection getAllObjectFlowStates7r = this.__getAllObjectFlowStates7r;
369         if (!this.__getAllObjectFlowStates7rSet)
370         {
371             handleGetAllObjectFlowStates7rPreCondition();
372             Object result = this.shieldedElements(handleGetAllObjectFlowStates());
373             try
374             {
375                 getAllObjectFlowStates7r = (java.util.Collection)result;
376             }
377             catch (ClassCastException ex)
378             {
379                 // ignore since the metafacade shouldn't
380                 // be set if its not of the correct type
381             }
382             handleGetAllObjectFlowStates7rPostCondition();
383             this.__getAllObjectFlowStates7r = getAllObjectFlowStates7r;
384             if (isMetafacadePropertyCachingEnabled())
385             {
386                 this.__getAllObjectFlowStates7rSet = true;
387             }
388         }
389         return getAllObjectFlowStates7r;
390     }
391 
392     protected abstract java.util.Collection handleGetAllObjectFlowStates();
393 
394     /***
395      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
396      */
397     public void validateInvariants(java.util.Collection validationMessages)
398     {
399     }
400     
401     /***
402      * The property that stores the name of the metafacade.
403      */
404     private static final String NAME_PROPERTY = "name";
405     
406     /***
407      * @see java.lang.Object#toString()
408      */
409     public String toString()
410     {
411         final StringBuffer toString = new StringBuffer(this.getClass().getName());
412         toString.append("[");
413         try
414         {
415             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
416         }
417         catch (final Throwable throwable)
418         {
419             // - just ignore when the metafacade doesn't have a name property
420         }
421         toString.append("]");
422         return toString.toString();
423     }
424 }