@Beta public final class NotLoadingResourceSet extends ResourceSetImpl implements DisposableResourceSet, IProxyCreationListener
StorageTraversal, and only those
resources that are part of the traversal will be loaded. This will allow us to resolve the proxies between
these "traversed" resources.
This resource set will prevent loading any resources that is not part of the initial traversal. The only
exception to this rule is if one of the registered ILoadOnDemandPolicy says otherwise. Users should
not try to add more resources into this resource set using any of the createResource methods.
ResourceSetImpl.MappedResourceLocator, ResourceSetImpl.ResourceLocator, ResourceSetImpl.ResourcesEList<E extends Object & Resource>BasicNotifierImpl.EAdapterList<E extends Object & Adapter>, BasicNotifierImpl.EObservableAdapterListadapterFactories, loadOptions, packageRegistry, resourceFactoryRegistry, resourceLocator, resources, uriConverter, uriResourceMapeAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAGRESOURCE_SET__RESOURCES| Modifier and Type | Method and Description |
|---|---|
static NotLoadingResourceSet |
create(StorageTraversal traversals,
org.eclipse.core.runtime.IProgressMonitor monitor,
ResourceSetHookRegistry resourceSetHookRegistry)
Constructs a resource set to contain the resources described by the given traversals.
|
Resource |
createResource(URI uri,
String contentType) |
protected void |
demandLoadHelper(Resource resource) |
void |
dispose()
This method should be called when the resource set is no longer needed.
|
TreeIterator<Notifier> |
getAllContents() |
EObject |
getEObject(URI uri,
boolean loadOnDemand) |
Map<Object,Object> |
getLoadOptions() |
Resource |
getResource(URI uri,
boolean loadOnDemand) |
EList<Resource> |
getResources() |
protected void |
handleDemandLoadException(Resource resource,
IOException exception) |
void |
proxyCreated(Resource source,
EObject eObject,
EStructuralFeature eStructuralFeature,
EObject proxy,
int position)
This will be called when a proxy is created from one of the parser pool's parsers.
|
void |
setAllowResourceLoad(boolean allowResourceLoad)
Allow/disallow the resource set to load its resources when asked to.
|
createResource, delegatedGetResource, demandCreateResource, demandLoad, getAdapterFactories, getPackageRegistry, getResourceFactoryRegistry, getURIConverter, getURIResourceMap, setPackageRegistry, setResourceFactoryRegistry, setURIConverter, setURIResourceMap, toStringeAdapters, eBasicAdapters, eDeliver, eSetDelivereBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotifyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateResource, getAdapterFactories, getPackageRegistry, getResourceFactoryRegistry, getURIConverter, setPackageRegistry, setResourceFactoryRegistry, setURIConvertereAdapters, eDeliver, eNotify, eSetDeliverpublic static NotLoadingResourceSet create(StorageTraversal traversals, org.eclipse.core.runtime.IProgressMonitor monitor, ResourceSetHookRegistry resourceSetHookRegistry)
traversals - All traversals we are to load.monitor - the monitor to which progress will be reported.resourceSetHookRegistry - A registry of IResourceSetHooks that potentialy can hook on the new
ResourceSet (can be null if none).protected void demandLoadHelper(Resource resource)
demandLoadHelper in class ResourceSetImplResourceSetImpl.demandLoadHelper(org.eclipse.emf.ecore.resource.Resource)protected void handleDemandLoadException(Resource resource, IOException exception)
public Resource getResource(URI uri, boolean loadOnDemand)
getResource in interface ResourceSetgetResource in class ResourceSetImplResourceSetImpl.getResource(org.eclipse.emf.common.util.URI,
boolean)public Map<Object,Object> getLoadOptions()
getLoadOptions in interface ResourceSetgetLoadOptions in class ResourceSetImplpublic void dispose()
dispose in interface DisposableResourceSetDisposableResourceSet.dispose()public Resource createResource(URI uri, String contentType)
createResource in interface ResourceSetcreateResource in class ResourceSetImplResourceSetImpl.createResource(org.eclipse.emf.common.util.URI,
java.lang.String)public EObject getEObject(URI uri, boolean loadOnDemand)
getEObject in interface ResourceSetgetEObject in class ResourceSetImplResourceSetImpl.getEObject(org.eclipse.emf.common.util.URI,
boolean)public TreeIterator<Notifier> getAllContents()
getAllContents in interface ResourceSetgetAllContents in class ResourceSetImplResourceSetImpl.getAllContents()public EList<Resource> getResources()
getResources in interface ResourceSetgetResources in class ResourceSetImplResourceSetImpl.getResources()public void proxyCreated(Resource source, EObject eObject, EStructuralFeature eStructuralFeature, EObject proxy, int position)
proxyCreated in interface IProxyCreationListenersource - The resource in which a proxy has been created towards another.eObject - The EObject on which some feature is going to be set with a proxy value.eStructuralFeature - The structural feature which value will contain a proxy.proxy - The actual proxy created for this eObject's feature.position - Position at which the proxy is going to be inserted. This will be set to -1
when the proxy is added at the end of the eStructuralFeature's values list (for
multi-valued features) or if said feature is single-valued.public void setAllowResourceLoad(boolean allowResourceLoad)
getResource(URI, boolean).allowResourceLoad - true to allow the resource set to load its resources when asked to, false otherwise.
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.