## org.eclipse.emf.compare.diff.service
Class DiffService

    java.lang.Object
      org.eclipse.emf.compare.diff.service.DiffService

    public final class DiffService

extends java.lang.Object

Parses extension meta data to fetch the diff engine to use.

Method Summary
`static DiffModel` `doDiff(MatchModel match)` Return a diffmodel created using the match model.
`static DiffModel` `doDiff(MatchModel match, boolean threeWay)` Return a diffmodel created using the match model.
`static DiffResourceSet` `doDiff(MatchResourceSet matchResourceSet)` Returns a DiffResourceSet created by differencing all MatchModels contained by `match`.
`static DiffResourceSet` `doDiff(MatchResourceSet matchResourceSet, boolean threeWay)` Returns a DiffResourceSet created by differencing all MatchModels contained by `match`.
`static IDiffEngine` `getBestDiffEngine(MatchModel matchModel)` Returns the best `IDiffEngine` for the given `MatchModel`.
`static IDiffEngine` `getBestDiffEngine(java.lang.String extension)` Deprecated. use `getBestDiffEngine(MatchModel)` instead.
`static java.util.Collection<AbstractDiffExtension>` `getCorrespondingDiffExtensions(MatchModel matchModel)` Returns all `AbstractDiffExtension`s registered against the given `MatchModel`.
`static java.util.Collection<AbstractDiffExtension>` `getCorrespondingDiffExtensions(java.lang.String extension)` Deprecated. use `getCorrespondingDiffExtensions(MatchModel)` instead.
`static void` `setDiffEngineSelector(IDiffEngineSelector selector)` Sets the diff 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

### doDiff

    public static DiffModel doDiff(MatchModel match)

  Return a diffmodel created using the match model. This implementation is a generic and simple one.

  Parameters:
    `match` - The matching model.
  Returns:
    The corresponding diff model.

### doDiff

    public static DiffModel doDiff(MatchModel match,
                                   boolean threeWay)

  Return a diffmodel created using the match model. This implementation is a generic and simple one.

  Parameters:
    `match` - the matching model
    `threeWay` - `True` if we're computing a three way comparison, `False` otherwise.
  Returns:
    the corresponding diff model

### doDiff

    public static DiffResourceSet doDiff(MatchResourceSet matchResourceSet)

  Returns a DiffResourceSet created by differencing all MatchModels contained by `match`. This will call for a two-way differencing.

  Parameters:
    `matchResourceSet` - Contains the MatchModels for all compared resources.
  Returns:
    DiffResourceSet created by differencing all MatchModels.

### doDiff

    public static DiffResourceSet doDiff(MatchResourceSet matchResourceSet,
                                         boolean threeWay)

  Returns a DiffResourceSet created by differencing all MatchModels contained by `match`. Depending on the value of `threeWay`, this will call for either two- or three-way differencing.

  Parameters:
    `matchResourceSet` - Contains the MatchModels for all compared resources.
    `threeWay` - `True` if we're computing a three way comparison, `False` otherwise.
  Returns:
    DiffResourceSet created by differencing all MatchModels.

### getBestDiffEngine

    public static IDiffEngine getBestDiffEngine(MatchModel matchModel)

  Returns the best `IDiffEngine` for the given `MatchModel`.

  Parameters:
    `matchModel` - The match model to differentiate.
  Returns:
    The best `IDiffEngine` for the given `MatchModel`
  Since:
    1.1

### getBestDiffEngine

    @Deprecated
    public static IDiffEngine getBestDiffEngine(java.lang.String extension)

  Deprecated. use `getBestDiffEngine(MatchModel)` instead.

  Returns the best `IDiffEngine` for a file given its extension.

  Parameters:
    `extension` - The extension of the file we need an `IDiffEngine` for.
  Returns:
    The best `IDiffEngine` for the given file extension.

### getCorrespondingDiffExtensions

    public static java.util.Collection<AbstractDiffExtension> getCorrespondingDiffExtensions(MatchModel matchModel)

  Returns all `AbstractDiffExtension`s registered against the given `MatchModel`.

  Parameters:
    `matchModel` - The `MatchModel` we need the `AbstractDiffExtension`s for.
  Returns:
    All of the `AbstractDiffExtension`s registered against the `MatchModel`.
  Since:
    1.1

### getCorrespondingDiffExtensions

    @Deprecated
    public static java.util.Collection<AbstractDiffExtension> getCorrespondingDiffExtensions(java.lang.String extension)

  Deprecated. use `getCorrespondingDiffExtensions(MatchModel)` instead.

  Returns all `AbstractDiffExtension`s registered against the given file `extension`.

  Parameters:
    `extension` - The extension of the file we need the `AbstractDiffExtension`s for.
  Returns:
    All of the `AbstractDiffExtension`s registered against the given file `extension`.

### setDiffEngineSelector

    public static void setDiffEngineSelector(IDiffEngineSelector selector)

  Sets the diff engine selector that is to be used.

  Parameters:
    `selector` - the new engine selector.

Copyright 2006 IBM Corporation and others. All Rights Reserved.