KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > mapping > ecore2xml > util > Ecore2XMLAdapterFactory


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2005 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: Ecore2XMLAdapterFactory.java,v 1.2 2005/06/21 16:17:03 khussey Exp $
16  */

17 package org.eclipse.emf.mapping.ecore2xml.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
24 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
25
26 import org.eclipse.emf.ecore.EObject;
27 import org.eclipse.emf.mapping.ecore2xml.*;
28
29 /**
30  * <!-- begin-user-doc -->
31  * The <b>Adapter Factory</b> for the model.
32  * It provides an adapter <code>createXXX</code> method for each class of the model.
33  * <!-- end-user-doc -->
34  * @see org.eclipse.emf.mapping.ecore2xml.Ecore2XMLPackage
35  * @generated
36  */

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

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

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

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

89   protected Ecore2XMLSwitch modelSwitch =
90     new Ecore2XMLSwitch()
91     {
92       public Object JavaDoc caseXMLInfo(XMLInfo object)
93       {
94         return createXMLInfoAdapter();
95       }
96       public Object JavaDoc caseXMLMap(XMLMap object)
97       {
98         return createXMLMapAdapter();
99       }
100       public Object JavaDoc caseENamedElementToXMLInfoMapEntry(Map.Entry JavaDoc object)
101       {
102         return createENamedElementToXMLInfoMapEntryAdapter();
103       }
104       public Object JavaDoc defaultCase(EObject object)
105       {
106         return createEObjectAdapter();
107       }
108     };
109     
110   /**
111    * Creates an adapter for the <code>target</code>.
112    * <!-- begin-user-doc -->
113      * <!-- end-user-doc -->
114    * @param target the object to adapt.
115    * @return the adapter for the <code>target</code>.
116    * @generated
117    */

118     public Adapter createAdapter(Notifier target)
119   {
120     return (Adapter)modelSwitch.doSwitch((EObject)target);
121   }
122
123
124   /**
125    * Creates a new adapter for an object of class '{@link org.eclipse.emf.mapping.ecore2xml.XMLInfo <em>XML Info</em>}'.
126    * <!-- begin-user-doc -->
127      * This default implementation returns null so that we can easily ignore cases;
128      * it's useful to ignore a case when inheritance will catch all the cases anyway.
129      * <!-- end-user-doc -->
130    * @return the new adapter.
131    * @see org.eclipse.emf.mapping.ecore2xml.XMLInfo
132    * @generated
133    */

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

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

164     public Adapter createENamedElementToXMLInfoMapEntryAdapter()
165   {
166     return null;
167   }
168
169   /**
170    * Creates a new adapter for the default case.
171    * <!-- begin-user-doc -->
172      * This default implementation returns null.
173      * <!-- end-user-doc -->
174    * @return the new adapter.
175    * @generated
176    */

177     public Adapter createEObjectAdapter()
178   {
179     return null;
180   }
181
182 } //Ecore2XMLAdapterFactory
183
Popular Tags