public class ScopingResourceSetImpl extends ExtendedResourceSetImpl implements ScopingResourceSet
ScopingResourceSet
interface.ExtendedResourceSetImpl.ExtendedResourcesEList<E extends java.lang.Object & org.eclipse.emf.ecore.resource.Resource>, ExtendedResourceSetImpl.ResourceFilter
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.MappedResourceLocator, org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.ResourceLocator, org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.ResourcesEList<E extends java.lang.Object & org.eclipse.emf.ecore.resource.Resource>
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends java.lang.Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList
contextAwareProxyURIHelper, proxyHelper
adapterFactories, loadOptions, packageRegistry, resourceFactoryRegistry, resourceLocator, resources, uriConverter, uriResourceMap
Constructor and Description |
---|
ScopingResourceSetImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected IResourceScope |
createOutsideWorkspaceScope()
Creates the
resource scope used to encompass all resources that are located outside of the
workspace. |
protected java.util.Map<IResourceScope,java.util.Set<IMetaModelDescriptor>> |
getContextResourceScopes(java.lang.Object contextObject)
Retrieves a map that is keyed by the
resource scopes behind given context object and
yields the descriptors of the metamodel s using them. |
protected org.eclipse.emf.ecore.EObject |
getEObject(org.eclipse.emf.common.util.URI uri,
IMetaModelDescriptor targetMetaModelDescriptor,
java.lang.Object contextObject,
boolean loadOnDemand)
Retrieves the object from specified target
metamodel that
corresponds to given URI. |
protected IResourceScope |
getOutsideWorkspaceScope()
Returns the
resource scope used to encompass all resources that are located outside of the
workspace. |
java.util.List<org.eclipse.emf.ecore.resource.Resource> |
getResourcesInModel(java.lang.Object contextObject)
Retrieves all
resource s in this resourceset owned by the model containing
the context object and its referenced models. |
java.util.List<org.eclipse.emf.ecore.resource.Resource> |
getResourcesInModel(java.lang.Object contextObject,
boolean includeReferencedScopes)
Retrieves all
resource s in this resourceset owned by the model containing
the context object. |
java.util.List<org.eclipse.emf.ecore.resource.Resource> |
getResourcesInScope(java.lang.Object contextObject)
Retrieves all
resource s in this resourceset owned by the
resource scope containing the context object and its referenced resource scope s. |
java.util.List<org.eclipse.emf.ecore.resource.Resource> |
getResourcesInScope(java.lang.Object contextObject,
boolean includeReferencedScopes)
Retrieves all
resource s in this resourceset owned by the
resource scope containing the context object. |
protected java.util.List<org.eclipse.emf.ecore.resource.Resource> |
getResourcesInScope(java.lang.Object contextObject,
boolean includeReferencedScopes,
boolean ignoreMetaModel)
Retrieves the
resource s contained by this resource set that belong to the
resource scope (s) behind provided contextObject . |
protected java.util.List<org.eclipse.emf.ecore.resource.Resource> |
getResourcesToSearchIn(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand,
org.eclipse.emf.ecore.EObject contextObject)
Deprecated.
|
protected boolean |
hasMatchingMetaModel(java.util.Set<IMetaModelDescriptor> mmDescriptors,
org.eclipse.emf.ecore.resource.Resource resource) |
boolean |
isResourceInScope(org.eclipse.emf.ecore.resource.Resource resource,
java.lang.Object contextObject)
|
boolean |
isResourceInScope(org.eclipse.emf.ecore.resource.Resource resource,
java.lang.Object contextObject,
boolean includeReferencedScopes)
|
protected boolean |
isResourceInScope(org.eclipse.emf.ecore.resource.Resource resource,
java.lang.Object contextObject,
boolean includeReferencedScopes,
boolean ignoreMetaModel)
|
augmentToContextAwareProxy, createContextAwareURIHelper, createProxyHelper, demandCreateResource, demandLoad, getContextContainer, getDelegateResourceSet, getEObject, getEObject, getFilteredResources, getModCount, getProxyResolverService, getResource, getResources, getResourcesToSearchIn, loadModels, safeFindEObjectInResources, safeGetEObjectFromResource, safeGetResource, trimProxyContextInfo
createResource, createResource, delegatedGetResource, demandLoadHelper, getAdapterFactories, getAllContents, getLoadOptions, getPackageRegistry, getResourceFactoryRegistry, getURIConverter, getURIResourceMap, handleDemandLoadException, setPackageRegistry, setResourceFactoryRegistry, setURIConverter, setURIResourceMap, toString
eAdapters, eBasicAdapters, eDeliver, eSetDeliver
eBasicAdapterArray, eBasicHasAdapters, eNotificationRequired, eNotify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
augmentToContextAwareProxy, getEObject, trimProxyContextInfo
createResource, createResource, getAdapterFactories, getAllContents, getEObject, getLoadOptions, getPackageRegistry, getResource, getResourceFactoryRegistry, getResources, getURIConverter, setPackageRegistry, setResourceFactoryRegistry, setURIConverter
protected IResourceScope getOutsideWorkspaceScope()
resource scope
used to encompass all resources that are located outside of the
workspace.protected IResourceScope createOutsideWorkspaceScope()
resource scope
used to encompass all resources that are located outside of the
workspace.public java.util.List<org.eclipse.emf.ecore.resource.Resource> getResourcesInModel(java.lang.Object contextObject)
ScopingResourceSet
resource
s in this resourceset
owned by the model containing
the context object and its referenced models.getResourcesInModel
in interface ScopingResourceSet
contextObject
- A context object for which a list of resources should be retrieved.public java.util.List<org.eclipse.emf.ecore.resource.Resource> getResourcesInModel(java.lang.Object contextObject, boolean includeReferencedScopes)
ScopingResourceSet
resource
s in this resourceset
owned by the model containing
the context object.getResourcesInModel
in interface ScopingResourceSet
contextObject
- A context object for which a list of resources should be retrieved.includeReferencedScopes
- A boolean value that let to decide if resources must be retrieved under depending roots of the
concerned modelpublic java.util.List<org.eclipse.emf.ecore.resource.Resource> getResourcesInScope(java.lang.Object contextObject)
ScopingResourceSet
resource
s in this resourceset
owned by the
resource scope
containing the context object and its referenced resource scope
s.getResourcesInScope
in interface ScopingResourceSet
contextObject
- A context object for which a list of resources should be retrieved.public java.util.List<org.eclipse.emf.ecore.resource.Resource> getResourcesInScope(java.lang.Object contextObject, boolean includeReferencedScopes)
ScopingResourceSet
resource
s in this resourceset
owned by the
resource scope
containing the context object.getResourcesInScope
in interface ScopingResourceSet
contextObject
- A context object for which a list of resources should be retrieved.includeReferencedScopes
- A boolean value that let to decide if resources must be retrieved under depending roots of the
concerned model.protected java.util.List<org.eclipse.emf.ecore.resource.Resource> getResourcesInScope(java.lang.Object contextObject, boolean includeReferencedScopes, boolean ignoreMetaModel)
resource
s contained by this resource set
that belong to the
resource scope
(s) behind provided contextObject
.contextObject
- The context object the resource scope to refer to.includeReferencedScopes
- true
if the resources of resource scopes that are referenced by the resource scope behind
the context object are to be retrieved as well, false
if only the resources of the
resource scope behind the context object are to be retrieved.ignoreMetaModel
- true
if the resources should be retrieved regardless whether their metamodel descriptor
matches that behind the context object, false
if the metamodel descriptors of the
resources and the context object are required to match.contextObject
.public boolean isResourceInScope(org.eclipse.emf.ecore.resource.Resource resource, java.lang.Object contextObject)
ScopingResourceSet
isResourceInScope
in interface ScopingResourceSet
resource
- The resource to be investigated.contextObject
- The context object identifying the resource scope to refer to.true
if given resource belongs to the resource scope behind provided
contextObject
, or false
otherwise.public boolean isResourceInScope(org.eclipse.emf.ecore.resource.Resource resource, java.lang.Object contextObject, boolean includeReferencedScopes)
ScopingResourceSet
isResourceInScope
in interface ScopingResourceSet
resource
- The resource to be investigated.contextObject
- The context object identifying the resource scope to refer to.includeReferencedScopes
- true
if the resource scopes that are referenced by the resource scope behind the context
object are to be considered as well, false
if only the resource scope behind the context
object is to be considered.true
if given resource belongs to the resource scope behind provided
contextObject
, or false
otherwise.protected boolean isResourceInScope(org.eclipse.emf.ecore.resource.Resource resource, java.lang.Object contextObject, boolean includeReferencedScopes, boolean ignoreMetaModel)
resource
- The resource to be investigated.contextObject
- The context object identifying the resource scope to refer to.includeReferencedScopes
- true
if the resource scopes that are referenced by the resource scope behind the context
object are to be considered as well, false
if only the resource scope behind the context
object is to be considered.ignoreMetaModel
- true
if the given resource should be considered to belong to the resource scope behind
the context object regardless whether its metamodel descriptor matches that of the context object,
false
if the metamodel descriptors of the given resource and the context object are
required to match.true
if given resource belongs to the resource scope behind provided
contextObject
, or false
otherwise.protected java.util.Map<IResourceScope,java.util.Set<IMetaModelDescriptor>> getContextResourceScopes(java.lang.Object contextObject)
resource scopes
behind given context object and
yields the descriptors of the metamodel
s using them.contextObject
- The context object to retrieve the resource scopes for.protected boolean hasMatchingMetaModel(java.util.Set<IMetaModelDescriptor> mmDescriptors, org.eclipse.emf.ecore.resource.Resource resource)
protected org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.common.util.URI uri, IMetaModelDescriptor targetMetaModelDescriptor, java.lang.Object contextObject, boolean loadOnDemand)
ExtendedResourceSetImpl
metamodel
that
corresponds to given URI. Uses provided to limit the search scope
to the subset of resource
s that are in the same scope
as the resource.getEObject
in class ExtendedResourceSetImpl
uri
- The URI to be resolved.targetMetaModelDescriptor
- The meta model descriptor
of the object that is referenced by given URI.contextObject
- The context resource that is used to limit the search scope.loadOnDemand
- Whether to load the resource or model containing the object that is referenced by given URI if it is
not already loaded.null
if given URI cannot be resolved.@Deprecated protected java.util.List<org.eclipse.emf.ecore.resource.Resource> getResourcesToSearchIn(org.eclipse.emf.common.util.URI uri, boolean loadOnDemand, org.eclipse.emf.ecore.EObject contextObject)
ExtendedResourceSetImpl.getResourcesToSearchIn(List, URI, IMetaModelDescriptor)
instead.resource
s to be considered for resolving given URI
. Only called
when given URI is fragment-based (i.e., has no segments and doesn't reference any explicit target resource).
This implementation uses the provided context object
, if not null
, to retrieve the
resources in scope
, and returns all resources
in
this resource set
otherwise. Clients may override this method in order to tweak
the set of resource
s used for resolving fragment-based URI
s.
uri
- The fragment-based URI
to resolve.loadOnDemand
- Whether to create and load the target resource
, if it isn't already present in this
resource set
.contextObject
- The context object
used to determine the set of resource
s to be
considered for resolving given fragment-based URI
.resource
s to be considered for resolving given fragment-based URI
.getResourcesInScope(Object)
,
ExtendedResourceSetImpl.getResources()