org.eclipse.emf.ecore.xmi
Interface XMLResource

All Superinterfaces:
Notifier, Resource
All Known Subinterfaces:
XMIResource
All Known Implementing Classes:
XMLResourceImpl

public interface XMLResource
extends Resource

This interface represents an XML resource. You can use it to load and save XML files. This initial implementation of XML serialization and deserialization is incomplete but will be completed shortly.


Inner Class Summary
static interface XMLResource.XMLInfo
          This interface is used with the XMLMap interface to describe how to serialize objects and features.
static interface XMLResource.XMLMap
          This interface represents a mapping from Ecore constructs to the XML representation of those constructs.
 
Inner classes inherited from class org.eclipse.emf.ecore.resource.Resource
Resource.Diagnostic, Resource.Factory, Resource.Internal, Resource.IOWrappedException
 
Field Summary
static java.lang.String HREF
           
static java.lang.String NIL
           
static java.lang.String NO_NAMESPACE_SCHEMA_LOCATION
           
static java.lang.String OPTION_DECLARE_XML
          Begin a save with this line:
static java.lang.String OPTION_DISABLE_NOTIFY
          Disable notifications during load, and enable them at the end of a load.
static java.lang.String OPTION_ENCODING
          Specify the XML encoding to be used during save.
static java.lang.String OPTION_LINE_WIDTH
          Attribute formatting that exceeds the specified width will cause a line break so that formatting will continue indented on the next line.
static java.lang.String OPTION_PROCESS_DANGLING_HREF
          This can be one of "THROW", "DISCARD", "RECORD", where "THROW" is the default.
static java.lang.String OPTION_PROCESS_DANGLING_HREF_DISCARD
           
static java.lang.String OPTION_PROCESS_DANGLING_HREF_RECORD
           
static java.lang.String OPTION_PROCESS_DANGLING_HREF_THROW
           
static java.lang.String OPTION_SCHEMA_LOCATION
          Produce an xsi:schemaLocation/xsi:noNamespaceSchemaLocation in the saved result.
static java.lang.String OPTION_SKIP_ESCAPE
          Skip processing for values that contain characters special to XML Faster for large computer-generated files
static java.lang.String OPTION_USE_ENCODED_ATTRIBUTE_STYLE
          All EObject references will be uniformly encoded as one or more QName URI pairs, where the QName is optional depending on whether the referenced object's type is not identicle to that of the feature.
static java.lang.String OPTION_XML_MAP
          This save option allows you to tailor the XML serialization of objects.
static java.lang.String SCHEMA_LOCATION
           
static java.lang.String TYPE
           
static java.lang.String XML_NS
           
static java.lang.String XSI_NS
           
static java.lang.String XSI_URI
           
 
Fields inherited from interface org.eclipse.emf.ecore.resource.Resource
RESOURCE__CONTENTS, RESOURCE__ERRORS, RESOURCE__IS_LOADED, RESOURCE__IS_MODIFIED, RESOURCE__IS_TRACKING_MODIFICATION, RESOURCE__RESOURCE_SET, RESOURCE__URI, RESOURCE__WARNINGS
 
Method Summary
 java.util.Map getDefaultLoadOptions()
          Returns the map of options that, in addition to the overriding options specified during load, are used to to control load behavior.
 java.util.Map getDefaultSaveOptions()
          Returns the map of options that, in addition to the overriding options specified during save, are used to to control save behavior.
 java.lang.String getEncoding()
          Get the XML encoding for this resource.
 java.util.Map getEObjectToIDMap()
          Returns the Map of EObjects as keys and IDs as values.
 java.lang.String getID(EObject eObject)
          Returns the ID if there is one for the given object; if there is no ID, it returns null.
 java.util.Map getIDToEObjectMap()
          Returns the Map with IDs as keys and EObjects as values.
 void setEncoding(java.lang.String encoding)
          Set the XML encoding for this resource.
 void setID(EObject eObject, java.lang.String id)
          Sets the ID for the given object.
 void setUseZip(boolean useZip)
          Set whether the contents will be zipped.
 boolean useZip()
          Returns whether the contents will be zipped.
 
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_XML_MAP

