KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > editor > Doml > util > DomlResourceFactoryImpl


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

7 package org.enhydra.dods.editor.Doml.util;
8
9 import org.eclipse.emf.common.util.URI;
10
11 import org.eclipse.emf.ecore.EPackage;
12
13 import org.eclipse.emf.ecore.impl.EPackageRegistryImpl;
14
15 import org.eclipse.emf.ecore.resource.Resource;
16
17 import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
18 import org.eclipse.emf.ecore.util.ExtendedMetaData;
19
20 import org.eclipse.emf.ecore.xmi.XMLResource;
21
22 import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
23
24 import org.enhydra.dods.editor.Doml.DomlPackage;
25
26 /**
27  * <!-- begin-user-doc -->
28  * The <b>Resource Factory</b> associated with the package.
29  * <!-- end-user-doc -->
30  * @see org.enhydra.dods.editor.Doml.util.DomlResourceImpl
31  * @generated
32  */

33 public class DomlResourceFactoryImpl extends XMLResourceFactoryImpl {
34     /**
35      * <!-- begin-user-doc -->
36      * <!-- end-user-doc -->
37      * @generated
38      */

39     protected ExtendedMetaData extendedMetaData;
40
41     /**
42      * Creates an instance of the resource factory.
43      * <!-- begin-user-doc -->
44      * <!-- end-user-doc -->
45      * @generated
46      */

47     public DomlResourceFactoryImpl() {
48         super();
49         extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE));
50         extendedMetaData.putPackage(null, DomlPackage.eINSTANCE);
51     }
52
53     /**
54      * Creates an instance of the resource.
55      * <!-- begin-user-doc -->
56      * <!-- end-user-doc -->
57      * @generated
58      */

59     public Resource createResource(URI uri) {
60         XMLResource result = new DomlResourceImpl(uri);
61         result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
62         result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
63
64         result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
65         result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
66
67         result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
68         return result;
69     }
70
71 } //DomlResourceFactoryImpl
72
Popular Tags