public class ConflictSuppressor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ConflictSuppressor.ApplicationCounter
Helper class to count number of application of delta to model
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COUNTER_PROPERTY
This property holds number of application of the delta to model
|
protected Delta |
d1 |
protected Delta |
d2 |
static java.lang.String |
DETAILS_PROPERTY
Custom property for
Conflict to hold details about conflict. |
static java.lang.String |
EOBJECT_COMPARATOR
This property holds information about EObjectComparator that should be used to compare objects
of deltas
|
Constructor and Description |
---|
ConflictSuppressor(Delta d1,
Delta d2) |
Modifier and Type | Method and Description |
---|---|
protected EObjectComparator |
createComparator() |
protected void |
doSuppress() |
java.lang.Object |
getDiffDetails()
Returns object containing additional details about difference.
|
protected static org.eclipse.emf.ecore.EObject[] |
getEObjects(java.lang.Object... args)
Tries to convert given list of objects to array of EObjects of the same size
If there are non-EObjects in the list then null will be returned
|
protected boolean |
isApplied() |
protected static boolean |
isNull(java.lang.Object... objs)
Return true if there is at least one null object in the list of arguments
|
protected boolean |
matchChangeDeltaValues(java.lang.Object v1,
java.lang.Object v2)
Match objects representing new or delete values of 'Change' deltas
This method takes into account proxy EObjects
NOTE: Currently two values are considered equal only if 'equal' method returns true
TODO: We should consider situation when values are different EObjects with the same content
|
protected boolean |
matchLocations(Delta d1,
Delta d2,
org.eclipse.emf.ecore.EObject[] eObjects)
Match delta locations.
|
protected boolean |
matchLocations(Location l1,
Location l2,
boolean skipIndex)
Matches two locations
|
protected boolean |
matchObjects(java.lang.Object o1,
java.lang.Object o2)
Calls 'equals' on objects, handles null objects
|
protected boolean |
matchStrings(java.lang.String s1,
java.lang.String s2) |
protected boolean |
matchType(Delta d1,
Delta d2)
Match delta types
|
protected void |
setDiffDetails(java.lang.Object details) |
protected void |
setResult(boolean result) |
protected void |
setResult(EObjectComparator.Result r) |
boolean |
suppress()
Tries to suppress conflict.
|
static boolean |
useOldConflictSuppression()
Check if old conflict suppression is enabled
|
public static final java.lang.String DETAILS_PROPERTY
Conflict
to hold details about conflict.
This property is set when conflict suppressor detects difference between deltas and
collects additional information about conflict (e.g. affected EObjects have different content)public static final java.lang.String COUNTER_PROPERTY
public static final java.lang.String EOBJECT_COMPARATOR
protected final Delta d1
protected final Delta d2
public final boolean suppress()
public final java.lang.Object getDiffDetails()
protected void setDiffDetails(java.lang.Object details)
protected final void setResult(boolean result)
protected void setResult(EObjectComparator.Result r)
protected final boolean isApplied()
protected void doSuppress()
protected EObjectComparator createComparator()
protected boolean matchChangeDeltaValues(java.lang.Object v1, java.lang.Object v2)
v1
- v2
- protected boolean matchLocations(Delta d1, Delta d2, org.eclipse.emf.ecore.EObject[] eObjects)
d1
- d2
- eObjects
- - array of affected objects of deltas or nullprotected boolean matchLocations(Location l1, Location l2, boolean skipIndex)
l1
- l2
- skipIndex
- - disable/enable matching of index in the feature when comparing EObjectLocationsprotected boolean matchType(Delta d1, Delta d2)
d1
- d2
- protected boolean matchStrings(java.lang.String s1, java.lang.String s2)
protected static org.eclipse.emf.ecore.EObject[] getEObjects(java.lang.Object... args)
args
- protected boolean matchObjects(java.lang.Object o1, java.lang.Object o2)
o1
- o2
- protected static boolean isNull(java.lang.Object... objs)
objs
- public static boolean useOldConflictSuppression()