public static class ResourceSetImpl.MappedResourceLocator extends ResourceSetImpl.ResourceLocator
ResourceSetImpl.ResourceLocator
that maintains cached mappings for
the normalized URIs
and the resource set's resources
.Modifier and Type | Class and Description |
---|---|
class |
ResourceSetImpl.MappedResourceLocator.ResourceAdapter
A
content adapter that listens to the resource set
for resources being added and removed,
as well as to the resources in the resource set for changes to the resource's URI . |
Modifier and Type | Field and Description |
---|---|
protected URIConverter |
cachedURIConverter
|
protected int |
expectedModificationCount
The cached
modification count of the cached URI converter . |
protected java.util.Map<URI,URI> |
normalizationMap
The cached mappings from URIs to their
normalized form. |
protected java.util.Map<URI,EList<Resource>> |
resourceMap
The cached mapping from normalized URIs to their corresponding resources.
|
resourceSet
Constructor and Description |
---|
ResourceSetImpl.MappedResourceLocator(ResourceSetImpl resourceSet)
Creates an instance of the given resource set.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildMaps()
|
protected boolean |
cacheURIConverter()
Caches the URI converter,
checking that it's the same as the ResourceLocator#resourceSet's current URI converter
and that the modification count of the URI map
is the same as the expected modification count ,
building normalization and resource maps, if necessary. |
Resource |
getResource(URI uri,
boolean loadOnDemand)
The utility method used by a resource set for
locating a resource. |
protected void |
map(URI normalizedURI,
Resource resource)
Creates a
resource map entry for the resource with the given normalized URI. |
protected int |
modificationCount()
Determines
modification count of the cached URI converter . |
basicGetResource, delegatedGetResource, demandCreateResource, demandLoad, demandLoadHelper, dispose, handleDemandLoadException
protected URIConverter cachedURIConverter
protected int expectedModificationCount
modification count
of the cached URI converter
.protected java.util.Map<URI,URI> normalizationMap
normalized
form.protected java.util.Map<URI,EList<Resource>> resourceMap
resource set
with any resources not in the resource set, i.e., those located by delegation
,
appearing after those found in the resource set itself.public ResourceSetImpl.MappedResourceLocator(ResourceSetImpl resourceSet)
protected void map(URI normalizedURI, Resource resource)
resource map
entry for the resource with the given normalized URI.protected void buildMaps()
protected int modificationCount()
modification count
of the cached URI converter
.protected boolean cacheURIConverter()
Caches
the URI converter,
checking that it's the same as the ResourceLocator#resourceSet's
current URI converter
and that the modification count
of the URI map
is the same as the expected modification count
,
building
normalization and resource maps, if necessary.public Resource getResource(URI uri, boolean loadOnDemand)
ResourceSetImpl.ResourceLocator
locating
a resource.
It must implement the full logic needed to locate a resource,
including delegated lookup
and demand creation
.getResource
in class ResourceSetImpl.ResourceLocator