public final class CompositeResourceMapping extends ResourceMapping
This class is not intended to be subclasses by clients.
Constructor and Description |
---|
CompositeResourceMapping(String providerId,
Object modelObject,
ResourceMapping[] mappings)
Create a composite mapping that obtains its traversals from a set of sub-mappings.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(ResourceMapping mapping)
Return whether this resource mapping contains all the resources
of the given mapping.
|
ResourceMapping[] |
getMappings()
Return the resource mappings contained in this composite.
|
Object |
getModelObject()
Returns the application model element associated with this
resource mapping.
|
String |
getModelProviderId()
Returns the id of the model provider that generated this resource
mapping.
|
IProject[] |
getProjects()
Returns the projects that contain the resources that constitute this
application model.
|
ResourceTraversal[] |
getTraversals(ResourceMappingContext context,
IProgressMonitor monitor)
Returns one or more traversals that can be used to access all the
physical resources that constitute the logical resource.
|
accept, equals, findMarkers, getModelProvider, hashCode
getAdapter
public CompositeResourceMapping(String providerId, Object modelObject, ResourceMapping[] mappings)
modelObject
- the model object for this mappingmappings
- the sub-mappings from which the traversals are obtainedpublic boolean contains(ResourceMapping mapping)
ResourceMapping
This method always returns false
when the given resource
mapping's model provider id does not match that the of the receiver.
contains
in class ResourceMapping
mapping
- the given resource mappingtrue
if this mapping contains all the resources
of the given mapping, and false
otherwise.public ResourceMapping[] getMappings()
public Object getModelObject()
ResourceMapping
getModelObject
in class ResourceMapping
public String getModelProviderId()
ResourceMapping
getModelProviderId
in class ResourceMapping
public IProject[] getProjects()
ResourceMapping
getProjects
in class ResourceMapping
public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException
ResourceMapping
Subclasses should, when possible, include all resources that are or may be members of the model element. For instance, a model element should return the same list of resources regardless of the existence of the files on the file system. For example, if a logical resource called "form" maps to "/p1/form.xml" and "/p1/form.java" then whether form.xml or form.java existed, they should be returned by this method.
In some cases, it may not be possible for a model element to know all the resources that may constitute the element without accessing the state of the model element in another location (e.g. a repository). This method is provided with a context which, when provided, gives access to the members of corresponding remote containers and the contents of corresponding remote files. This gives the model element the opportunity to deduce what additional resources should be included in the traversal.
getTraversals
in class ResourceMapping
context
- gives access to the state of
remote resources that correspond to local resources for the
purpose of determining traversals that adequately cover the
model element resources given the state of the model element
in another location. This parameter may be null
, in
which case the implementor can assume that only the local
resources are of interest to the client.monitor
- a progress monitor, or null
if progress
reporting is not desiredCoreException
- if the traversals could not be obtained.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.