KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > xmi > XMIResource


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

17 package org.eclipse.emf.ecore.xmi;
18
19 import org.eclipse.emf.ecore.util.ExtendedMetaData;
20
21
22
23 /**
24  * A resource that serializes to XMI. The serialization format is based
25  * on the XMI 2.0 specification from the OMG. The various save and load
26  * options in this interface enable you to tailor the XMI files that are
27  * produced.
28  * <p>
29  * You may specify that the contents of the resource will be zipped by
30  * using the {@link #setUseZip setUseZip} method.
31  * </p>
32  * <p>
33  * You may specify the XML encoding to be used when saving the resource
34  * by using the {@link XMLResource#setEncoding setEncoding} method.
35  * </p>
36  * <p>
37  * An XMIResource is capable of handling XMI files that contain IDs as
38  * well as XMI files that use URI fragments rather than IDs. The IDs from
39  * an XMI file are stored in the XMIResource in the {@link XMLResource#getIDToEObjectMap
40  * idToEObjectMap} and the {@link XMLResource#getEObjectToIDMap eObjectToIDMap}.
41  * </p>
42  * <p>
43  * When saving an XMIResource, the ID of an object is saved if an object has
44  * one. If a referenced object has an ID, it is used rather than a URI fragment.
45  * You may clear the Maps that contain IDs if you wish to use URI fragments
46  * rather than IDs.
47  * </p>
48  * <p>
49  * An XMIResource does not create IDs for you automatically; you can set IDs
50  * for objects yourself. However, we recommend that you use URI fragments
51  * instead because their use reduces the size of XMI files and memory
52  * consumption as well.
53  * </p>
54  * @see org.eclipse.emf.ecore.resource.Resource
55  * @see org.eclipse.emf.ecore.resource.impl.ResourceImpl
56  * @see org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl
57  */

58 public interface XMIResource extends XMLResource
59 {
60   /**
61    * Write the type of an element as "xmi:type" instead of "xsi:type"
62    * which is useful for models with multiple inheritance that may
63    * conflict with XML schema types
64    */

65   String JavaDoc OPTION_USE_XMI_TYPE = "USE_XMI_TYPE";
66
67   String JavaDoc VERSION_NAME = "version";
68   String JavaDoc VERSION_VALUE = "2.0";
69
70   String JavaDoc XMI_NS = "xmi";
71   String JavaDoc XMI_ID = "id";
72   String JavaDoc XMI_TAG_NAME = "XMI";
73   String JavaDoc XMI_URI = ExtendedMetaData.XMI_URI;
74 }
75
Popular Tags