org.eclipse.emf.compare.match.service
Class MatchService

java.lang.Object
  extended by org.eclipse.emf.compare.match.service.MatchService

public final class MatchService
extends java.lang.Object

Service facade for matching models.


Method Summary
static MatchModel doContentMatch(org.eclipse.emf.ecore.EObject leftObject, org.eclipse.emf.ecore.EObject rightObject, org.eclipse.emf.ecore.EObject ancestor, java.util.Map<java.lang.String,java.lang.Object> options)
          Matches three objects along with their content, then return the corresponding match model.
static MatchModel doContentMatch(org.eclipse.emf.ecore.EObject leftObject, org.eclipse.emf.ecore.EObject rightObject, java.util.Map<java.lang.String,java.lang.Object> options)
          Matches two objects along with their content, then return the corresponding match model.
static MatchModel doMatch(org.eclipse.emf.ecore.EObject leftRoot, org.eclipse.emf.ecore.EObject rightRoot, org.eclipse.emf.ecore.EObject ancestor, java.util.Map<java.lang.String,java.lang.Object> options)
          Matches three models and returns the corresponding matching model.
static MatchModel doMatch(org.eclipse.emf.ecore.EObject leftRoot, org.eclipse.emf.ecore.EObject rightRoot, java.util.Map<java.lang.String,java.lang.Object> options)
          Matches two models and returns the corresponding matching model.
static MatchModel doResourceMatch(org.eclipse.emf.ecore.resource.Resource leftResource, org.eclipse.emf.ecore.resource.Resource rightResource, java.util.Map<java.lang.String,java.lang.Object> options)
          Matches two resources along with their content, then return the corresponding match model.
static MatchModel doResourceMatch(org.eclipse.emf.ecore.resource.Resource leftResource, org.eclipse.emf.ecore.resource.Resource rightResource, org.eclipse.emf.ecore.resource.Resource ancestorResource, java.util.Map<java.lang.String,java.lang.Object> options)
          Matches three resources and returns the corresponding matching model.
static MatchResourceSet doResourceSetMatch(org.eclipse.emf.ecore.resource.ResourceSet leftResourceSet, org.eclipse.emf.ecore.resource.ResourceSet rightResourceSet, java.util.Map<java.lang.String,java.lang.Object> options)
          Matches the resources contained by two resourceSets and return all corresponding MatchModels.
static MatchResourceSet doResourceSetMatch(org.eclipse.emf.ecore.resource.ResourceSet leftResourceSet, org.eclipse.emf.ecore.resource.ResourceSet rightResourceSet, org.eclipse.emf.ecore.resource.ResourceSet ancestorResourceSet, java.util.Map<java.lang.String,java.lang.Object> options)
          Matches the resources contained by three resourceSets and return all corresponding MatchModels.
static org.eclipse.emf.ecore.resource.Resource findMatchingResource(org.eclipse.emf.ecore.resource.Resource resource, java.util.List<org.eclipse.emf.ecore.resource.Resource> candidates)
          This will try and find a resource in candidates similar to resource.
static IMatchEngine getBestMatchEngine(org.eclipse.emf.ecore.resource.Resource... resources)
          Returns the best IMatchEngine for a given list of Resource to compare.
static IMatchEngine getBestMatchEngine(java.lang.String engineIdentifier)
          Deprecated. use getBestMatchEngine(Resource...) instead
static void setMatchEngineSelector(IMatchEngineSelector selector)
          Sets the match engine selector that is to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doContentMatch

public static MatchModel doContentMatch(org.eclipse.emf.ecore.EObject leftObject,
                                        org.eclipse.emf.ecore.EObject rightObject,
                                        org.eclipse.emf.ecore.EObject ancestor,
                                        java.util.Map<java.lang.String,java.lang.Object> options)
                                 throws java.lang.InterruptedException
Matches three objects along with their content, then return the corresponding match model.

