org.eclipse.emf.ecore.xmi
Interface XMIResource

All Superinterfaces:
Notifier, Resource, XMLResource
All Known Subinterfaces:
Ecore2XMLResource
All Known Implementing Classes:
Ecore2XMLResourceImpl, EMOFResourceImpl, XMIResourceImpl

public interface XMIResource
extends XMLResource

A resource that serializes to XMI. The serialization format is based on the XMI 2.0 specification from the OMG. The various save and load options in this interface enable you to tailor the XMI files that are produced.

You may specify that the contents of the resource will be zipped by using the setUseZip method.

You may specify the XML encoding to be used when saving the resource by using the setEncoding method.

An XMIResource is capable of handling XMI files that contain IDs as well as XMI files that use URI fragments rather than IDs. The IDs from an XMI file are stored in the XMIResource in the idToEObjectMap and the eObjectToIDMap.

When saving an XMIResource, the ID of an object is saved if an object has one. If a referenced object has an ID, it is used rather than a URI fragment. You may clear the Maps that contain IDs if you wish to use URI fragments rather than IDs.

An XMIResource does not create IDs for you automatically; you can set IDs for objects yourself. However, we recommend that you use URI fragments instead because their use reduces the size of XMI files and memory consumption as well.

See Also:
Resource, ResourceImpl, XMIResourceImpl

Nested Class Summary
 
Nested classes inherited from class org.eclipse.emf.ecore.xmi.XMLResource
XMLResource.ResourceHandler, XMLResource.XMLInfo, XMLResource.XMLMap
 
Nested classes inherited from class org.eclipse.emf.ecore.resource.Resource
Resource.Diagnostic, Resource.Factory, Resource.Internal, Resource.IOWrappedException
 
Field Summary
static String OPTION_USE_XMI_TYPE
          Write the type of an element as "xmi:type" instead of "xsi:type" which is useful for models with multiple inheritance that may conflict with XML schema types
static String VERSION_NAME
           
static String VERSION_VALUE
           
static String XMI_ID
           
static String XMI_NAMESPACE_PREFIX
           
static String XMI_NS
           
static String XMI_TAG_NAME
           
static String XMI_URI
           
 
Fields inherited from interface org.eclipse.emf.ecore.xmi.XMLResource
HREF, NIL, NO_NAMESPACE_SCHEMA_LOCATION, OPTION_ANY_SIMPLE_TYPE, OPTION_ANY_TYPE, OPTION_CONFIGURATION_CACHE, OPTION_DECLARE_XML, OPTION_DEFER_ATTACHMENT, OPTION_DEFER_IDREF_RESOLUTION, OPTION_DISABLE_NOTIFY, OPTION_DOM_USE_NAMESPACES_IN_SCOPE, OPTION_ENCODING, OPTION_EXTENDED_META_DATA, OPTION_FLUSH_THRESHOLD, OPTION_FORMATTED, OPTION_KEEP_DEFAULT_CONTENT, OPTION_LAX_FEATURE_PROCESSING, OPTION_LINE_WIDTH, OPTION_PARSER_FEATURES, OPTION_PARSER_PROPERTIES, OPTION_PROCESS_DANGLING_HREF, OPTION_PROCESS_DANGLING_HREF_DISCARD, OPTION_PROCESS_DANGLING_HREF_RECORD, OPTION_PROCESS_DANGLING_HREF_THROW, OPTION_RECORD_ANY_TYPE_NAMESPACE_DECLARATIONS, OPTION_RECORD_UNKNOWN_FEATURE, OPTION_RESOURCE_HANDLER, OPTION_SAVE_DOCTYPE, OPTION_SAVE_TYPE_INFORMATION, OPTION_SCHEMA_LOCATION, OPTION_SCHEMA_LOCATION_IMPLEMENTATION, OPTION_SKIP_ESCAPE, OPTION_SKIP_ESCAPE_URI, OPTION_USE_CACHED_LOOKUP_TABLE, OPTION_USE_DEPRECATED_METHODS, OPTION_USE_ENCODED_ATTRIBUTE_STYLE, OPTION_USE_FILE_BUFFER, OPTION_USE_LEXICAL_HANDLER, OPTION_USE_PARSER_POOL, OPTION_USE_XML_NAME_TO_FEATURE_MAP, OPTION_XML_MAP, OPTION_XML_OPTIONS, OPTION_XML_VERSION, SCHEMA_LOCATION, TYPE, XML_NS, XML_SCHEMA_URI, XSI_NS, XSI_URI
 
Fields inherited from interface org.eclipse.emf.ecore.resource.Resource
OPTION_CIPHER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__URI, RESOURCE__WARNINGS
 
Method Summary
 String getXMINamespace()
           
 String getXMIVersion()
           
 void setXMINamespace(String namespace)
          Sets XMI namespace and automatically assigns corresponding version
 void setXMIVersion(String version)
          Sets XMI version and automatically assigns corresponding namespace
 
Methods inherited from interface org.eclipse.emf.ecore.xmi.XMLResource
getDefaultLoadOptions, getDefaultSaveOptions, getDOMHelper, getEncoding, getEObjectToExtensionMap, getEObjectToIDMap, getID, getIDToEObjectMap, getPublicId, getSystemId, getXMLVersion, load, load, save, save, setDoctypeInfo, setEncoding, setID, setUseZip, setXMLVersion, useZip
 
Methods inherited from interface org.eclipse.emf.ecore.resource.Resource
getAllContents, getContents, getEObject, getErrors, getResourceSet, getURI, getURIFragment, getWarnings, isLoaded, isModified, isTrackingModification, load, load, save, save, setModified, setTrackingModification, setURI, unload
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 

Field Detail

OPTION_USE_XMI_TYPE

public static final String OPTION_USE_XMI_TYPE
Write the type of an element as "xmi:type" instead of "xsi:type" which is useful for models with multiple inheritance that may conflict with XML schema types

See Also:
Constant Field Values

VERSION_NAME

public static final String VERSION_NAME
See Also:
Constant Field Values

VERSION_VALUE

public static final String VERSION_VALUE
See Also:
Constant Field Values

XMI_NAMESPACE_PREFIX

public static final String XMI_NAMESPACE_PREFIX
See Also:
Constant Field Values

XMI_NS

public static final String XMI_NS
See Also:
Constant Field Values

XMI_ID

public static final String XMI_ID
See Also:
Constant Field Values

XMI_TAG_NAME

public static final String XMI_TAG_NAME
See Also:
Constant Field Values

XMI_URI

public static final String XMI_URI
See Also:
Constant Field Values
Method Detail

getXMIVersion

public String getXMIVersion()
Returns:
XMI version

setXMIVersion

public void setXMIVersion(String version)
Sets XMI version and automatically assigns corresponding namespace

Parameters:
version -

getXMINamespace

public String getXMINamespace()
Returns:
XMI namespace

setXMINamespace

public void setXMINamespace(String namespace)
Sets XMI namespace and automatically assigns corresponding version

Parameters:
namespace -

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.