Package org.eclipse.emf.compare.ide.ui.internal.logical

# Class EMFModelProvider

java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.core.resources.mapping.ModelProvider
org.eclipse.emf.compare.ide.ui.internal.logical.EMFModelProvider

All Implemented Interfaces:
  `org.eclipse.core.runtime.IAdaptable`

public class EMFModelProvider extends org.eclipse.core.resources.mapping.ModelProvider
This implementation of a `ModelProvider` will be used to provide the logical model associated with EMF models.

Concretely, an EMF model can span multiple physical resources (fragmented models); this model provider can be used to find all of these associated physical resources. Note that a model can span remote resources that do not exist locally; these will be accounted for when using this model with a `RemoteResourceMappingContext`.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final long`
`CACHE_EXPIRATION`
The expiration timeout for our logical model cache values.
`static final String`
`PROVIDER_ID`
ID of this model provider.

### Fields inherited from class org.eclipse.core.resources.mapping.ModelProvider

`RESOURCE_MODEL_PROVIDER_ID`

## Constructor Summary

Constructors
Constructor
Description
`EMFModelProvider()`
Default constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`clear()`
Clears the caches of this provider.
`org.eclipse.core.resources.mapping.ResourceMapping[]`
`getMappings(org.eclipse.core.resources.IResource[] resources, org.eclipse.core.resources.mapping.ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor)`
`org.eclipse.core.resources.mapping.ResourceMapping[]`
`getMappings(org.eclipse.core.resources.IResource resource, org.eclipse.core.resources.mapping.ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor)`

### Methods inherited from class org.eclipse.core.resources.mapping.ModelProvider

`equals, getDescriptor, getId, getMappings, getModelProviderDescriptor, getModelProviderDescriptors, getTraversals, hashCode, init, initialize, validateChange`

### Methods inherited from class org.eclipse.core.runtime.PlatformObject

`getAdapter`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### PROVIDER_ID

public static final String PROVIDER_ID
ID of this model provider. Must match the definition from the plugin.xml.

See Also:
  - Constant Field Values

### CACHE_EXPIRATION

public static final long CACHE_EXPIRATION
The expiration timeout for our logical model cache values. This might mean that some of the `returned mappings` might reflect a stale view of the files' logical models, but we expect said logical traversals not to change that often.

Basically, the mappings are used by the platform to determine whether a file can be moved, replaced or compared alone or if in the contrary the action's scope must be expanded, and will do so very often in short intervals. We will cache the result in order to avoid multiple identical computation to take place and hasten the whole process.

## Constructor Details

### EMFModelProvider

public EMFModelProvider()
Default constructor.

## Method Details

### getMappings

public org.eclipse.core.resources.mapping.ResourceMapping[] getMappings(org.eclipse.core.resources.IResource resource, org.eclipse.core.resources.mapping.ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException

Overrides:
  `getMappings` in class `org.eclipse.core.resources.mapping.ModelProvider`
Throws:
  `org.eclipse.core.runtime.CoreException`
See Also:
  - `ModelProvider.getMappings(org.eclipse.core.resources.IResource, org.eclipse.core.resources.mapping.ResourceMappingContext, org.eclipse.core.runtime.IProgressMonitor)`

### getMappings

public org.eclipse.core.resources.mapping.ResourceMapping[] getMappings(org.eclipse.core.resources.IResource[] resources, org.eclipse.core.resources.mapping.ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException

Overrides:
  `getMappings` in class `org.eclipse.core.resources.mapping.ModelProvider`
Throws:
  `org.eclipse.core.runtime.CoreException`

### clear

public void clear()
Clears the caches of this provider.