KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > sdo > util > SDOSwitch


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2003-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: SDOSwitch.java,v 1.6 2005/06/08 06:24:25 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.sdo.util;
18
19 import org.eclipse.emf.ecore.EClass;
20 import org.eclipse.emf.ecore.EObject;
21 import org.eclipse.emf.ecore.change.ChangeDescription;
22 import org.eclipse.emf.ecore.change.FeatureChange;
23 import org.eclipse.emf.ecore.sdo.*;
24
25 import org.eclipse.emf.ecore.xml.type.AnyType;
26 import org.eclipse.emf.ecore.xml.type.SimpleAnyType;
27
28 import commonj.sdo.ChangeSummary;
29 import commonj.sdo.DataGraph;
30 import commonj.sdo.DataObject;
31 import commonj.sdo.Property;
32 import commonj.sdo.Sequence;
33 import commonj.sdo.Type;
34
35 import java.util.List JavaDoc;
36
37 /**
38  * <!-- begin-user-doc -->
39  * The <b>Switch</b> for the model's inheritance hierarchy.
40  * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
41  * to invoke the <code>caseXXX</code> method for each class of the model,
42  * starting with the actual class of the object
43  * and proceeding up the inheritance hierarchy
44  * until a non-null result is returned,
45  * which is the result of the switch.
46  * <!-- end-user-doc -->
47  * @see org.eclipse.emf.ecore.sdo.SDOPackage
48  * @generated
49  */

