Package org.eclipse.emf.compare.merge

## Class IMerger.RegistryImpl

- java.lang.Object
- - org.eclipse.emf.compare.merge.IMerger.RegistryImpl

All Implemented Interfaces:
  `IMerger.Registry`, `IMerger.Registry2`

Enclosing interface:
  IMerger

    public static class IMerger.RegistryImpl
    extends Object
    implements IMerger.Registry2

A default implementation of an `IMerger.Registry`. This is the implementation EMF Compare will use through its GUI.

### Constructor Summary

Constructors
`RegistryImpl()` Constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`IMerger` `add​(IMerger merger)` Adds a merger to the registry.
`void` `clear()` Clear the registry.
`static IMerger.Registry` `createStandaloneInstance()` Returns a registry filled with the default mergers provided by EMF Compare; namely `AttributeChangeMerger`, `ReferenceChangeMerger`, `FeatureMapChangeMerger`, `ResourceAttachmentChangeMerger`, `PseudoConflictMerger` and `ConflictMerger`.
`IMerger` `getHighestRankingMerger​(Diff target)` Returns the merger, for the given target, owning the highest ranking.
`Collection<IMerger>` `getMergers​(Diff target)` Returns the list of the candidate mergers for the given difference.
`Iterator<IMerger>` `getMergersByRankDescending​(Diff diff, IMergeCriterion criterion)` Provide the mergers sorted by rank descending.
`IMerger` `remove​(String className)` Removes a merger from the registry, from its class name.

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

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

### Constructor Detail

#### RegistryImpl

    public RegistryImpl()

Constructor.

### Method Detail

#### createStandaloneInstance

    public static IMerger.Registry createStandaloneInstance()

Returns a registry filled with the default mergers provided by EMF Compare; namely `AttributeChangeMerger`, `ReferenceChangeMerger`, `FeatureMapChangeMerger`, `ResourceAttachmentChangeMerger`, `PseudoConflictMerger` and `ConflictMerger`.

Returns:
  A registry filled with the default mergers provided by EMF Compare.

#### add

    public IMerger add​(IMerger merger)

Adds a merger to the registry.

Specified by:
  `add` in interface `IMerger.Registry`
Parameters:
  `merger` - The merger.
Returns:
  The previously registered merger.
See Also:
  `IMerger.Registry.add(org.eclipse.emf.compare.merge.IMerger)`

#### remove

    public IMerger remove​(String className)

Removes a merger from the registry, from its class name.

Specified by:
  `remove` in interface `IMerger.Registry`
Parameters:
  `className` - The class name.
Returns:
  The previously registered merger.
See Also:
  `IMerger.Registry.remove(java.lang.String)`

#### clear

    public void clear()

Clear the registry.

Specified by:
  `clear` in interface `IMerger.Registry`
See Also:
  `IMerger.Registry.clear()`

#### getHighestRankingMerger

    public IMerger getHighestRankingMerger​(Diff target)

Returns the merger, for the given target, owning the highest ranking.

Specified by:
  `getHighestRankingMerger` in interface `IMerger.Registry`
Parameters:
  `target` - The given target difference.
Returns:
  The found merger.
See Also:
  `IMerger.Registry.getHighestRankingMerger(org.eclipse.emf.compare.Diff)`

#### getMergersByRankDescending

    public Iterator<IMerger> getMergersByRankDescending​(Diff diff,
                                                        IMergeCriterion criterion)

Provide the mergers sorted by rank descending.

Specified by:
  `getMergersByRankDescending` in interface `IMerger.Registry2`
Parameters:
  `diff` - The diff
  `criterion` - The merge criterion, can be `null`
Returns:
  the registered mergers valid for the given diff and criterion, sorted by rank descending.
Since:
  3.3

#### getMergers

    public Collection<IMerger> getMergers​(Diff target)

Returns the list of the candidate mergers for the given difference. If the given difference is null, return all known mergers.

Specified by:
  `getMergers` in interface `IMerger.Registry`
Parameters:
  `target` - The given difference.
Returns:
  The list of the found mergers.
See Also:
  `IMerger.Registry.getMergers(org.eclipse.emf.compare.Diff)`