KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > editor > Doml > impl > DomlFactoryImpl


1 /**
2  * <copyright>
3  * </copyright>
4  *
5  * $Id$
6  */

7 package org.enhydra.dods.editor.Doml.impl;
8
9 import org.eclipse.emf.ecore.EClass;
10 import org.eclipse.emf.ecore.EDataType;
11 import org.eclipse.emf.ecore.EObject;
12
13 import org.eclipse.emf.ecore.impl.EFactoryImpl;
14
15 import org.enhydra.dods.editor.Doml.*;
16
17 /**
18  * <!-- begin-user-doc -->
19  * An implementation of the model <b>Factory</b>.
20  * <!-- end-user-doc -->
21  * @generated
22  */

23 public class DomlFactoryImpl extends EFactoryImpl implements DomlFactory {
24     /**
25      * Creates and instance of the factory.
26      * <!-- begin-user-doc -->
27      * <!-- end-user-doc -->
28      * @generated
29      */

30     public DomlFactoryImpl() {
31         super();
32     }
33
34     /**
35      * <!-- begin-user-doc -->
36      * <!-- end-user-doc -->
37      * @generated
38      */

39     public EObject create(EClass eClass) {
40         switch (eClass.getClassifierID()) {
41             case DomlPackage.COLUMN_TYPE: return createColumnType();
42             case DomlPackage.DATABASE_TYPE: return createDatabaseType();
43             case DomlPackage.DOCUMENT_ROOT: return createDocumentRoot();
44             case DomlPackage.DOML_TYPE: return createDomlType();
45             case DomlPackage.INDEX_COLUMN_TYPE: return createIndexColumnType();
46             case DomlPackage.INDEX_TYPE: return createIndexType();
47             case DomlPackage.PACKAGE_TYPE: return createPackageType();
48             case DomlPackage.REFERENCE_OBJECT_TYPE: return createReferenceObjectType();
49             case DomlPackage.TABLE_TYPE: return createTableType();
50             case DomlPackage.TYPE_TYPE: return createTypeType();
51             default:
52                 throw new IllegalArgumentException JavaDoc("The class '" + eClass.getName() + "' is not a valid classifier");
53         }
54     }
55
56     /**
57      * <!-- begin-user-doc -->
58      * <!-- end-user-doc -->
59      * @generated
60      */

61     public Object JavaDoc createFromString(EDataType eDataType, String JavaDoc initialValue) {
62         switch (eDataType.getClassifierID()) {
63             case DomlPackage.DB_VENDOR: {
64                 DbVendor result = DbVendor.get(initialValue);
65                 if (result == null) throw new IllegalArgumentException JavaDoc("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
66                 return result;
67             }
68             case DomlPackage.DIRTY_DO: {
69                 DirtyDO result = DirtyDO.get(initialValue);
70                 if (result == null) throw new IllegalArgumentException JavaDoc("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
71                 return result;
72             }
73             case DomlPackage.JDBC_TYPE: {
74                 JdbcType result = JdbcType.get(initialValue);
75                 if (result == null) throw new IllegalArgumentException JavaDoc("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
76                 return result;
77             }
78             case DomlPackage.TRUE_FALSE: {
79                 TrueFalse result = TrueFalse.get(initialValue);
80                 if (result == null) throw new IllegalArgumentException JavaDoc("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
81                 return result;
82             }
83             case DomlPackage.DB_VENDOR_OBJECT:
84                 return createDbVendorObjectFromString(eDataType, initialValue);
85             case DomlPackage.DIRTY_DO_OBJECT:
86                 return createDirtyDOObjectFromString(eDataType, initialValue);
87             case DomlPackage.JDBC_TYPE_OBJECT:
88                 return createJdbcTypeObjectFromString(eDataType, initialValue);
89             case DomlPackage.TRUE_FALSE_OBJECT:
90                 return createTrueFalseObjectFromString(eDataType, initialValue);
91             default:
92                 throw new IllegalArgumentException JavaDoc("The datatype '" + eDataType.getName() + "' is not a valid classifier");
93         }
94     }
95
96     /**
97      * <!-- begin-user-doc -->
98      * <!-- end-user-doc -->
99      * @generated
100      */

101     public String JavaDoc convertToString(EDataType eDataType, Object JavaDoc instanceValue) {
102         switch (eDataType.getClassifierID()) {
103             case DomlPackage.DB_VENDOR:
104                 return instanceValue == null ? null : instanceValue.toString();
105             case DomlPackage.DIRTY_DO:
106                 return instanceValue == null ? null : instanceValue.toString();
107             case DomlPackage.JDBC_TYPE:
108                 return instanceValue == null ? null : instanceValue.toString();
109             case DomlPackage.TRUE_FALSE:
110                 return instanceValue == null ? null : instanceValue.toString();
111             case DomlPackage.DB_VENDOR_OBJECT:
112                 return convertDbVendorObjectToString(eDataType, instanceValue);
113             case DomlPackage.DIRTY_DO_OBJECT:
114                 return convertDirtyDOObjectToString(eDataType, instanceValue);
115             case DomlPackage.JDBC_TYPE_OBJECT:
116                 return convertJdbcTypeObjectToString(eDataType, instanceValue);
117             case DomlPackage.TRUE_FALSE_OBJECT:
118                 return convertTrueFalseObjectToString(eDataType, instanceValue);
119             default:
120                 throw new IllegalArgumentException JavaDoc("The datatype '" + eDataType.getName() + "' is not a valid classifier");
121         }
122     }
123
124     /**
125      * <!-- begin-user-doc -->
126      * <!-- end-user-doc -->
127      * @generated
128      */

129     public ColumnType createColumnType() {
130         ColumnTypeImpl columnType = new ColumnTypeImpl();
131         return columnType;
132     }
133
134     /**
135      * <!-- begin-user-doc -->
136      * <!-- end-user-doc -->
137      * @generated
138      */

139     public DatabaseType createDatabaseType() {
140         DatabaseTypeImpl databaseType = new DatabaseTypeImpl();
141         return databaseType;
142     }
143
144     /**
145      * <!-- begin-user-doc -->
146      * <!-- end-user-doc -->
147      * @generated
148      */

149     public DocumentRoot createDocumentRoot() {
150         DocumentRootImpl documentRoot = new DocumentRootImpl();
151         return documentRoot;
152     }
153
154     /**
155      * <!-- begin-user-doc -->
156      * <!-- end-user-doc -->
157      * @generated
158      */

159     public DomlType createDomlType() {
160         DomlTypeImpl domlType = new DomlTypeImpl();
161         return domlType;
162     }
163
164     /**
165      * <!-- begin-user-doc -->
166      * <!-- end-user-doc -->
167      * @generated
168      */

169     public IndexColumnType createIndexColumnType() {
170         IndexColumnTypeImpl indexColumnType = new IndexColumnTypeImpl();
171         return indexColumnType;
172     }
173
174     /**
175      * <!-- begin-user-doc -->
176      * <!-- end-user-doc -->
177      * @generated
178      */

179     public IndexType createIndexType() {
180         IndexTypeImpl indexType = new IndexTypeImpl();
181         return indexType;
182     }
183
184     /**
185      * <!-- begin-user-doc -->
186      * <!-- end-user-doc -->
187      * @generated
188      */

189     public PackageType createPackageType() {
190         PackageTypeImpl packageType = new PackageTypeImpl();
191         return packageType;
192     }
193
194     /**
195      * <!-- begin-user-doc -->
196      * <!-- end-user-doc -->
197      * @generated
198      */

199     public ReferenceObjectType createReferenceObjectType() {
200         ReferenceObjectTypeImpl referenceObjectType = new ReferenceObjectTypeImpl();
201         return referenceObjectType;
202     }
203
204     /**
205      * <!-- begin-user-doc -->
206      * <!-- end-user-doc -->
207      * @generated
208      */

209     public TableType createTableType() {
210         TableTypeImpl tableType = new TableTypeImpl();
211         return tableType;
212     }
213
214     /**
215      * <!-- begin-user-doc -->
216      * <!-- end-user-doc -->
217      * @generated
218      */

219     public TypeType createTypeType() {
220         TypeTypeImpl typeType = new TypeTypeImpl();
221         return typeType;
222     }
223
224     /**
225      * <!-- begin-user-doc -->
226      * <!-- end-user-doc -->
227      * @generated
228      */

229     public DbVendor createDbVendorObjectFromString(EDataType eDataType, String JavaDoc initialValue) {
230         return (DbVendor)DomlFactory.eINSTANCE.createFromString(DomlPackage.eINSTANCE.getDbVendor(), initialValue);
231     }
232
233     /**
234      * <!-- begin-user-doc -->
235      * <!-- end-user-doc -->
236      * @generated
237      */

238     public String JavaDoc convertDbVendorObjectToString(EDataType eDataType, Object JavaDoc instanceValue) {
239         return DomlFactory.eINSTANCE.convertToString(DomlPackage.eINSTANCE.getDbVendor(), instanceValue);
240     }
241
242     /**
243      * <!-- begin-user-doc -->
244      * <!-- end-user-doc -->
245      * @generated
246      */

247     public DirtyDO createDirtyDOObjectFromString(EDataType eDataType, String JavaDoc initialValue) {
248         return (DirtyDO)DomlFactory.eINSTANCE.createFromString(DomlPackage.eINSTANCE.getDirtyDO(), initialValue);
249     }
250
251     /**
252      * <!-- begin-user-doc -->
253      * <!-- end-user-doc -->
254      * @generated
255      */

256     public String JavaDoc convertDirtyDOObjectToString(EDataType eDataType, Object JavaDoc instanceValue) {
257         return DomlFactory.eINSTANCE.convertToString(DomlPackage.eINSTANCE.getDirtyDO(), instanceValue);
258     }
259
260     /**
261      * <!-- begin-user-doc -->
262      * <!-- end-user-doc -->
263      * @generated
264      */

265     public JdbcType createJdbcTypeObjectFromString(EDataType eDataType, String JavaDoc initialValue) {
266         return (JdbcType)DomlFactory.eINSTANCE.createFromString(DomlPackage.eINSTANCE.getJdbcType(), initialValue);
267     }
268
269     /**
270      * <!-- begin-user-doc -->
271      * <!-- end-user-doc -->
272      * @generated
273      */

274     public String JavaDoc convertJdbcTypeObjectToString(EDataType eDataType, Object JavaDoc instanceValue) {
275         return DomlFactory.eINSTANCE.convertToString(DomlPackage.eINSTANCE.getJdbcType(), instanceValue);
276     }
277
278     /**
279      * <!-- begin-user-doc -->
280      * <!-- end-user-doc -->
281      * @generated
282      */

283     public TrueFalse createTrueFalseObjectFromString(EDataType eDataType, String JavaDoc initialValue) {
284         return (TrueFalse)DomlFactory.eINSTANCE.createFromString(DomlPackage.eINSTANCE.getTrueFalse(), initialValue);
285     }
286
287     /**
288      * <!-- begin-user-doc -->
289      * <!-- end-user-doc -->
290      * @generated
291      */

292     public String JavaDoc convertTrueFalseObjectToString(EDataType eDataType, Object JavaDoc instanceValue) {
293         return DomlFactory.eINSTANCE.convertToString(DomlPackage.eINSTANCE.getTrueFalse(), instanceValue);
294     }
295
296     /**
297      * <!-- begin-user-doc -->
298      * <!-- end-user-doc -->
299      * @generated
300      */

301     public DomlPackage getDomlPackage() {
302         return (DomlPackage)getEPackage();
303     }
304
305     /**
306      * <!-- begin-user-doc -->
307      * <!-- end-user-doc -->
308      * @deprecated
309      * @generated
310      */

311     public static DomlPackage getPackage() {
312         return DomlPackage.eINSTANCE;
313     }
314
315 } //DomlFactoryImpl
316
Popular Tags