Parameters:
leftObject - Left (local) of the three objects to get compared.
rightObject - Right (latest from repository) of the three objects to compare.
ancestor - Common ancestor of the two others.
options - Options to tweak the matching procedure. null or an empty map will result in the default options to be used.
Returns:
MatchModel for these three objects' comparison.
Throws:
java.lang.InterruptedException - Thrown if the matching is interrupted somehow.
Since:
1.0
See Also:
MatchOptions, IMatchEngine.contentMatch(EObject, EObject, EObject, Map)

doContentMatch

public static MatchModel doContentMatch(org.eclipse.emf.ecore.EObject leftObject,
                                        org.eclipse.emf.ecore.EObject rightObject,
                                        java.util.Map<java.lang.String,java.lang.Object> options)
                                 throws java.lang.InterruptedException
Matches two objects along with their content, then return the corresponding match model.

Parameters:
leftObject - Left (local) of the two objects to get compared.
rightObject - Right (latest from repository) of the two objects to compare.
options - Options to tweak the matching procedure. null or an empty map will result in the default options to be used.
Returns:
MatchModel for these two objects' comparison.
Throws:
java.lang.InterruptedException - Thrown if the matching is interrupted somehow.
Since:
1.0
See Also:
MatchOptions, IMatchEngine.contentMatch(EObject, EObject, Map)

doMatch

public static MatchModel doMatch(org.eclipse.emf.ecore.EObject leftRoot,
                                 org.eclipse.emf.ecore.EObject rightRoot,
                                 org.eclipse.emf.ecore.EObject ancestor,
                                 java.util.Map<java.lang.String,java.lang.Object> options)
                          throws java.lang.InterruptedException
Matches three models and returns the corresponding matching model.

Parameters:
leftRoot - Left (local) model of this comparison.
rightRoot - Right (latest from repository) model of this comparison.
ancestor - Common ancestor of leftRoot and rightRoot.
options - Options to tweak the matching procedure. null or an empty map will result in the default options to be used.
Returns:
Matching model result of the comparison.
Throws:
java.lang.InterruptedException - Thrown if the matching is interrupted somehow.
See Also:
MatchOptions

doMatch

public static MatchModel doMatch(org.eclipse.emf.ecore.EObject leftRoot,
                                 org.eclipse.emf.ecore.EObject rightRoot,
                                 java.util.Map<java.lang.String,java.lang.Object> options)
                          throws java.lang.InterruptedException
Matches two models and returns the corresponding matching model.

Parameters:
leftRoot - Left (local) model of the comparison.
rightRoot - Right (latest from repository) model of the comparison.
options - Options to tweak the matching procedure. null or an empty map will result in the default options to be used.
Returns:
Matching model result of these two models' comparison.
Throws:
java.lang.InterruptedException - Thrown if the matching is interrupted somehow.
See Also:
MatchOptions

doResourceMatch

public static MatchModel doResourceMatch(org.eclipse.emf.ecore.resource.Resource leftResource,
                                         org.eclipse.emf.ecore.resource.Resource rightResource,
                                         java.util.Map<java.lang.String,java.lang.Object> options)
                                  throws java.lang.InterruptedException
Matches two resources along with their content, then return the corresponding match model.

Parameters:
leftResource - Left (local) of the two resources to get compared.
rightResource - Right (latest from repository) of the two resources to compare.
options - Options to tweak the matching procedure. null or an empty map will result in the default options to be used.
Returns:
MatchModel for these two resources' comparison.
Throws:
java.lang.InterruptedException - Thrown if the matching is interrupted somehow.
Since:
1.0
See Also:
MatchOptions, IMatchEngine.contentMatch(EObject, EObject, Map)

doResourceMatch

public static MatchModel doResourceMatch(org.eclipse.emf.ecore.resource.Resource leftResource,
                                         org.eclipse.emf.ecore.resource.Resource rightResource,
                                         org.eclipse.emf.ecore.resource.Resource ancestorResource,
                                         java.util.Map<java.lang.String,java.lang.Object> options)
                                  throws java.lang.InterruptedException
