KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > change > util > ChangeAdapterFactory


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: ChangeAdapterFactory.java,v 1.4 2005/06/08 06:16:16 nickb Exp $
16  */

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

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

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

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

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

87   protected ChangeSwitch modelSwitch =
88     new ChangeSwitch()
89     {
90       public Object JavaDoc caseChangeDescription(ChangeDescription object)
91       {
92         return createChangeDescriptionAdapter();
93       }
94       public Object JavaDoc caseEObjectToChangesMapEntry(Map.Entry JavaDoc object)
95       {
96         return createEObjectToChangesMapEntryAdapter();
97       }
98       public Object JavaDoc caseFeatureChange(FeatureChange object)
99       {
100         return createFeatureChangeAdapter();
101       }
102       public Object JavaDoc caseListChange(ListChange object)
103       {
104         return createListChangeAdapter();
105       }
106       public Object JavaDoc caseResourceChange(ResourceChange object)
107       {
108         return createResourceChangeAdapter();
109       }
110       public Object JavaDoc caseFeatureMapEntry(FeatureMapEntry object)
111       {
112         return createFeatureMapEntryAdapter();
113       }
114       public Object JavaDoc defaultCase(EObject object)
115       {
116         return createEObjectAdapter();
117       }
118     };
119
120   /**
121    * Creates an adapter for the <code>target</code>.
122    * <!-- begin-user-doc -->
123    * <!-- end-user-doc -->
124    * @param target the object to adapt.
125    * @return the adapter for the <code>target</code>.
126    * @generated
127    */

128   public Adapter createAdapter(Notifier target)
129   {
130     return (Adapter)modelSwitch.doSwitch((EObject)target);
131   }
132
133
134   /**
135    * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.change.ChangeDescription <em>Description</em>}'.
136    * <!-- begin-user-doc -->
137    * This default implementation returns null so that we can easily ignore cases;
138    * it's useful to ignore a case when inheritance will catch all the cases anyway.
139    * <!-- end-user-doc -->
140    * @return the new adapter.
141    * @see org.eclipse.emf.ecore.change.ChangeDescription
142    * @generated
143    */

144   public Adapter createChangeDescriptionAdapter()
145   {
146     return null;
147   }
148
149   /**
150    * Creates a new adapter for an object of class '{@link java.util.Map.Entry <em>EObject To Changes Map Entry</em>}'.
151    * <!-- begin-user-doc -->
152    * This default implementation returns null so that we can easily ignore cases;
153    * it's useful to ignore a case when inheritance will catch all the cases anyway.
154    * <!-- end-user-doc -->
155    * @return the new adapter.
156    * @see java.util.Map.Entry
157    * @generated
158    */

159   public Adapter createEObjectToChangesMapEntryAdapter()
160   {
161     return null;
162   }
163
164   /**
165    * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.change.FeatureChange <em>Feature Change</em>}'.
166    * <!-- begin-user-doc -->
167    * This default implementation returns null so that we can easily ignore cases;
168    * it's useful to ignore a case when inheritance will catch all the cases anyway.
169    * <!-- end-user-doc -->
170    * @return the new adapter.
171    * @see org.eclipse.emf.ecore.change.FeatureChange
172    * @generated
173    */

174   public Adapter createFeatureChangeAdapter()
175   {
176     return null;
177   }
178
179   /**
180    * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.change.ListChange <em>List Change</em>}'.
181    * <!-- begin-user-doc -->
182    * This default implementation returns null so that we can easily ignore cases;
183    * it's useful to ignore a case when inheritance will catch all the cases anyway.
184    * <!-- end-user-doc -->
185    * @return the new adapter.
186    * @see org.eclipse.emf.ecore.change.ListChange
187    * @generated
188    */

189   public Adapter createListChangeAdapter()
190   {
191     return null;
192   }
193
194   /**
195    * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.change.ResourceChange <em>Resource Change</em>}'.
196    * <!-- begin-user-doc -->
197    * This default implementation returns null so that we can easily ignore cases;
198    * it's useful to ignore a case when inheritance will catch all the cases anyway.
199    * <!-- end-user-doc -->
200    * @return the new adapter.
201    * @see org.eclipse.emf.ecore.change.ResourceChange
202    * @generated
203    */

204   public Adapter createResourceChangeAdapter()
205   {
206     return null;
207   }
208
209   /**
210    * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.change.FeatureMapEntry <em>Feature Map Entry</em>}'.
211    * <!-- begin-user-doc -->
212    * This default implementation returns null so that we can easily ignore cases;
213    * it's useful to ignore a case when inheritance will catch all the cases anyway.
214    * <!-- end-user-doc -->
215    * @return the new adapter.
216    * @see org.eclipse.emf.ecore.change.FeatureMapEntry
217    * @generated
218    */

219   public Adapter createFeatureMapEntryAdapter()
220   {
221     return null;
222   }
223
224   /**
225    * Creates a new adapter for the default case.
226    * <!-- begin-user-doc -->
227    * This default implementation returns null.
228    * <!-- end-user-doc -->
229    * @return the new adapter.
230    * @generated
231    */

232   public Adapter createEObjectAdapter()
233   {
234     return null;
235   }
236
237 } //ChangeAdapterFactory
238
Popular Tags