public class ExtendedResourceSetImpl extends org.eclipse.emf.ecore.resource.impl.ResourceSetImpl implements ExtendedResourceSet
ResourceSet
implementation.Modifier and Type | Class and Description |
---|---|
protected class |
ExtendedResourceSetImpl.ExtendedResourcesEList<E extends java.lang.Object & org.eclipse.emf.ecore.resource.Resource>
An enhanced
ResourcesEList implementation that exposes a ExtendedResourceSetImpl.ExtendedResourcesEList.getModCount() method through which
clients figure out the number of times this list has been structurally modified and updates
ResourceSetImpl.getURIResourceMap() when Resource s are added of removed. |
protected static interface |
ExtendedResourceSetImpl.ResourceFilter
A
resource filter for determining the subsets of resources that are to be considered for
resolving fragment-based URI s. |
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
Modifier and Type | Field and Description |
---|---|
protected ContextAwareProxyURIHelper |
contextAwareProxyURIHelper |
protected ProxyHelper |
proxyHelper |
adapterFactories, loadOptions, packageRegistry, resourceFactoryRegistry, resourceLocator, resources, uriConverter, uriResourceMap
Constructor and Description |
---|
ExtendedResourceSetImpl() |
Modifier and Type | Method and Description |
---|---|
void |
augmentToContextAwareProxy(org.eclipse.emf.ecore.EObject proxy,
org.eclipse.emf.ecore.resource.Resource contextResource)
Augments given
proxy to a context-aware proxy by adding key/value pairs that contain the
target metamodel descriptor and a context URI to the query string of the proxy URI. |
protected ContextAwareProxyURIHelper |
createContextAwareURIHelper() |
protected ProxyHelper |
createProxyHelper() |
protected org.eclipse.emf.ecore.resource.Resource |
demandCreateResource(org.eclipse.emf.common.util.URI uri) |
protected void |
demandLoad(org.eclipse.emf.ecore.resource.Resource resource) |
protected org.eclipse.core.resources.IContainer |
getContextContainer(java.lang.Object contextObject)
Get the container of the provided
context object . |
protected org.eclipse.emf.ecore.resource.ResourceSet |
getDelegateResourceSet(IMetaModelDescriptor metaModelDescriptor,
java.lang.Object contextObject)
Retrieves a delegate
resource set corresponding to the provided metamodel descriptor and context object . |
org.eclipse.emf.ecore.EObject |
getEObject(org.eclipse.emf.ecore.EObject proxy,
org.eclipse.emf.ecore.EObject contextObject,
boolean loadOnDemand)
Retrieves the object for specified
proxy . |
org.eclipse.emf.ecore.EObject |
getEObject(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand) |
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 java.util.List<org.eclipse.emf.ecore.resource.Resource> |
getFilteredResources(java.util.List<org.eclipse.emf.ecore.resource.Resource> allResources,
ExtendedResourceSetImpl.ResourceFilter resourceFilter)
Returns the subset of given set of
resource s that make through provided resource filter . |
int |
getModCount() |
protected IProxyResolverService |
getProxyResolverService(IMetaModelDescriptor descriptor) |
org.eclipse.emf.ecore.resource.Resource |
getResource(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand) |
org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.resource.Resource> |
getResources() |
protected java.util.List<org.eclipse.emf.ecore.resource.Resource> |
getResourcesToSearchIn(java.util.List<org.eclipse.emf.ecore.resource.Resource> allResources,
org.eclipse.emf.common.util.URI uri,
IMetaModelDescriptor targetMetaModelDescriptor)
Determines the subset of given set of
resource s that are to be considered for resolving given
URI . |
protected void |
loadModels(IMetaModelDescriptor metaModelDescriptor,
java.lang.Object contextObject)
Loads all models of given
metamodel within provided context . |
protected org.eclipse.emf.ecore.EObject |
safeFindEObjectInResources(java.util.List<org.eclipse.emf.ecore.resource.Resource> resources,
org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
Resolves given
URI against given set of resource s.Only called when given URI is
fragment-based (i.e., has no segments and doesn't reference any explicit target resource). |
protected org.eclipse.emf.ecore.EObject |
safeGetEObjectFromResource(org.eclipse.emf.ecore.resource.Resource resource,
java.lang.String uriFragment)
Resolves given
URI against given resource . |
protected org.eclipse.emf.ecore.resource.Resource |
safeGetResource(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
Get
resource of given URI . |
org.eclipse.emf.common.util.URI |
trimProxyContextInfo(org.eclipse.emf.common.util.URI proxyURI)
If given
proxy URI contains proxy context-related key/value pairs on its query
string , returns the URI formed by removing those key/value pairs or removing the query string entirely in case
that no other key/value pairs exist; returns given proxy URI unchanged, otherwise. |
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
protected final ContextAwareProxyURIHelper contextAwareProxyURIHelper
protected final ProxyHelper proxyHelper
protected ContextAwareProxyURIHelper createContextAwareURIHelper()
protected ProxyHelper createProxyHelper()
public org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.emf.common.util.URI uri, boolean loadOnDemand)
getResource
in interface org.eclipse.emf.ecore.resource.ResourceSet
getResource
in class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
protected org.eclipse.emf.ecore.resource.Resource demandCreateResource(org.eclipse.emf.common.util.URI uri)
demandCreateResource
in class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
protected void demandLoad(org.eclipse.emf.ecore.resource.Resource resource) throws java.io.IOException
demandLoad
in class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
java.io.IOException
public org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.resource.Resource> getResources()
getResources
in interface org.eclipse.emf.ecore.resource.ResourceSet
getResources
in class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
public int getModCount()
ResourceSet
has been structurally modified.AbstractList.modCount
public void augmentToContextAwareProxy(org.eclipse.emf.ecore.EObject proxy, org.eclipse.emf.ecore.resource.Resource contextResource)
ExtendedResourceSet
proxy
to a context-aware proxy by adding key/value pairs that contain the
target metamodel descriptor
and a context URI
to the query string
of the proxy URI. Those are required to support the resolution of proxified references between
objects from different metamodels and to honor the resource scope
of the proxy URI when it
is being resolved.augmentToContextAwareProxy
in interface ExtendedResourceSet
proxy
- The proxy to be handled.contextResource
- The resource that identifies the context of the proxy (typically the resource containing it).ExtendedResourceSet.trimProxyContextInfo(URI)
public org.eclipse.emf.common.util.URI trimProxyContextInfo(org.eclipse.emf.common.util.URI proxyURI)
ExtendedResourceSet
proxy URI
contains proxy context-related key/value pairs on its query
string
, returns the URI formed by removing those key/value pairs or removing the query string entirely in case
that no other key/value pairs exist; returns given proxy URI unchanged, otherwise.trimProxyContextInfo
in interface ExtendedResourceSet
proxyURI
- The context-aware proxy URI to be handled.#augmentToContextAwareProxy(EObject)
public org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.common.util.URI uri, boolean loadOnDemand)
getEObject
in interface org.eclipse.emf.ecore.resource.ResourceSet
getEObject
in class org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
public org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.ecore.EObject proxy, org.eclipse.emf.ecore.EObject contextObject, boolean loadOnDemand)
ExtendedResourceSet
proxy
. Allows to use provided
contextObject
- i.e., the object referencing the proxy - to customize or optimize the way how the
resolution of the proxy is done.getEObject
in interface ExtendedResourceSet
proxy
- The to be resolved.contextObject
- The context object
that can be used customize or optimize the way how the resolution
of the proxy is done.loadOnDemand
- Whether to load the resource or model containing the object that is referenced by given
proxy
if it is not already loaded.proxy
or null
if given
proxy
cannot be resolved.protected org.eclipse.emf.ecore.EObject getEObject(org.eclipse.emf.common.util.URI uri, IMetaModelDescriptor targetMetaModelDescriptor, java.lang.Object contextObject, boolean loadOnDemand)
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.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.protected java.util.List<org.eclipse.emf.ecore.resource.Resource> getResourcesToSearchIn(java.util.List<org.eclipse.emf.ecore.resource.Resource> allResources, org.eclipse.emf.common.util.URI uri, IMetaModelDescriptor targetMetaModelDescriptor)
resource
s that are 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 applies a resource filter
to the provided set of resource
s retaining only those resource
s that match specified target
metamodel descriptor
behind given URI
.
allResources
- The set of resource
s from which the resources to be considered for resolving given
fragment-based URI
are to be extracted.uri
- The fragment-based URI
to resolve.targetMetaModelDescriptor
- The metamodel descriptor
of the object that given fragment-based
URI
is supposed to resolve to.resource
s to be considered for resolving given fragment-based URI
.getResources()
protected java.util.List<org.eclipse.emf.ecore.resource.Resource> getFilteredResources(java.util.List<org.eclipse.emf.ecore.resource.Resource> allResources, ExtendedResourceSetImpl.ResourceFilter resourceFilter)
resource
s that make through provided resource filter
.allResources
- The set of resource
s to be filtered.filter
- The to be applied.resource
s that make through provided resource filter
or an empty list of no matching resources are found.protected org.eclipse.emf.ecore.EObject safeFindEObjectInResources(java.util.List<org.eclipse.emf.ecore.resource.Resource> resources, org.eclipse.emf.common.util.URI uri, boolean loadOnDemand)
URI
against given set of resource
s.Only called when given URI is
fragment-based (i.e., has no segments and doesn't reference any explicit target resource).resources
- The set of resource
s to resolve given fragment-based URI
against.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
.EObject
behind given fragment-based URI
, or null
if given URI
cannot be resolved.protected org.eclipse.emf.ecore.resource.Resource safeGetResource(org.eclipse.emf.common.util.URI uri, boolean loadOnDemand)
resource
of given URI
.uri
- The URI
to resolve.loadOnDemand
- Whether to create and load the target resource
, if it isn't already present in this
resource set
.protected org.eclipse.emf.ecore.EObject safeGetEObjectFromResource(org.eclipse.emf.ecore.resource.Resource resource, java.lang.String uriFragment)
URI
against given resource
.resource
- The resource
to resolve given fragment-based URI
against.uriFragment
- The fragment-based URI
to resolve.EObject
behind given fragment-based URI
, or null
if given URI
cannot be resolved.protected org.eclipse.emf.ecore.resource.ResourceSet getDelegateResourceSet(IMetaModelDescriptor metaModelDescriptor, java.lang.Object contextObject)
resource set
corresponding to the provided metamodel descriptor
and context object
.protected void loadModels(IMetaModelDescriptor metaModelDescriptor, java.lang.Object contextObject)
metamodel
within provided context
.metaModelDescriptor
- The metamodel descriptor
of the models to be loaded.contextObject
- The object
that identifies the context within which the models to be loaded are
located.protected org.eclipse.core.resources.IContainer getContextContainer(java.lang.Object contextObject)
context object
. If the context object is a project or container
URI, the project or container is returned. The parent of the file that owns the given context object is returned,
if the context object is a EObject. Otherwise null container is returned.protected IProxyResolverService getProxyResolverService(IMetaModelDescriptor descriptor)