public interface IDiffProcessor
IDiffProcessor
is meant to be used in order to react to the detection of differences by the diff
engine.
The default implementation of a Diff engine only detects the changes and sends them over to its
IDiffProcessor
. It will then be up to the diff processor to create a
Diff
and attach it to the provided Match
, simply react to the
notification... or ignore it altogether.
DiffBuilder
, a default implementation of this interface, can be subclassed instead.
DiffBuilder
Modifier and Type | Method and Description |
---|---|
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 referenceChange(Match match, EReference reference, EObject value, DifferenceKind kind, DifferenceSource source)
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.void attributeChange(Match match, EAttribute attribute, Object value, DifferenceKind kind, DifferenceSource source)
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.void featureMapChange(Match match, EAttribute attribute, Object value, DifferenceKind kind, DifferenceSource source)
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.void resourceAttachmentChange(Match match, String uri, DifferenceKind kind, DifferenceSource source)
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.
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.