@Beta public final class NotLoadingResourceSet extends ResourceSetImpl implements DisposableResourceSet, ProxyNotifierParserPool.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.EObservableAdapterList
adapterFactories, loadOptions, packageRegistry, resourceFactoryRegistry, resourceLocator, resources, uriConverter, uriResourceMap
eAdapters, EDELIVER, eFlags, ELAST_NOTIFIER_FLAG
RESOURCE_SET__RESOURCES
Modifier and Type | Method and Description |
---|---|
static NotLoadingResourceSet |
create(StorageTraversal traversals,
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.
|
createResource, delegatedGetResource, demandCreateResource, demandLoad, getAdapterFactories, getPackageRegistry, getResourceFactoryRegistry, getURIConverter, getURIResourceMap, setPackageRegistry, setResourceFactoryRegistry, setURIConverter, setURIResourceMap, toString
eAdapters, eBasicAdapters, eDeliver, eSetDeliver
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createResource, getAdapterFactories, getPackageRegistry, getResourceFactoryRegistry, getURIConverter, setPackageRegistry, setResourceFactoryRegistry, setURIConverter
eAdapters, eDeliver, eNotify, eSetDeliver
public static NotLoadingResourceSet create(StorageTraversal traversals, IProgressMonitor monitor, ResourceSetHookRegistry resourceSetHookRegistry)
traversals
- All traversals we are to load.monitor
- the monitor to which progress will be reported.resourceSetHookRegistry
- A registry of IResourceSetHook
s that potentialy can hook on the new
ResourceSet
(can be null
if none).protected void demandLoadHelper(Resource resource)
demandLoadHelper
in class ResourceSetImpl
ResourceSetImpl.demandLoadHelper(org.eclipse.emf.ecore.resource.Resource)
protected void handleDemandLoadException(Resource resource, IOException exception)
public Resource getResource(URI uri, boolean loadOnDemand)
getResource
in interface ResourceSet
getResource
in class ResourceSetImpl
ResourceSetImpl.getResource(org.eclipse.emf.common.util.URI,
boolean)
public Map<Object,Object> getLoadOptions()
getLoadOptions
in interface ResourceSet
getLoadOptions
in class ResourceSetImpl
public void dispose()
dispose
in interface DisposableResourceSet
DisposableResourceSet.dispose()
public Resource createResource(URI uri, String contentType)
createResource
in interface ResourceSet
createResource
in class ResourceSetImpl
ResourceSetImpl.createResource(org.eclipse.emf.common.util.URI,
java.lang.String)
public EObject getEObject(URI uri, boolean loadOnDemand)
getEObject
in interface ResourceSet
getEObject
in class ResourceSetImpl
ResourceSetImpl.getEObject(org.eclipse.emf.common.util.URI,
boolean)
public TreeIterator<Notifier> getAllContents()
getAllContents
in interface ResourceSet
getAllContents
in class ResourceSetImpl
ResourceSetImpl.getAllContents()
public EList<Resource> getResources()
getResources
in interface ResourceSet
getResources
in class ResourceSetImpl
ResourceSetImpl.getResources()
public void proxyCreated(Resource source, EObject eObject, EStructuralFeature eStructuralFeature, EObject proxy, int position)
proxyCreated
in interface ProxyNotifierParserPool.IProxyCreationListener
source
- 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.
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.