Matches three resources and returns the corresponding matching model.

Parameters:
leftResource - Left (local) resource of this comparison.
rightResource - Right (latest from repository) resource of this comparison.
ancestorResource - Common ancestor of leftResource and rightResource.
options - Options to tweak the matching procedure. null or an empty map will result in the default options to be used.
Returns:
Matching model result of the comparison.
Throws:
java.lang.InterruptedException - Thrown if the matching is interrupted somehow.
See Also:
MatchOptions

doResourceSetMatch

public static MatchResourceSet doResourceSetMatch(org.eclipse.emf.ecore.resource.ResourceSet leftResourceSet,
                                                  org.eclipse.emf.ecore.resource.ResourceSet rightResourceSet,
                                                  java.util.Map<java.lang.String,java.lang.Object> options)
                                           throws java.lang.InterruptedException
Matches the resources contained by two resourceSets and return all corresponding MatchModels.

Parameters:
leftResourceSet - ResourceSet of the left compared Resource.
rightResourceSet - ResourceSet of the right compared Resource.
options - Options to tweak the matching procedure. null or Collections.EMPTY_MAP will result in the default options to be used.
Returns:
MatchResourceSet containing all corresponding MatchModels.
Throws:
java.lang.InterruptedException - Thrown if the options map specifies a progress monitor, and the comparison gets interrupted somehow.
Since:
1.0
See Also:
MatchOptions

doResourceSetMatch

public static MatchResourceSet doResourceSetMatch(org.eclipse.emf.ecore.resource.ResourceSet leftResourceSet,
                                                  org.eclipse.emf.ecore.resource.ResourceSet rightResourceSet,
                                                  org.eclipse.emf.ecore.resource.ResourceSet ancestorResourceSet,
                                                  java.util.Map<java.lang.String,java.lang.Object> options)
                                           throws java.lang.InterruptedException
Matches the resources contained by three resourceSets and return all corresponding MatchModels.

Parameters:
leftResourceSet - ResourceSet of the left compared Resource.
rightResourceSet - ResourceSet of the right compared Resource.
ancestorResourceSet - resourceSet containing the common ancestor of the two compared resources.
options - Options to tweak the matching procedure. null or Collections.EMPTY_MAP will result in the default options to be used.
Returns:
MatchResourceSet containing all corresponding MatchModels.
Throws:
java.lang.InterruptedException - Thrown if the options map specifies a progress monitor, and the comparison gets interrupted somehow.
Since:
1.0
See Also:
MatchOptions

findMatchingResource

public static org.eclipse.emf.ecore.resource.Resource findMatchingResource(org.eclipse.emf.ecore.resource.Resource resource,
                                                                           java.util.List<org.eclipse.emf.ecore.resource.Resource> candidates)
This will try and find a resource in candidates similar to resource.

Parameters:
resource - The resource we seek a similar to in the given resourceSet.
candidates - candidate resources.
Returns:
The most similar resource to resource we could find in resourceSet.

getBestMatchEngine

public static IMatchEngine getBestMatchEngine(org.eclipse.emf.ecore.resource.Resource... resources)
Returns the best IMatchEngine for a given list of Resource to compare.

Parameters:
resources - The list of Resource to compare.
Returns:
The best IMatchEngine for the given list of Resource
Since:
1.1

getBestMatchEngine

@Deprecated
public static IMatchEngine getBestMatchEngine(java.lang.String engineIdentifier)
Deprecated. use getBestMatchEngine(Resource...) instead

Returns the best IMatchEngine for a file given its extension.

Parameters:
engineIdentifier - An engine identifier to search on the registered IMatchEngine.
An engine identifier is a String that can describe either a file extension, a content-type or a namespace.
Returns:
The best IMatchEngine for the given engine identifier.

setMatchEngineSelector

public static void setMatchEngineSelector(IMatchEngineSelector selector)
Sets the match engine selector that is to be used.

Parameters:
selector - the new engine selector.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.