org.eclipse.emf.compare.diff

## Class DiffBuilder

- java.lang.Object
- - org.eclipse.emf.compare.diff.DiffBuilder

All Implemented Interfaces:
  IDiffProcessor

    public class DiffBuilder
    extends Object
    implements IDiffProcessor

This default implementation of an `IDiffProcessor` will build the necessary differences and attach them to the appropriate `Match`.

### Constructor Summary

Constructors
Constructor and Description
`DiffBuilder()`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `attributeChange(Match match, EAttribute attribute, Object value, DifferenceKind kind, DifferenceSource source)` This will be called whenever the diff engine detected a difference for a given attribute value.
`void` `featureMapChange(Match match, EAttribute attribute, Object value, DifferenceKind kind, DifferenceSource source)` This will be called whenever the diff engine detected a difference for a given attribute value.
`void` `referenceChange(Match match, EReference reference, EObject value, DifferenceKind kind, DifferenceSource source)` This will be called whenever the Diff engine detected a difference for a given reference value.
`void` `resourceAttachmentChange(Match match, String uri, DifferenceKind kind, DifferenceSource source)` This will be called whenever the diff engine detected the addition (or removal) of a root in a given Resource.
`void` `resourceLocationChange(MatchResource matchResource, String baseLocation, String changedLocation, DifferenceKind kind, DifferenceSource source)` Deprecated. `ResourceLocationChange`s have been replaced by `ResourceAttachmentChange`s of kind Move.

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

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

### Constructor Detail

#### DiffBuilder

    public DiffBuilder()

### Method Detail

#### referenceChange

    public void referenceChange(Match match,
                                EReference reference,
                                EObject value,
                                DifferenceKind kind,
                                DifferenceSource source)

This will be called whenever the Diff engine detected a difference for a given reference value.

Specified by:
  `referenceChange` in interface `IDiffProcessor`
Parameters:
  `match` - The match to which this difference should be attached.
  `reference` - The reference on which we detected a difference.
  `value` - The actual value for which we detected a difference.
  `kind` - Kind of the detected difference.
  `source` - Source of the detected difference. For two way comparisons, this will always be `DifferenceSource.LEFT`. Otherwise, this will indicate the side on which this difference has been detected.
See Also:
  `IDiffProcessor.referenceChange(org.eclipse.emf.compare.Match, org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject, org.eclipse.emf.compare.DifferenceKind, org.eclipse.emf.compare.DifferenceSource)`

#### attributeChange

    public void attributeChange(Match match,
                                EAttribute attribute,
                                Object value,
                                DifferenceKind kind,
                                DifferenceSource source)

This will be called whenever the diff engine detected a difference for a given attribute value.

Specified by:
  `attributeChange` in interface `IDiffProcessor`
Parameters:
  `match` - The match to which this difference should be attached.
  `attribute` - The attribute on which we detected a difference.
  `value` - The actual value for which we detected a difference.
  `kind` - Kind of the difference.
  `source` - Source of the difference. For two way comparisons, this will always be `DifferenceSource.LEFT`. Otherwise, this will indicate the side on which this difference has been detected.
See Also:
  `IDiffProcessor.attributeChange(org.eclipse.emf.compare.Match, org.eclipse.emf.ecore.EAttribute, java.lang.Object, org.eclipse.emf.compare.DifferenceKind, org.eclipse.emf.compare.DifferenceSource)`

#### featureMapChange

    public void featureMapChange(Match match,
                                 EAttribute attribute,
                                 Object value,
                                 DifferenceKind kind,
                                 DifferenceSource source)

This will be called whenever the diff engine detected a difference for a given attribute value.

Specified by:
  `featureMapChange` in interface `IDiffProcessor`
Parameters:
  `match` - The match to which this difference should be attached.
  `attribute` - The EFeatureMapEntry attribute on which we detected a difference.
  `value` - The actual FeatureMap.Entry value for which we detected a difference.
  `kind` - Kind of the difference.
  `source` - Source of the difference. For two way comparisons, this will always be `DifferenceSource.LEFT`. Otherwise, this will indicate the side on which this difference has been detected.
Since:
  3.2
See Also:
  `IDiffProcessor.featureMapChange(org.eclipse.emf.compare.Match, org.eclipse.emf.ecore.EAttribute, java.lang.Object, org.eclipse.emf.compare.DifferenceKind, org.eclipse.emf.compare.DifferenceSource)`

#### resourceAttachmentChange

    public void resourceAttachmentChange(Match match,
                                         String uri,
                                         DifferenceKind kind,
                                         DifferenceSource source)

This will be called whenever the diff engine detected the addition (or removal) of a root in a given Resource.

Specified by:
  `resourceAttachmentChange` in interface `IDiffProcessor`
Parameters:
  `match` - The match to which this difference should be attached.
  `uri` - The uri of the resource we attached this element to in case of an `DifferenceKind.ADD` , or the uri of the resource it was attached to in case of a `DifferenceKind.DELETE` difference.
  `kind` - Kind of this difference.
  `source` - Source of the difference. For two way comparisons, this will always be `DifferenceSource.LEFT`. Otherwise, this will indicate the side on which this difference has been detected.
See Also:
  `IDiffProcessor.resourceAttachmentChange(org.eclipse.emf.compare.Match, java.lang.String, org.eclipse.emf.compare.DifferenceKind, org.eclipse.emf.compare.DifferenceSource)`

#### resourceLocationChange

    @Deprecated
    public void resourceLocationChange(MatchResource matchResource,
                                                   String baseLocation,
                                                   String changedLocation,
                                                   DifferenceKind kind,
                                                   DifferenceSource source)

Deprecated. `ResourceLocationChange`s have been replaced by `ResourceAttachmentChange`s of kind Move.
This will be called whenever the diff engine detects the change of a Resource location.

Specified by:
  `resourceLocationChange` in interface `IDiffProcessor`
Parameters:
  `matchResource` - The matchResource to which this difference should be attached.
  `baseLocation` - The base location (left side in case of a two way comparison, origin or left side in case of a three way comparison).
  `changedLocation` - The change location (right side in case of a two way comparison, left or right side in case of a three way comparison).
  `kind` - Kind of this difference.
  `source` - Source of the difference. For two way comparisons, this will always be `DifferenceSource.LEFT`. Otherwise, this will indicate the side on which this difference has been detected.
See Also:
  `org.eclipse.emf.compare.diff.IDiffProcessor#resourceLocationChange(org.eclipse.emf.compare. MatchResource, java.lang.String, java.lang.String org.eclipse.emf.compare.DifferenceKind, org.eclipse.emf.compare.DifferenceSource)`