50 public class SDOSwitch {
51   /**
52    * The cached model package
53    * <!-- begin-user-doc -->
54    * <!-- end-user-doc -->
55    * @generated
56    */

57   protected static SDOPackage modelPackage;
58
59   /**
60    * Creates an instance of the switch.
61    * <!-- begin-user-doc -->
62    * <!-- end-user-doc -->
63    * @generated
64    */

65   public SDOSwitch()
66   {
67     if (modelPackage == null)
68     {
69       modelPackage = SDOPackage.eINSTANCE;
70     }
71   }
72
73   /**
74    * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
75    * <!-- begin-user-doc -->
76    * <!-- end-user-doc -->
77    * @return the first non-null result returned by a <code>caseXXX</code> call.
78    * @generated
79    */

80   public Object JavaDoc doSwitch(EObject theEObject)
81   {
82     return doSwitch(theEObject.eClass(), theEObject);
83   }
84
85   /**
86    * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
87    * <!-- begin-user-doc -->
88    * <!-- end-user-doc -->
89    * @return the first non-null result returned by a <code>caseXXX</code> call.
90    * @generated
91    */

92   protected Object JavaDoc doSwitch(EClass theEClass, EObject theEObject)
93   {
94     if (theEClass.eContainer() == modelPackage)
95     {
96       return doSwitch(theEClass.getClassifierID(), theEObject);
97     }
98     else
99     {
100       List JavaDoc eSuperTypes = theEClass.getESuperTypes();
101       return
102         eSuperTypes.isEmpty() ?
103           defaultCase(theEObject) :
104           doSwitch((EClass)eSuperTypes.get(0), theEObject);
105     }
106   }
107
108   /**
109    * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
110    * <!-- begin-user-doc -->
111    * <!-- end-user-doc -->
112    * @return the first non-null result returned by a <code>caseXXX</code> call.
113    * @generated
114    */

115   protected Object JavaDoc doSwitch(int classifierID, EObject theEObject)
116   {
117     switch (classifierID)
118     {
119       case SDOPackage.ECHANGE_SUMMARY:
120       {
121         EChangeSummary eChangeSummary = (EChangeSummary)theEObject;
122         Object JavaDoc result = caseEChangeSummary(eChangeSummary);
123         if (result == null) result = caseChangeDescription(eChangeSummary);
124         if (result == null) result = caseChangeSummary(eChangeSummary);
125         if (result == null) result = defaultCase(theEObject);
126         return result;
127       }
128       case SDOPackage.ECHANGE_SUMMARY_SETTING:
129       {
130         EChangeSummarySetting eChangeSummarySetting = (EChangeSummarySetting)theEObject;
131         Object JavaDoc result = caseEChangeSummarySetting(eChangeSummarySetting);
132         if (result == null) result = caseFeatureChange(eChangeSummarySetting);
133         if (result == null) result = caseChangeSummarySetting(eChangeSummarySetting);
134         if (result == null) result = defaultCase(theEObject);
135         return result;
136       }
137       case SDOPackage.EDATA_GRAPH:
138       {
139         EDataGraph eDataGraph = (EDataGraph)theEObject;
140         Object JavaDoc result = caseEDataGraph(eDataGraph);
141         if (result == null) result = caseDataGraph(eDataGraph);
142         if (result == null) result = defaultCase(theEObject);
143         return result;
144       }
145       case SDOPackage.EDATA_OBJECT:
146       {
147         EDataObject eDataObject = (EDataObject)theEObject;
148         Object JavaDoc result = caseEDataObject(eDataObject);
149         if (result == null) result = caseDataObject(eDataObject);
150         if (result == null) result = defaultCase(theEObject);
151         return result;
152       }
153       case SDOPackage.EPROPERTY:
154       {
155         EProperty eProperty = (EProperty)theEObject;
156         Object JavaDoc result = caseEProperty(eProperty);
157         if (result == null) result = caseProperty(eProperty);
158         if (result == null) result = defaultCase(theEObject);
159         return result;
160       }
161       case SDOPackage.ETYPE:
162       {
163         EType eType = (EType)theEObject;
164         Object JavaDoc result = caseEType(eType);
165         if (result == null) result = caseType(eType);
166         if (result == null) result = defaultCase(theEObject);
167         return result;
168       }
169       case SDOPackage.INTERNAL_EDATA_OBJECT:
170       {
171         InternalEDataObject internalEDataObject = (InternalEDataObject)theEObject;
172         Object JavaDoc result = caseInternalEDataObject(internalEDataObject);
173         if (result == null) result = caseEDataObject(internalEDataObject);
174         if (result == null) result = caseDataObject(internalEDataObject);
175         if (result == null) result = defaultCase(theEObject);
176         return result;
177       }
178       case SDOPackage.EDATA_OBJECT_ANY_TYPE:
179       {
180         EDataObjectAnyType eDataObjectAnyType = (EDataObjectAnyType)theEObject;
181         Object JavaDoc result = caseEDataObjectAnyType(eDataObjectAnyType);
182         if (result == null) result = caseAnyType(eDataObjectAnyType);
183         if (result == null) result = caseEDataObject(eDataObjectAnyType);
184         if (result == null) result = caseDataObject(eDataObjectAnyType);
185         if (result == null) result = defaultCase(theEObject);
186         return result;
187       }
188       case SDOPackage.EDATA_OBJECT_SIMPLE_ANY_TYPE:
189       {
190         EDataObjectSimpleAnyType eDataObjectSimpleAnyType = (EDataObjectSimpleAnyType)theEObject;
191         Object JavaDoc result = caseEDataObjectSimpleAnyType(eDataObjectSimpleAnyType);
192         if (result == null) result = caseSimpleAnyType(eDataObjectSimpleAnyType);
193         if (result == null) result = caseEDataObjectAnyType(eDataObjectSimpleAnyType);
194         if (result == null) result = caseAnyType(eDataObjectSimpleAnyType);
195         if (result == null) result = caseEDataObject(eDataObjectSimpleAnyType);
196         if (result == null) result = caseDataObject(eDataObjectSimpleAnyType);
197         if (result == null) result = defaultCase(theEObject);
198         return result;
199       }
200       default: return defaultCase(theEObject);
201     }
202   }
203
204   /**
205    * Returns the result of interpretting the object as an instance of '<em>EData Object</em>'.
206    * <!-- begin-user-doc -->
207    * This implementation returns null;
208    * returning a non-null result will terminate the switch.
209    * <!-- end-user-doc -->
210    * @param object the target of the switch.
211    * @return the result of interpretting the object as an instance of '<em>EData Object</em>'.
212    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
213    * @generated
214    */

215   public Object JavaDoc caseEDataObject(EDataObject object)
216   {
217     return null;
218   }
219
220   /**
221    * Returns the result of interpretting the object as an instance of '<em>EData Graph</em>'.
222    * <!-- begin-user-doc -->
223    * This implementation returns null;
224    * returning a non-null result will terminate the switch.
225    * <!-- end-user-doc -->
226    * @param object the target of the switch.
227    * @return the result of interpretting the object as an instance of '<em>EData Graph</em>'.
228    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
229    * @generated
230    */

231   public Object JavaDoc caseEDataGraph(EDataGraph object)
232   {
233     return null;
234   }
235
236   /**
237    * Returns the result of interpretting the object as an instance of '<em>EChange Summary</em>'.
238    * <!-- begin-user-doc -->
239    * This implementation returns null;
240    * returning a non-null result will terminate the switch.
241    * <!-- end-user-doc -->
242    * @param object the target of the switch.
243    * @return the result of interpretting the object as an instance of '<em>EChange Summary</em>'.
244    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
245    * @generated
246    */

247   public Object JavaDoc caseEChangeSummary(EChangeSummary object)
248   {
249     return null;
250   }
251
252   /**
253    * Returns the result of interpretting the object as an instance of '<em>EProperty</em>'.
254    * <!-- begin-user-doc -->
255    * This implementation returns null;
256    * returning a non-null result will terminate the switch.
257    * <!-- end-user-doc -->
258    * @param object the target of the switch.
259    * @return the result of interpretting the object as an instance of '<em>EProperty</em>'.
260    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
261    * @generated
262    */

263   public Object JavaDoc caseEProperty(EProperty object)
264   {
265     return null;
266   }
267
268   /**
269    * Returns the result of interpretting the object as an instance of '<em>Data Object</em>'.
270    * <!-- begin-user-doc -->
271    * This implementation returns null;
272    * returning a non-null result will terminate the switch.
273    * <!-- end-user-doc -->
274    * @param object the target of the switch.
275    * @return the result of interpretting the object as an instance of '<em>Data Object</em>'.
276    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
277    * @generated
278    */

279   public Object JavaDoc caseDataObject(DataObject object)
280   {
281     return null;
282   }
283
284   /**
285    * Returns the result of interpretting the object as an instance of '<em>ESequence</em>'.
286    * <!-- begin-user-doc -->
287    * This implementation returns null;
288    * returning a non-null result will terminate the switch.
289    * <!-- end-user-doc -->
290    * @param object the target of the switch.
291    * @return the result of interpretting the object as an instance of '<em>ESequence</em>'.
292    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
293    * @generated
294    */

295   public Object JavaDoc caseESequence(ESequence object)
296   {
297     return null;
298   }
299
300   /**
301    * Returns the result of interpretting the object as an instance of '<em>Data Graph</em>'.
302    * <!-- begin-user-doc -->
303    * This implementation returns null;
304    * returning a non-null result will terminate the switch.
305    * <!-- end-user-doc -->
306    * @param object the target of the switch.
307    * @return the result of interpretting the object as an instance of '<em>Data Graph</em>'.
308    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
309    * @generated
310    */

311   public Object JavaDoc caseDataGraph(DataGraph object)
312   {
313     return null;
314   }
315
316   /**
317    * Returns the result of interpretting the object as an instance of '<em>Change Summary</em>'.
318    * <!-- begin-user-doc -->
319    * This implementation returns null;
320    * returning a non-null result will terminate the switch.
321    * <!-- end-user-doc -->
322    * @param object the target of the switch.
323    * @return the result of interpretting the object as an instance of '<em>Change Summary</em>'.
324    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
325    * @generated
326    */

327   public Object JavaDoc caseChangeSummary(ChangeSummary object)
328   {
329     return null;
330   }
331
332   /**
333    * Returns the result of interpretting the object as an instance of '<em>EType</em>'.
334    * <!-- begin-user-doc -->
335    * This implementation returns null;
336    * returning a non-null result will terminate the switch.
337    * <!-- end-user-doc -->
338    * @param object the target of the switch.
339    * @return the result of interpretting the object as an instance of '<em>EType</em>'.
340    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
341    * @generated
342    */

343   public Object JavaDoc caseEType(EType object)
344   {
345     return null;
346   }
347
348   /**
349    * Returns the result of interpretting the object as an instance of '<em>Type</em>'.
350    * <!-- begin-user-doc -->
351    * This implementation returns null;
352    * returning a non-null result will terminate the switch.
353    * <!-- end-user-doc -->
354    * @param object the target of the switch.
355    * @return the result of interpretting the object as an instance of '<em>Type</em>'.
356    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
357    * @generated
358    */

359   public Object JavaDoc caseType(Type object)
360   {
361     return null;
362   }
363
364   /**
365    * Returns the result of interpretting the object as an instance of '<em>Property</em>'.
366    * <!-- begin-user-doc -->
367    * This implementation returns null;
368    * returning a non-null result will terminate the switch.
369    * <!-- end-user-doc -->
370    * @param object the target of the switch.
371    * @return the result of interpretting the object as an instance of '<em>Property</em>'.
372    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
373    * @generated
374    */

375   public Object JavaDoc caseProperty(Property object)
376   {
377     return null;
378   }
379
380   /**
381    * Returns the result of interpretting the object as an instance of '<em>Sequence</em>'.
382    * <!-- begin-user-doc -->
383    * This implementation returns null;
384    * returning a non-null result will terminate the switch.
385    * <!-- end-user-doc -->
386    * @param object the target of the switch.
387    * @return the result of interpretting the object as an instance of '<em>Sequence</em>'.
388    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
389    * @generated
390    */

391   public Object JavaDoc caseSequence(Sequence object)
392   {
393     return null;
394   }
395
396   /**
397    * Returns the result of interpretting the object as an instance of '<em>EChange Summary Setting</em>'.
398    * <!-- begin-user-doc -->
399    * This implementation returns null;
400    * returning a non-null result will terminate the switch.
401    * <!-- end-user-doc -->
402    * @param object the target of the switch.
403    * @return the result of interpretting the object as an instance of '<em>EChange Summary Setting</em>'.
404    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
405    * @generated
406    */

407   public Object JavaDoc caseEChangeSummarySetting(EChangeSummarySetting object)
408   {
409     return null;
410   }
411
412   /**
413    * Returns the result of interpretting the object as an instance of '<em>Internal EData Object</em>'.
414    * <!-- begin-user-doc -->
415    * This implementation returns null;
416    * returning a non-null result will terminate the switch.
417    * <!-- end-user-doc -->
418    * @param object the target of the switch.
419    * @return the result of interpretting the object as an instance of '<em>Internal EData Object</em>'.
420    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
421    * @generated
422    */

423   public Object JavaDoc caseInternalEDataObject(InternalEDataObject object)
424   {
425     return null;
426   }
427
428   /**
429    * Returns the result of interpretting the object as an instance of '<em>EData Object Any Type</em>'.
430    * <!-- begin-user-doc -->
431    * This implementation returns null;
432    * returning a non-null result will terminate the switch.
433    * <!-- end-user-doc -->
434    * @param object the target of the switch.
435    * @return the result of interpretting the object as an instance of '<em>EData Object Any Type</em>'.
436    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
437    * @generated
438    */

439   public Object JavaDoc caseEDataObjectAnyType(EDataObjectAnyType object)
440   {
441     return null;
442   }
443
444   /**
445    * Returns the result of interpretting the object as an instance of '<em>EData Object Simple Any Type</em>'.
446    * <!-- begin-user-doc -->
447    * This implementation returns null;
448    * returning a non-null result will terminate the switch.
449    * <!-- end-user-doc -->
450    * @param object the target of the switch.
451    * @return the result of interpretting the object as an instance of '<em>EData Object Simple Any Type</em>'.
452    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
453    * @generated
454    */

455   public Object JavaDoc caseEDataObjectSimpleAnyType(EDataObjectSimpleAnyType object)
456   {
457     return null;
458   }
459
460   /**
461    * Returns the result of interpretting the object as an instance of '<em>Description</em>'.
462    * <!-- begin-user-doc -->
463    * This implementation returns null;
464    * returning a non-null result will terminate the switch.
465    * <!-- end-user-doc -->
466    * @param object the target of the switch.
467    * @return the result of interpretting the object as an instance of '<em>Description</em>'.
468    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
469    * @generated
470    */

471   public Object JavaDoc caseChangeDescription(ChangeDescription object)
472   {
473     return null;
474   }
475
476   /**
477    * Returns the result of interpretting the object as an instance of '<em>Feature Change</em>'.
478    * <!-- begin-user-doc -->
479    * This implementation returns null;
480    * returning a non-null result will terminate the switch.
481    * <!-- end-user-doc -->
482    * @param object the target of the switch.
483    * @return the result of interpretting the object as an instance of '<em>Feature Change</em>'.
484    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
485    * @generated
486    */

487   public Object JavaDoc caseFeatureChange(FeatureChange object)
488   {
489     return null;
490   }
491
492   /**
493    * Returns the result of interpretting the object as an instance of '<em>Any Type</em>'.
494    * <!-- begin-user-doc -->
495    * This implementation returns null;
496    * returning a non-null result will terminate the switch.
497    * <!-- end-user-doc -->
498    * @param object the target of the switch.
499    * @return the result of interpretting the object as an instance of '<em>Any Type</em>'.
500    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
501    * @generated
502    */

503   public Object JavaDoc caseAnyType(AnyType object)
504   {
505     return null;
506   }
507
508   /**
509    * Returns the result of interpretting the object as an instance of '<em>Simple Any Type</em>'.
510    * <!-- begin-user-doc -->
511    * This implementation returns null;
512    * returning a non-null result will terminate the switch.
513    * <!-- end-user-doc -->
514    * @param object the target of the switch.
515    * @return the result of interpretting the object as an instance of '<em>Simple Any Type</em>'.
516    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
517    * @generated
518    */

519   public Object JavaDoc caseSimpleAnyType(SimpleAnyType object)
520   {
521     return null;
522   }
523
524   /**
525    * Returns the result of interpretting the object as an instance of '<em>Change Summary Setting</em>'.
526    * <!-- begin-user-doc -->
527    * This implementation returns null;
528    * returning a non-null result will terminate the switch.
529    * <!-- end-user-doc -->
530    * @param object the target of the switch.
531    * @return the result of interpretting the object as an instance of '<em>Change Summary Setting</em>'.
532    * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
533    * @generated
534    */

535   public Object JavaDoc caseChangeSummarySetting(ChangeSummary.Setting object)
536   {
537     return null;
538   }
539
540   /**
541    * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
542    * <!-- begin-user-doc -->
543    * This implementation returns null;
544    * returning a non-null result will terminate the switch, but this is the last case anyway.
545    * <!-- end-user-doc -->
546    * @param object the target of the switch.
547    * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
548    * @see #doSwitch(org.eclipse.emf.ecore.EObject)
549    * @generated
550    */

551   public Object JavaDoc defaultCase(EObject object)
552   {
553     return null;
554   }
555
556 } //SDOSwitch
557
Popular Tags