org.eclipse.emf.ecore.xmi
Interface XMIResource
- All Superinterfaces:
- Notifier, Resource, XMLResource
- All Known Subinterfaces:
- Ecore2XMLResource
- All Known Implementing Classes:
- Ecore2EcoreResourceImpl, 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 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
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_ELEMENT_HANDLER, OPTION_ENCODING, OPTION_ESCAPE_USING_CDATA, OPTION_EXTENDED_META_DATA, OPTION_FLUSH_THRESHOLD, OPTION_FORMATTED, OPTION_KEEP_DEFAULT_CONTENT, OPTION_LAX_FEATURE_PROCESSING, OPTION_LAX_WILDCARD_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_ENTITY_HANDLER, OPTION_RESOURCE_HANDLER, OPTION_ROOT_OBJECTS, OPTION_SAVE_DOCTYPE, OPTION_SAVE_TYPE_INFORMATION, OPTION_SCHEMA_LOCATION, OPTION_SCHEMA_LOCATION_IMPLEMENTATION, OPTION_SKIP_ESCAPE, OPTION_SKIP_ESCAPE_URI, OPTION_SUPPRESS_DOCUMENT_ROOT, OPTION_URI_HANDLER, 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_SAVE_ONLY_IF_CHANGED, OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER, OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER, OPTION_ZIP, RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__TIME_STAMP, RESOURCE__URI, RESOURCE__WARNINGS |
Method Summary |
java.lang.String |
getXMINamespace()
|
java.lang.String |
getXMIVersion()
|
void |
setXMINamespace(java.lang.String namespace)
Sets XMI namespace and automatically assigns corresponding version |
void |
setXMIVersion(java.lang.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 |
delete, getAllContents, getContents, getEObject, getErrors, getResourceSet, getTimeStamp, getURI, getURIFragment, getWarnings, isLoaded, isModified, isTrackingModification, load, load, save, save, setModified, setTimeStamp, setTrackingModification, setURI, unload |
OPTION_USE_XMI_TYPE
static final java.lang.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
static final java.lang.String VERSION_NAME
- See Also:
- Constant Field Values
VERSION_VALUE
static final java.lang.String VERSION_VALUE
- See Also:
- Constant Field Values
XMI_NAMESPACE_PREFIX
static final java.lang.String XMI_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
XMI_NS
static final java.lang.String XMI_NS
- See Also:
- Constant Field Values
XMI_ID
static final java.lang.String XMI_ID
- See Also:
- Constant Field Values
XMI_TAG_NAME
static final java.lang.String XMI_TAG_NAME
- See Also:
- Constant Field Values
XMI_URI
static final java.lang.String XMI_URI
- See Also:
- Constant Field Values
getXMIVersion
java.lang.String getXMIVersion()
- Returns:
- XMI version
setXMIVersion
void setXMIVersion(java.lang.String version)
- Sets XMI version and automatically assigns corresponding namespace
- Parameters:
version
-
getXMINamespace
java.lang.String getXMINamespace()
- Returns:
- XMI namespace
setXMINamespace
void setXMINamespace(java.lang.String namespace)
- Sets XMI namespace and automatically assigns corresponding version
- Parameters:
namespace
-