public static final java.lang.String OPTION_XML_MAP
This save option allows you to tailor the XML serialization of objects. You should provide an XMLMap as the value of this option.

OPTION_USE_ENCODED_ATTRIBUTE_STYLE

public static final java.lang.String OPTION_USE_ENCODED_ATTRIBUTE_STYLE
All EObject references will be uniformly encoded as one or more QName URI pairs, where the QName is optional depending on whether the referenced object's type is not identicle to that of the feature.

OPTION_LINE_WIDTH

public static final java.lang.String OPTION_LINE_WIDTH
Attribute formatting that exceeds the specified width will cause a line break so that formatting will continue indented on the next line.

OPTION_DECLARE_XML

public static final java.lang.String OPTION_DECLARE_XML
Begin a save with this line:

OPTION_SKIP_ESCAPE

public static final java.lang.String OPTION_SKIP_ESCAPE
Skip processing for values that contain characters special to XML Faster for large computer-generated files

OPTION_PROCESS_DANGLING_HREF

public static final java.lang.String OPTION_PROCESS_DANGLING_HREF
This can be one of "THROW", "DISCARD", "RECORD", where "THROW" is the default.

OPTION_PROCESS_DANGLING_HREF_THROW

public static final java.lang.String OPTION_PROCESS_DANGLING_HREF_THROW

OPTION_PROCESS_DANGLING_HREF_DISCARD

public static final java.lang.String OPTION_PROCESS_DANGLING_HREF_DISCARD

OPTION_PROCESS_DANGLING_HREF_RECORD

public static final java.lang.String OPTION_PROCESS_DANGLING_HREF_RECORD

OPTION_DISABLE_NOTIFY

public static final java.lang.String OPTION_DISABLE_NOTIFY
Disable notifications during load, and enable them at the end of a load.

OPTION_SCHEMA_LOCATION

public static final java.lang.String OPTION_SCHEMA_LOCATION
Produce an xsi:schemaLocation/xsi:noNamespaceSchemaLocation in the saved result.

OPTION_ENCODING

public static final java.lang.String OPTION_ENCODING
Specify the XML encoding to be used during save.

HREF

public static final java.lang.String HREF

NIL

public static final java.lang.String NIL

TYPE

public static final java.lang.String TYPE

SCHEMA_LOCATION

public static final java.lang.String SCHEMA_LOCATION

NO_NAMESPACE_SCHEMA_LOCATION

public static final java.lang.String NO_NAMESPACE_SCHEMA_LOCATION

XML_NS

public static final java.lang.String XML_NS

XSI_NS

public static final java.lang.String XSI_NS

XSI_URI

public static final java.lang.String XSI_URI
Method Detail

useZip

public boolean useZip()
Returns whether the contents will be zipped.

setUseZip

public void setUseZip(boolean useZip)
Set whether the contents will be zipped.

getDefaultSaveOptions

public java.util.Map getDefaultSaveOptions()
Returns the map of options that, in addition to the overriding options specified during save, are used to to control save behavior.

getDefaultLoadOptions

public java.util.Map getDefaultLoadOptions()
Returns the map of options that, in addition to the overriding options specified during load, are used to to control load behavior.

getEncoding

public java.lang.String getEncoding()
Get the XML encoding for this resource. The default is ASCII.

setEncoding

public void setEncoding(java.lang.String encoding)
Set the XML encoding for this resource.

getIDToEObjectMap

public java.util.Map getIDToEObjectMap()
Returns the Map with IDs as keys and EObjects as values.

getEObjectToIDMap

public java.util.Map getEObjectToIDMap()
Returns the Map of EObjects as keys and IDs as values.

getID

public java.lang.String getID(EObject eObject)
Returns the ID if there is one for the given object; if there is no ID, it returns null.

setID

public void setID(EObject eObject,
                  java.lang.String id)
Sets the ID for the given object. If you are storing the ID with the object itself, you should override this method.

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