|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.NotifierImpl
org.eclipse.emf.ecore.resource.impl.ResourceImpl
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl
This class implements the XMLResource interface. It overloads the doLoad method to invoke the XML deserializer rather than using the default XMI loader.
Nested Class Summary |
Nested classes inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
ResourceImpl.ContentsEList, ResourceImpl.ModificationTrackingAdapter |
Nested classes inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl |
BasicNotifierImpl.EAdapterList |
Nested classes inherited from class org.eclipse.emf.ecore.xmi.XMLResource |
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 | |
protected static Map |
DETACHED_EOBJECT_TO_ID_MAP
The map from EObject to ID . |
protected String |
encoding
|
protected Map |
eObjectToExtensionMap
|
protected Map |
eObjectToIDMap
The map from EObject to ID .
|
protected Map |
idToEObjectMap
The map from ID to EObject .
|
protected String |
publicId
|
protected String |
systemId
|
protected boolean |
useZip
|
Fields inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
contents, defaultLoadOptions, defaultSaveOptions, errors, isLoaded, isModified, modificationTrackingAdapter, resourceSet, uri, warnings |
Fields inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl |
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG |
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 |
Constructor Summary | |
XMLResourceImpl()
Constructor for XMLResourceImpl. |
|
XMLResourceImpl(URI uri)
Constructor for XMLResourceImpl. |
Method Summary | |
void |
attached(EObject eObject)
Called when the object is attached to this resource, i.e., when it's eResource changes to be this one.
|
protected void |
attachedHelper(EObject eObject)
|
protected XMLHelper |
createXMLHelper()
|
protected XMLLoad |
createXMLLoad()
|
protected XMLSave |
createXMLSave()
|
void |
detached(EObject eObject)
Called when the object is detached from this resource, i.e., when it's eResource changes to no longer be this one.
|
protected void |
detachedHelper(EObject eObject)
|
void |
doLoad(InputStream inputStream,
Map options)
Called to load the resource. |
void |
doSave(OutputStream outputStream,
Map options)
Called to save the resource. |
protected void |
doUnload()
Does all the work of unloading the resource. |
Map |
getDefaultLoadOptions()
Returns the map of options that, in addition to the overriding options specified during load, are used to to control load behavior. |
Map |
getDefaultSaveOptions()
Returns the map of options that, in addition to the overriding options specified during save, are used to to control save behavior. |
String |
getEncoding()
Get the XML encoding for this resource. |
protected EObject |
getEObjectByID(String id)
Returns the object based on the fragment as an ID. |
Map |
getEObjectToExtensionMap()
Returns the map with EObject as keys and corresponding AnyType s as the values.
|
Map |
getEObjectToIDMap()
Returns the Map of EObjects as keys and IDs as values. |
String |
getID(EObject eObject)
Returns the ID if there is one for the given object; if there is no ID, it returns null. |
Map |
getIDToEObjectMap()
Returns the Map with IDs as keys and EObjects as values. |
String |
getPublicId()
Returns public identifier specified on the doctype. |
String |
getSystemId()
Returns system identifier specified on the doctype. |
String |
getURIFragment(EObject eObject)
Returns the URI fragment that,
when passed to getEObject will return the given object.
|
protected void |
init()
|
protected boolean |
isPath(String uriFragment)
|
void |
setDoctypeInfo(String publicId,
String systemId)
Sets the values of system and public identifiers on this resource. |
void |
setEncoding(String encoding)
Set the XML encoding for this resource. |
void |
setID(EObject eObject,
String id)
Sets the ID of the object. |
void |
setUseZip(boolean useZip)
Set whether the contents will be zipped. |
String |
toKeyString()
Returns a string representation of the ID map. |
protected boolean |
useIDAttributes()
|
protected boolean |
useIDs()
|
protected boolean |
useUUIDs()
|
boolean |
useZip()
Returns whether the contents will be zipped. |
Methods inherited from class org.eclipse.emf.ecore.resource.impl.ResourceImpl |
addModificationTrackingAdapters, basicSetResourceSet, createModificationTrackingAdapter, getAllContents, getContents, getDefaultURIConverter, getEObject, getEObject, getEObjectForURIFragmentRootSegment, getErrors, getResourceSet, getURI, getURIConverter, getURIFragmentRootSegment, getWarnings, isContentZipEntry, isLoaded, isModified, isTrackingModification, load, load, newContentZipEntry, removeModificationTrackingAdapters, save, save, setLoaded, setModified, setTrackingModification, setURI, toString, unload, unloaded |
Methods inherited from class org.eclipse.emf.common.notify.impl.NotifierImpl |
eAdapters, eBasicAdapters, eDeliver, eSetDeliver |
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl |
eNotificationRequired, eNotify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.ecore.resource.Resource |
getAllContents, getContents, getEObject, getErrors, getResourceSet, getURI, 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 |
protected Map idToEObjectMap
ID
to EObject
.
It is used to store IDs during a load or if the user
sets the ID of an object.
protected Map eObjectToIDMap
EObject
to ID
.
It is used to store IDs during a load or if the user
sets the ID of an object.
protected Map eObjectToExtensionMap
protected String encoding
protected boolean useZip
protected String publicId
protected String systemId
protected static final Map DETACHED_EOBJECT_TO_ID_MAP
EObject
to ID
. It is used to store
IDs for objects that have been detached.
Constructor Detail |
public XMLResourceImpl()
public XMLResourceImpl(URI uri)
uri
- Method Detail |
protected void init()
protected boolean useIDs()
protected boolean useIDAttributes()
protected boolean useUUIDs()
public Map getDefaultSaveOptions()
XMLResource
getDefaultSaveOptions
in interface XMLResource
public Map getDefaultLoadOptions()
XMLResource
getDefaultLoadOptions
in interface XMLResource
protected XMLHelper createXMLHelper()
protected XMLLoad createXMLLoad()
protected XMLSave createXMLSave()
public void doLoad(InputStream inputStream, Map options) throws IOException
ResourceImpl
doLoad
in class ResourceImpl
inputStream
- the streamoptions
- the load options.
IOException
public void doSave(OutputStream outputStream, Map options) throws IOException
ResourceImpl
doSave
in class ResourceImpl
outputStream
- the streamoptions
- the save options.
IOException
public boolean useZip()
XMLResource
useZip
in interface XMLResource
useZip
in class ResourceImpl
ResourceImpl.newContentZipEntry()
,
ResourceImpl.isContentZipEntry(ZipEntry)
public void setUseZip(boolean useZip)
XMLResource
setUseZip
in interface XMLResource
public String getPublicId()
XMLResource
getPublicId
in interface XMLResource
public String getSystemId()
XMLResource
getSystemId
in interface XMLResource
public void setDoctypeInfo(String publicId, String systemId)
XMLResource
setDoctypeInfo
in interface XMLResource
publicId
- systemId
- public String getEncoding()
XMLResource
getEncoding
in interface XMLResource
public void setEncoding(String encoding)
XMLResource
setEncoding
in interface XMLResource
public Map getIDToEObjectMap()
XMLResource
getIDToEObjectMap
in interface XMLResource
public Map getEObjectToIDMap()
XMLResource
getEObjectToIDMap
in interface XMLResource
public Map getEObjectToExtensionMap()
XMLResource
EObject
as keys and corresponding AnyType
s as the values.
It's used to record unrecognized elements and attributes.
getEObjectToExtensionMap
in interface XMLResource
public String getID(EObject eObject)
XMLResource
getID
in interface XMLResource
public void setID(EObject eObject, String id)
eObjectToIDMap
.
Clients may override it to set the ID as an actual attribute object the object.
setID
in interface XMLResource
eObject
- the object.id
- the object's ID.public String getURIFragment(EObject eObject)
Resource
fragment
that,
when passed to getEObject
will return the given object.
In other words,
the following is true
for any object contained by a resource:
Resource resource = eObject.eResource(); eObject == resource.getEObject(resource.getURIFragment(eObject))An implementation may choose to use IDs or to use structured URI fragments, as supported by
eURIFragmentSegment
.
getURIFragment
in interface Resource
getURIFragment
in class ResourceImpl
protected EObject getEObjectByID(String id)
ResourceImpl
getEObjectByID
in class ResourceImpl
protected boolean isPath(String uriFragment)
public void attached(EObject eObject)
Resource.Internal
eResource
changes to be this one.
An implementation that resolves
based on IDs
will need to walk the tree
of this object
in order to tabulate an index.
An implementation that needs to track modification
will also need to walk the tree
in order to add the necessary adapter.
In either of these cases,
editing of containment relations will be significantly more expensive.
attached
in interface Resource.Internal
attached
in class ResourceImpl
protected void attachedHelper(EObject eObject)
public void detached(EObject eObject)
Resource.Internal
eResource
changes to no longer be this one.
An implementation that resolves
based on IDs
will need to walk the tree
of this object
in order clean up it's index.
An implementation that needs to track modification
will also need to walk the tree
in order to remove the added adapter.
In either of these cases,
editing of containment relations will be significantly more expensive.
detached
in interface Resource.Internal
detached
in class ResourceImpl
protected void detachedHelper(EObject eObject)
protected void doUnload()
idToEObjectMap
and eObjectToIDMap
as necessary.
doUnload
in class ResourceImpl
public String toKeyString()
ID
map.
toKeyString
in class ResourceImpl
|
Copyright 2001-2004 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |