|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A resource represents serialized MOF objects. You save objects by adding them to an extent, creating a resource, setting its extent and URI, and then calling a save method. A URIConverter is used to change the URI to an output stream. Alternatively, you can invoke a save method and specify the output stream to write to.
You restore objects from a resource by calling the load method in the ResourceFactory, or by calling the load method on a Resources object. You access the restored objects by getting the extent for the resource and iterating over it.
A resource may be added to a resources object to enable cross-resource references to be handled.
| Field Summary | |
static java.lang.String |
copyright
|
| Fields inherited from interface com.ibm.etools.emf.notify.Notifier |
ADD, ADD_MANY, CREATE, MOVE, NO_INDEX, REMOVE, REMOVE_MANY, REMOVING_ADAPTER, SET, TOUCH, UNSET |
| Method Summary | |
java.lang.Object |
getDefaultSaveOptions()
This method returns a java.lang.Object containing the default save options for saving resources. |
Extent |
getExtent()
|
com.ibm.etools.emf.ref.RefObject |
getObject(com.ibm.etools.emf.resource.URI uri)
Return the object that matches the given uri using the IDKey. |
ResourceSet |
getResourceSet()
|
com.ibm.etools.emf.resource.URI |
getURI()
Return the URI object. |
boolean |
isExtentModified()
This method indicates whether or not the extent associated with the resource has been modified since the last time it was loaded or saved. |
boolean |
isUnloaded()
After removing a Resource Set, the resource becomes unloaded and all the objects are turned into proxies. |
java.lang.String |
makeHref(com.ibm.etools.emf.resource.RefBaseObject object)
|
void |
refSetID()
Set the ID for all objects in the resource |
void |
save()
Save this resource; the default save options are used, and an OutputStream is opened from the URI of the resource. |
void |
save(java.lang.Object options)
Save this resource with the given save options. |
void |
save(java.io.OutputStream os)
Saves this resource using the given OutputStream; the default save options are used. |
void |
save(java.io.OutputStream os,
java.lang.Object options)
Saves this resource using the given OutputStream with the given save options. |
void |
setExtent(Extent e)
|
void |
setExtentModified(boolean flag)
This method is used to set the modified flag on the extent. |
void |
setResourceSet(ResourceSet r)
|
void |
setURI(java.lang.String uri)
|
void |
setURI(com.ibm.etools.emf.resource.URI uri)
|
void |
unload()
|
| Methods inherited from interface com.ibm.etools.emf.notify.Notifier |
addAdapter, getAdapter, getAdapters, getExistingAdapter, isDelivery, isDeliveryAll, notify, notify, removeAdapter, removeAllAdapters, setDelivery, setDeliveryAll |
| Field Detail |
public static final java.lang.String copyright
| Method Detail |
public Extent getExtent()
public void setExtent(Extent e)
public java.lang.String makeHref(com.ibm.etools.emf.resource.RefBaseObject object)
public com.ibm.etools.emf.resource.URI getURI()
public void setURI(com.ibm.etools.emf.resource.URI uri)
public void setURI(java.lang.String uri)
public ResourceSet getResourceSet()
public void setResourceSet(ResourceSet r)
public void save()
throws java.lang.Exception
The default implementation of this method is to call getDefaultSaveOptions() and invoke the save(Object options) method.
If there is an error when saving the resource, an exception is thrown.
public void save(java.lang.Object options)
throws java.lang.Exception
The default implementation of this method is to open an OutputStream from the URI of this resource, then invoke the save(OutputStream os, Object options) method.
If there is an error when saving the resource, an exception is thrown.
public void save(java.io.OutputStream os)
throws java.lang.Exception
The default implementation of this method is to call getDefaultSaveOptions(), then invoke the save(OutputStream os, Object options) method.
public void save(java.io.OutputStream os,
java.lang.Object options)
throws java.lang.Exception
If the given OutputStream is a ZipOutputStream, this method makes a ZipEntry in the OutputStream whose name is the URI.getFile(), then closes the new ZipEntry. The given OutputStream is not closed, so you can use it to save other resources in it.
If the given OutputStream is not a ZipOutputStream, the objects in the resource's extent are saved to the OutputStream and the OutputStream is not closed, so you can manage it.
public java.lang.Object getDefaultSaveOptions()
public boolean isExtentModified()
public void setExtentModified(boolean flag)
flag - booleanpublic com.ibm.etools.emf.ref.RefObject getObject(com.ibm.etools.emf.resource.URI uri)
public boolean isUnloaded()
public void unload()
public void refSetID()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||