com.ibm.etools.emf.resource
Interface ResourceSet

All Superinterfaces:
Notifier

public interface ResourceSet
extends Notifier

A ResourceSet object is a collection of resources. Using this object enables cross-resource references to be resolved.


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
 boolean add(Resource resource)
          Add a resource; return true if added, false if the resource is already in the set.
 com.ibm.etools.emf.resource.Context getContext()
          Returns the Context object
 Extent getExtent(java.lang.String uri)
          Return an extent for the given uri.
 Extent getExtent(com.ibm.etools.emf.resource.URI uri)
          Return an extent for the given uri.
 java.util.Collection getExtents()
          Return the extents of the resources added to this object.
 com.ibm.etools.emf.ref.RefObject getObject(java.lang.String uri)
          Attempt to find an extent that matches the uri; if found, get all of the keys for the extent and attempt to get the object based on the value of the fragment (the part of the uri after the # or |).
 com.ibm.etools.emf.ref.RefObject getObject(com.ibm.etools.emf.resource.URI uri)
           
 com.ibm.etools.emf.ref.RefObject getObjectAndLoad(java.lang.String uri)
          Attempt to get the object by invoking getObject(uri).
 com.ibm.etools.emf.ref.RefObject getObjectAndLoad(com.ibm.etools.emf.resource.URI uri)
           
 com.ibm.etools.emf.resource.RefPackage getPackage(java.lang.String nsURI, Extent extent)
           
 ResourceSet getParent()
          Get the ResourceSet from the parent of the context.
 Resource getResource(java.lang.String uri)
          Return a Resource for the given uri.
 Resource getResource(com.ibm.etools.emf.resource.URI uri)
          Return a Resource for the given uri.
 Resource getResourceAndLoad(java.lang.String uri)
          Attempt to get the resource by invoking getResource(uri).
 Resource getResourceAndLoad(com.ibm.etools.emf.resource.URI uri)
           
 java.util.Collection getResources()
          Returns an unmodifiable collection of the Resource objects in Resources.
 boolean hasResource(Resource r)
          Returns true if the resource is contained in this set.
 Resource load(java.lang.String uri)
          Loads the Resource with the given URI using the default load options.
 Resource load(java.lang.String uri, java.io.InputStream is)
          Loads the Resource from the given InputStream and the given URI with the default load options.
 Resource load(java.lang.String uri, java.io.InputStream is, java.lang.Object options)
          Loads the Resource from the given InputStream, the given URI, and the given load options.
 Resource load(java.lang.String uri, java.lang.Object options)
          Loads the Resource with the given URI using the given load options.
 boolean move(Resource resource, ResourceSet destination)
          Move the resource to another resource set in the same context family.
 boolean remove(Resource resource)
          Remove resource from the resource set and unload it.
 void setContext(com.ibm.etools.emf.resource.Context context)
          Sets the Context object
 
Methods inherited from interface com.ibm.etools.emf.notify.Notifier
addAdapter, getAdapter, getAdapters, getExistingAdapter, isDelivery, isDeliveryAll, notify, notify, removeAdapter, removeAllAdapters, setDelivery, setDeliveryAll
 

Field Detail

copyright

public static final java.lang.String copyright
Method Detail

add

public boolean add(Resource resource)
Add a resource; return true if added, false if the resource is already in the set.

remove

public boolean remove(Resource resource)
Remove resource from the resource set and unload it.

move

public boolean move(Resource resource,
                    ResourceSet destination)
Move the resource to another resource set in the same context family. Returns false if the move cannot occur.

hasResource

public boolean hasResource(Resource r)
Returns true if the resource is contained in this set.

getObject

public com.ibm.etools.emf.ref.RefObject getObject(java.lang.String uri)
Attempt to find an extent that matches the uri; if found, get all of the keys for the extent and attempt to get the object based on the value of the fragment (the part of the uri after the # or |). If none found, return null. This will search up the context parent chain to find the object.

getObject

public com.ibm.etools.emf.ref.RefObject getObject(com.ibm.etools.emf.resource.URI uri)

getObjectAndLoad

public com.ibm.etools.emf.ref.RefObject getObjectAndLoad(java.lang.String uri)
Attempt to get the object by invoking getObject(uri). If that method returns null, then the resource will be loaded and getObject tried again.

getObjectAndLoad

public com.ibm.etools.emf.ref.RefObject getObjectAndLoad(com.ibm.etools.emf.resource.URI uri)

getResources

public java.util.Collection getResources()
Returns an unmodifiable collection of the Resource objects in Resources.

getExtent

public Extent getExtent(java.lang.String uri)
Return an extent for the given uri.

getExtent

public Extent getExtent(com.ibm.etools.emf.resource.URI uri)
Return an extent for the given uri.

getResource

public Resource getResource(java.lang.String uri)
Return a Resource for the given uri.

getResource

public Resource getResource(com.ibm.etools.emf.resource.URI uri)
Return a Resource for the given uri.

getResourceAndLoad

public Resource getResourceAndLoad(java.lang.String uri)
Attempt to get the resource by invoking getResource(uri). If that method returns null, then look up the context parent chain and keep trying. If the top is reached, then the resource will be loaded at this initial resourceset.

getResourceAndLoad

public Resource getResourceAndLoad(com.ibm.etools.emf.resource.URI uri)

getExtents

public java.util.Collection getExtents()
Return the extents of the resources added to this object.

load

public Resource load(java.lang.String uri)
              throws java.lang.Exception
Loads the Resource with the given URI using the default load options. If the resource is already in the set, it returns it.

load

public Resource load(java.lang.String uri,
                     java.lang.Object options)
              throws java.lang.Exception
Loads the Resource with the given URI using the given load options. If the resource is already in the set, it returns it.

load

public Resource load(java.lang.String uri,
                     java.io.InputStream is)
              throws java.lang.Exception
Loads the Resource from the given InputStream and the given URI with the default load options. If the resource is already in the set, it returns it.

load

public Resource load(java.lang.String uri,
                     java.io.InputStream is,
                     java.lang.Object options)
              throws java.lang.Exception
Loads the Resource from the given InputStream, the given URI, and the given load options. If the resource is already in the set, it returns it.

getContext

public com.ibm.etools.emf.resource.Context getContext()
Returns the Context object

setContext

public void setContext(com.ibm.etools.emf.resource.Context context)
Sets the Context object

getParent

public ResourceSet getParent()
Get the ResourceSet from the parent of the context. Creation date: (03/02/01 3:29:53 PM)

getPackage

public com.ibm.etools.emf.resource.RefPackage getPackage(java.lang.String nsURI,
                                                         Extent extent)