KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > mapping > util > MappingAdapterFactory


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-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: MappingAdapterFactory.java,v 1.3 2005/06/08 06:21:43 nickb Exp $
16  */

17 package org.eclipse.emf.mapping.util;
18
19 import org.eclipse.emf.common.notify.Adapter;
20 import org.eclipse.emf.common.notify.Notifier;
21 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
22 import org.eclipse.emf.ecore.EObject;
23 import org.eclipse.emf.mapping.*;
24
25
26 /**
27  * <!-- begin-user-doc -->
28  * The <b>Adapter Factory</b> for the model.
29  * It provides an adapter <code>createXXX</code> method for each class of the model.
30  * <!-- end-user-doc -->
31  * @see org.eclipse.emf.mapping.MappingPackage
32  * @generated
33  */

34 public class MappingAdapterFactory extends AdapterFactoryImpl
35 {
36
37   /**
38    * The cached model package.
39    * <!-- begin-user-doc -->
40    * <!-- end-user-doc -->
41    * @generated
42    */

43   protected static MappingPackage modelPackage;
44
45   /**
46    * Creates an instance of the adapter factory.
47    * <!-- begin-user-doc -->
48    * <!-- end-user-doc -->
49    * @generated
50    */

51   public MappingAdapterFactory()
52   {
53     if (modelPackage == null)
54     {
55       modelPackage = MappingPackage.eINSTANCE;
56     }
57   }
58
59   /**
60    * Returns whether this factory is applicable for the type of the object.
61    * <!-- begin-user-doc -->
62    * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
63    * <!-- end-user-doc -->
64    * @return whether this factory is applicable for the type of the object.
65    * @generated
66    */

67   public boolean isFactoryForType(Object JavaDoc object)
68   {
69     if (object == modelPackage)
70     {
71       return true;
72     }
73     if (object instanceof EObject)
74     {
75       return ((EObject)object).eClass().getEPackage() == modelPackage;
76     }
77     return false;
78   }
79
80   /**
81    * The switch the delegates to the <code>createXXX</code> methods.
82    * <!-- begin-user-doc -->
83    * <!-- end-user-doc -->
84    * @generated
85    */

86   protected MappingSwitch modelSwitch =
87     new MappingSwitch()
88     {
89       public Object JavaDoc caseMappingHelper(MappingHelper object)
90       {
91         return createMappingHelperAdapter();
92       }
93       public Object JavaDoc caseMapping(Mapping object)
94       {
95         return createMappingAdapter();
96       }
97       public Object JavaDoc caseTypeConverter(TypeConverter object)
98       {
99         return createTypeConverterAdapter();
100       }
101       public Object JavaDoc caseFunctionPair(FunctionPair object)
102       {
103         return createFunctionPairAdapter();
104       }
105       public Object JavaDoc caseFunctionNamePair(FunctionNamePair object)
106       {
107         return createFunctionNamePairAdapter();
108       }
109       public Object JavaDoc caseMappingStrategy(MappingStrategy object)
110       {
111         return createMappingStrategyAdapter();
112       }
113       public Object JavaDoc caseMappingRoot(MappingRoot object)
114       {
115         return createMappingRootAdapter();
116       }
117       public Object JavaDoc caseComplexTypeConverter(ComplexTypeConverter object)
118       {
119         return createComplexTypeConverterAdapter();
120       }
121       public Object JavaDoc defaultCase(EObject object)
122       {
123         return createEObjectAdapter();
124       }
125     };
126
127   /**
128    * Creates an adapter for the <code>target</code>.
129    * <!-- begin-user-doc -->
130    * <!-- end-user-doc -->
131    * @param target the object to adapt.
132    * @return the adapter for the <code>target</code>.
133    * @generated
134    */

135   public Adapter createAdapter(Notifier target)
136   {
137     return (Adapter)modelSwitch.doSwitch((EObject)target);
138   }
139
140
141   /**
142    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.MappingHelper <em>Helper</em>}'.
143    * <!-- begin-user-doc -->
144    * This default implementation returns null so that we can easily ignore cases;
145    * it's useful to ignore a case when inheritance will catch all the cases anyway.
146    * <!-- end-user-doc -->
147    * @return the new adapter.
148    * @see org.eclipse.emf.mapping.MappingHelper
149    * @generated
150    */

151   public Adapter createMappingHelperAdapter()
152   {
153     return null;
154   }
155
156   /**
157    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.Mapping <em>Mapping</em>}'.
158    * <!-- begin-user-doc -->
159    * This default implementation returns null so that we can easily ignore cases;
160    * it's useful to ignore a case when inheritance will catch all the cases anyway.
161    * <!-- end-user-doc -->
162    * @return the new adapter.
163    * @see org.eclipse.emf.mapping.Mapping
164    * @generated
165    */

166   public Adapter createMappingAdapter()
167   {
168     return null;
169   }
170
171   /**
172    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.TypeConverter <em>Type Converter</em>}'.
173    * <!-- begin-user-doc -->
174    * This default implementation returns null so that we can easily ignore cases;
175    * it's useful to ignore a case when inheritance will catch all the cases anyway.
176    * <!-- end-user-doc -->
177    * @return the new adapter.
178    * @see org.eclipse.emf.mapping.TypeConverter
179    * @generated
180    */

181   public Adapter createTypeConverterAdapter()
182   {
183     return null;
184   }
185
186   /**
187    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.FunctionPair <em>Function Pair</em>}'.
188    * <!-- begin-user-doc -->
189    * This default implementation returns null so that we can easily ignore cases;
190    * it's useful to ignore a case when inheritance will catch all the cases anyway.
191    * <!-- end-user-doc -->
192    * @return the new adapter.
193    * @see org.eclipse.emf.mapping.FunctionPair
194    * @generated
195    */

196   public Adapter createFunctionPairAdapter()
197   {
198     return null;
199   }
200
201   /**
202    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.FunctionNamePair <em>Function Name Pair</em>}'.
203    * <!-- begin-user-doc -->
204    * This default implementation returns null so that we can easily ignore cases;
205    * it's useful to ignore a case when inheritance will catch all the cases anyway.
206    * <!-- end-user-doc -->
207    * @return the new adapter.
208    * @see org.eclipse.emf.mapping.FunctionNamePair
209    * @generated
210    */

211   public Adapter createFunctionNamePairAdapter()
212   {
213     return null;
214   }
215
216   /**
217    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.MappingStrategy <em>Strategy</em>}'.
218    * <!-- begin-user-doc -->
219    * This default implementation returns null so that we can easily ignore cases;
220    * it's useful to ignore a case when inheritance will catch all the cases anyway.
221    * <!-- end-user-doc -->
222    * @return the new adapter.
223    * @see org.eclipse.emf.mapping.MappingStrategy
224    * @generated
225    */

226   public Adapter createMappingStrategyAdapter()
227   {
228     return null;
229   }
230
231   /**
232    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.MappingRoot <em>Root</em>}'.
233    * <!-- begin-user-doc -->
234    * This default implementation returns null so that we can easily ignore cases;
235    * it's useful to ignore a case when inheritance will catch all the cases anyway.
236    * <!-- end-user-doc -->
237    * @return the new adapter.
238    * @see org.eclipse.emf.mapping.MappingRoot
239    * @generated
240    */

241   public Adapter createMappingRootAdapter()
242   {
243     return null;
244   }
245
246   /**
247    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.ComplexTypeConverter <em>Complex Type Converter</em>}'.
248    * <!-- begin-user-doc -->
249    * This default implementation returns null so that we can easily ignore cases;
250    * it's useful to ignore a case when inheritance will catch all the cases anyway.
251    * <!-- end-user-doc -->
252    * @return the new adapter.
253    * @see org.eclipse.emf.mapping.ComplexTypeConverter
254    * @generated
255    */

256   public Adapter createComplexTypeConverterAdapter()
257   {
258     return null;
259   }
260
261   /**
262    * Creates a new adapter for the default case.
263    * <!-- begin-user-doc -->
264    * This default implementation returns null.
265    * <!-- end-user-doc -->
266    * @return the new adapter.
267    * @generated
268    */

269   public Adapter createEObjectAdapter()
270   {
271     return null;
272   }
273
274 } //MappingAdapterFactory
275
Popular Tags