Class MdObjectComparisonParticipant
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
-
- com._1c.g5.v8.dt.md.compare.participant.AbstractMdAwareComparisonParticipant
-
- com._1c.g5.v8.dt.md.compare.participant.MdObjectComparisonParticipant
-
- All Implemented Interfaces:
IComparisonParticipant
,ISymlinkTranslationContributor
public class MdObjectComparisonParticipant extends AbstractMdAwareComparisonParticipant implements ISymlinkTranslationContributor
The MD object comparison participant.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
MdObjectComparisonParticipant.MdObjectClassFeatures
-
Nested classes/interfaces inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
AbstractEmfBasedComparisonParticipant.BmIdsWrapper, AbstractEmfBasedComparisonParticipant.EObjectClassFeatures
-
-
Field Summary
Fields Modifier and Type Field Description protected IModelObjectFactory
modelFactory
-
Fields inherited from class com._1c.g5.v8.dt.md.compare.participant.AbstractMdAwareComparisonParticipant
bmModelManager, INVALID_SYMLINK_PATTERN, LOGGING, qualifiedNameProvider, SYMLINK_SEPARATOR
-
Fields inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
LOG_TYPES, pictureManager, projectFileSystemSupportProvider, qualifiedNameFilePathConverter, scopeProvider, topObjectFqnGenerator
-
-
Constructor Summary
Constructors Constructor Description MdObjectComparisonParticipant()
Constructs the participant.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
ableToBreakCorrespondence(ComparisonTreeNode node)
Checks if this participant is able to break a correspondence stored in the specified node.ComparisonTreeNode
addNewTopObjectToComparison(IComparisonSession comparisonSession, String mainSymlink, org.eclipse.emf.ecore.EClass eClass)
Adds a new node to the comparison for the top object.ComparisonTreeNode
adopt(IComparisonSession session, ExternalPropertyComparisonNode node)
Converts, if possible, the given external property node into a node supported by the participant instance.protected org.eclipse.emf.ecore.EClass
adoptEClassToImport(org.eclipse.emf.ecore.EClass otherEClass, IComparisonSession session)
Converts, if possible, the other sideEClass
into a main supported by the main side to import object.org.eclipse.emf.ecore.EStructuralFeature
adoptMainSideFeature(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature, IComparisonSession session)
Converts, if possible, the main side feature into a other supported by the other side object.protected boolean
areDifferentEClassObjectsMergeable(org.eclipse.emf.ecore.EObject main, org.eclipse.emf.ecore.EObject other, ComparisonContext comparisonContext)
boolean
breakCorrespondence(ComparisonContext comparisonContext, ComparisonTreeNode node)
Asks the participant to break correspondence represented by the specified model node.boolean
breakMainSideCorrespondence(IComparisonSession comparisonSession, ComparisonTreeNode node)
Asks the participant to break main side correspondence represented by the specified model node.protected ComparisonFlags
calculateCompareValueFlags(AbstractComparedEmfObjects<?> comparingObject, ComparedObjects<Object> values, ComparedFeatures<?> comparedFeatures, ComparisonContext comparisonContext)
boolean
combineOneSideNodes(ComparisonContext comparisonContext, ComparisonTreeNode mainNode, ComparisonTreeNode otherNode, List<Long> newNodeIds)
Asks the participant to combine the specified two one-side nodes.List<Long>
compare(ComparisonTreeNode node, ComparisonContext comparisonContext, org.eclipse.core.runtime.IProgressMonitor monitor)
Compares objects contained in the specified model node and returns a list of child nodes to be compared.protected ComparisonFlags
compareEmfObject(BmTopComparisonNode topParent, LazyNodeProvider nodeProvider, AbstractComparedEmfObjects<?> comparingObject, AbstractEmfBasedComparisonParticipant.BmIdsWrapper childBmIds, ComparisonContext comparisonContext)
protected MdObjectComparisonParticipant.MdObjectClassFeatures
createClassFeaturesInstance()
Creates new instance ofAbstractEmfBasedComparisonParticipant.EObjectClassFeatures
class.protected org.eclipse.emf.ecore.EObject
createImportedEObject(org.eclipse.emf.ecore.EObject otherObject, IMergeSession mergeSession)
MergeContext
createMergeContext(ComparisonTreeNode node, IMergeSession mergeSession, ComparisonContext comparisonContext)
Creates merge context for an upcoming merge operation.protected void
fillOrderRules(MergeSettingsContainer container, org.eclipse.emf.ecore.EClass nodeEClass, ComparisonTreeNode node)
Fills order rules from container into the nodeprotected MdObjectComparisonParticipant.MdObjectClassFeatures
getClassFeatures(AbstractComparedEmfObjects<?> comparingObject, IComparisonSession session, boolean alwaysRecalculate)
Returns lists of features of the given EObjects being compared.protected MdObjectComparisonParticipant.MdObjectClassFeatures
getClassFeatures(org.eclipse.emf.ecore.EObject object, IComparisonSession session)
Returns lists of features of the given EObject.protected IEmfObjectMatcher
getCustomMatcher(BmTopComparisonNode topNode, org.eclipse.emf.ecore.EReference reference, ComparisonContext comparisonContext)
Returns a custom matcher for the specified reference.MergeRule
getDefaultMergeRule(ComparisonTreeNode node, IComparisonSession session)
Returns the default merge rule for the given node.Boolean
getDefaultMustBeMerged(ComparisonTreeNode node, IComparisonSession session)
Returns the default must be merged value for the given node.protected List<org.eclipse.emf.ecore.EReference>
getFeaturesToCompareForOneSideObject(AbstractComparedEmfObjects<?> comparingObjects)
Returns list of features to be always compared for one-side nodes.IMatchingSymlinks
getMatchingSymlinks(ComparisonTreeNode node, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference reference, ComparisonSide sourceSide, String symlink, ComparisonContext comparisonContext, IMergeSession mergeSession)
Returns a "matching symlinks" object for the specified symbolic link in the specified context.IMatchingSymlinks
getMatchingSymlinksToTopObject(ComparisonContext comparisonContext, String symlink, ComparisonSide side, IMergeSession mergeSession)
Returns matched symlinks to the top object with the given symlink on a given comparison side.org.eclipse.emf.ecore.EPackage
getModelPackage()
Get EMF model package.protected Path
getPictureResourcePath(PictureDef picture, IComparisonDataSource dataSource)
Returns the picture resource path for the given data source.List<ComparisonTreeNode>
getPotentialCorrespondingNodes(ComparisonTreeNode node, ComparisonSide sourceSide)
Returns a list of candidate nodes for setting as corresponding to the specified node.List<PotentialMergeProblemDescription>
getPotentialMergeProblemsDescriptions(ComparisonTreeNode node, ComparisonContext comparisonContext)
Returns human-readable descriptions of potential merge problems if the the specified node is merged.protected org.eclipse.emf.ecore.EObject
importEmfObject(MergeContext context, ComparisonTreeNode mergingNode, org.eclipse.emf.ecore.EObject otherObject)
boolean
isCandidateForPotentialMergeProblems(ComparisonTreeNode node, IComparisonSession session)
Tells whether the given node may break the configuration if it is merged.boolean
isExcludedFromComparison(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects, IComparisonSession session)
Checks whether the feature must be excluded from the comparison.protected boolean
isFeatureWithCustomMerge(org.eclipse.emf.ecore.EStructuralFeature feature)
protected boolean
isSupported(ComparisonTreeNode node)
protected boolean
isUnmatchableContainment(org.eclipse.emf.ecore.EReference reference)
Checks whether the specified containment feature cannot be matched by an identity-based matcher.protected Collection<MatchedEmfObjects>
matchEmfObjects(BmTopComparisonNode topNode, AbstractComparedEmfObjects<?> comparingObject, ComparedFeatures<org.eclipse.emf.ecore.EReference> comparedReferences, ComparisonContext comparisonContext, ComparisonFlags parentFlags)
org.eclipse.core.runtime.IStatus
merge(ComparisonTreeNode node, MergeContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
Merges the differences in the specified node in the specified merge session.protected void
mergeEmfProperties(MergeContext context, ComparisonTreeNode mergingNode, AbstractComparedEmfObjects<?> mergingObjects)
protected void
mergeOtherContainment(MergeContext context, ComparisonTreeNode mergingNode, AbstractComparedEmfObjects<?> mergingObjects, ComparedFeatures<org.eclipse.emf.ecore.EReference> comparedReferences)
void
onChildrenMerged(ComparisonTreeNode topNode, MergeContext context)
Called when the child nodes of the specified top node have been merged.List<IRenameOnMergeOperation>
prepareRenameOperations(IMergeSession mergeSession, ComparisonContext context)
Gets a list of rename operations prepared by this participant.protected void
removeObjectFromContainerOnMerge(MergeContext context, org.eclipse.emf.ecore.EObject mainContainer, org.eclipse.emf.ecore.EReference mainReference, org.eclipse.emf.ecore.EObject mainObject)
Removes the given object from the container on the MAIN side during the merge phase.protected void
removeObjectFromListOnMerge(MergeContext context, org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> mainList, org.eclipse.emf.ecore.EObject mainObject)
Removes the given object from the given list on the MAIN side during the merge phase.ComparedMdObjects
retrieveComparedObjects(ComparisonContext comparisonContext, ComparisonTreeNode node)
Returns a comparedEObject
s triple for the specified model node.boolean
supports(ComparisonTreeNode node)
Indicates whether the participant supports comparison and merging of the specified node.boolean
supportsPrioritizedMerging(ComparisonTreeNode node, IComparisonSession session)
Tells whether the given node supports prioritized merging.boolean
updateComparison(ComparisonContext comparisonContext, ComparisonTreeNode node, List<Long> newNodeIds)
Updates comparison for the given result node.void
validateMerge(IMergeSession mergeSession, ComparisonContext comparisonContext, ComparisonTreeNode node, List<MergeValidationProblem> validationProblems)
Validates the process of merge of the specified model node.-
Methods inherited from class com._1c.g5.v8.dt.md.compare.participant.AbstractMdAwareComparisonParticipant
extractTopLink, getExternalPropertyQualifyingType, getExternalPropertySymlink, hasConflictChangesInCollection, isBmIdMayChangeOnMerge, isFeatureTakenFromPreferredSide
-
Methods inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
adaptOtherReference, assertEClassesMatch, checkReferenceListReordering, clear, compareEmfContainment, compareOneSideObject, comparePictureResource, compareReference, compareValue, createRelatedFeature, createResourceForImportedObject, deletePictureResourceFile, disableContainmentListOrderChangeCheck, findChildNodeByFeature, findChildNodeByMatchedId, getFeatureTypeDescription, getForcedDDRebuildScope, getMultiReferenceSymlinks, getMultiReferenceValueSymlink, getOtherSideFeature, getQualifiedName, getSerializedMergeSettings, getSingleReferenceSymlink, getTopNode, importPictureResourceFile, mergeEmfReference, mergeUsingExternalTool, needCreateOneSideNode, restoreCustomSettings, supportsCustomMerging, supportsMergingUsingExternalTool, translateReferencesInImportedObject, updatePictureResourceFile, wrapOtherReference
-
-
-
-
Field Detail
-
modelFactory
@Inject protected IModelObjectFactory modelFactory
-
-
Method Detail
-
adopt
public ComparisonTreeNode adopt(IComparisonSession session, ExternalPropertyComparisonNode node)
Description copied from interface:IComparisonParticipant
Converts, if possible, the given external property node into a node supported by the participant instance.- Specified by:
adopt
in interfaceIComparisonParticipant
- Parameters:
session
- the comparison session, notnull
node
- the node to adopt- Returns:
- the node adopted or
null
if adopting is not possible
-
supports
public boolean supports(ComparisonTreeNode node)
Description copied from interface:IComparisonParticipant
Indicates whether the participant supports comparison and merging of the specified node.- Specified by:
supports
in interfaceIComparisonParticipant
- Parameters:
node
- the node, notnull
- Returns:
true
if the participant supports comparison and merging,false
otherwise
-
getModelPackage
public org.eclipse.emf.ecore.EPackage getModelPackage()
Description copied from interface:IComparisonParticipant
Get EMF model package.- Specified by:
getModelPackage
in interfaceIComparisonParticipant
- Returns:
- the EMF model packge. Never code
null
.
-
compare
public List<Long> compare(ComparisonTreeNode node, ComparisonContext comparisonContext, org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface:IComparisonParticipant
Compares objects contained in the specified model node and returns a list of child nodes to be compared.- Specified by:
compare
in interfaceIComparisonParticipant
- Parameters:
node
- the node, notnull
comparisonContext
- the comparison context, notnull
monitor
- the progress monitor, can benull
. The clients are not supposed to report work to the monitor, except for the top object matching phase- Returns:
- a list of model node identifiers, never
null
-
retrieveComparedObjects
public ComparedMdObjects retrieveComparedObjects(ComparisonContext comparisonContext, ComparisonTreeNode node)
Description copied from interface:IComparisonParticipant
Returns a comparedEObject
s triple for the specified model node.- Specified by:
retrieveComparedObjects
in interfaceIComparisonParticipant
- Parameters:
comparisonContext
- the comparison context, notnull
node
- the model node, cannot benull
- Returns:
- the compared objects triple, never
null
-
validateMerge
public void validateMerge(IMergeSession mergeSession, ComparisonContext comparisonContext, ComparisonTreeNode node, List<MergeValidationProblem> validationProblems)
Description copied from interface:IComparisonParticipant
Validates the process of merge of the specified model node.- Specified by:
validateMerge
in interfaceIComparisonParticipant
- Parameters:
mergeSession
- the merge session, notnull
comparisonContext
- the comparison context, notnull
node
- the model nodevalidationProblems
- the list of collected validation problems to add new problem to
-
createMergeContext
public MergeContext createMergeContext(ComparisonTreeNode node, IMergeSession mergeSession, ComparisonContext comparisonContext)
Description copied from interface:IComparisonParticipant
Creates merge context for an upcoming merge operation.- Specified by:
createMergeContext
in interfaceIComparisonParticipant
- Parameters:
node
- the node, notnull
mergeSession
- the current merge session, notnull
comparisonContext
- the comparison context, notnull
- Returns:
-
merge
public org.eclipse.core.runtime.IStatus merge(ComparisonTreeNode node, MergeContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface:IComparisonParticipant
Merges the differences in the specified node in the specified merge session. This may include deletion of the main object if the other object is absent, or, conversely, import ("copying") of the other object if the main object is absent.- Specified by:
merge
in interfaceIComparisonParticipant
- Parameters:
node
- the node, notnull
context
- the current merge context, notnull
monitor
- the progress monitor, notnull
- Returns:
- the result of the merge operation
-
onChildrenMerged
public void onChildrenMerged(ComparisonTreeNode topNode, MergeContext context)
Description copied from interface:IComparisonParticipant
Called when the child nodes of the specified top node have been merged.- Specified by:
onChildrenMerged
in interfaceIComparisonParticipant
- Overrides:
onChildrenMerged
in classAbstractEmfBasedComparisonParticipant
- Parameters:
topNode
- the top node, notnull
context
- Current merge operation context, notnull
-
getPotentialCorrespondingNodes
public List<ComparisonTreeNode> getPotentialCorrespondingNodes(ComparisonTreeNode node, ComparisonSide sourceSide)
Description copied from interface:IComparisonParticipant
Returns a list of candidate nodes for setting as corresponding to the specified node.- Specified by:
getPotentialCorrespondingNodes
in interfaceIComparisonParticipant
- Parameters:
node
- the comparison result node to find potential correspondences for, notnull
sourceSide
- the source side of the correspondence, notnull
- Returns:
- a list of comparison result nodes or
null
if this kind of nodes is not supported by this participant
-
breakCorrespondence
public boolean breakCorrespondence(ComparisonContext comparisonContext, ComparisonTreeNode node)
Description copied from interface:IComparisonParticipant
Asks the participant to break correspondence represented by the specified model node. The participant may refuse to break correspondence if it does not support this kind of node.- Specified by:
breakCorrespondence
in interfaceIComparisonParticipant
- Parameters:
comparisonContext
- the comparison context, notnull
node
- the node with the correspondence to break, notnull
- Returns:
true
if the participant supported the operation, andfalse
otherwise
-
updateComparison
public boolean updateComparison(ComparisonContext comparisonContext, ComparisonTreeNode node, List<Long> newNodeIds)
Description copied from interface:IComparisonParticipant
Updates comparison for the given result node. Participants could introduce their own specific logic for managing internal states on comparison update.- Specified by:
updateComparison
in interfaceIComparisonParticipant
- Parameters:
comparisonContext
- the comparison context, notnull
node
- the node to update comparison for, notnull
newNodeIds
- the list of created new node Ids to fill, notnull
- Returns:
true
if the participant supported the operation, andfalse
otherwise
-
addNewTopObjectToComparison
public ComparisonTreeNode addNewTopObjectToComparison(IComparisonSession comparisonSession, String mainSymlink, org.eclipse.emf.ecore.EClass eClass)
Description copied from interface:IComparisonParticipant
Adds a new node to the comparison for the top object. Participants could introduce their own specific logic for managing internal states on comparison update.- Specified by:
addNewTopObjectToComparison
in interfaceIComparisonParticipant
- Parameters:
comparisonSession
- the comparison session hosting the model, notnull
mainSymlink
- the symlink for the top object to add, notnull
eClass
- of the object ot add, notnull
- Returns:
- The created result node for the object if supports.
null
otherwise.
-
combineOneSideNodes
public boolean combineOneSideNodes(ComparisonContext comparisonContext, ComparisonTreeNode mainNode, ComparisonTreeNode otherNode, List<Long> newNodeIds)
Description copied from interface:IComparisonParticipant
Asks the participant to combine the specified two one-side nodes. The participant may refuse to do it if it does not support this kind of nodes. The participant fills array of new node Ids created while combining the specified nodes. These node Ids must be scheduled for comparison in the external code.- Specified by:
combineOneSideNodes
in interfaceIComparisonParticipant
- Parameters:
comparisonContext
- the comparison context, notnull
mainNode
- the one-side MAIN node to be combined, notnull
otherNode
- the one-side OTHER node to be combined, notnull
newNodeIds
- the list of new node Ids to fill, notnull
- Returns:
true
if the participant supported the operation, andfalse
otherwise
-
ableToBreakCorrespondence
public boolean ableToBreakCorrespondence(ComparisonTreeNode node)
Description copied from interface:IComparisonParticipant
Checks if this participant is able to break a correspondence stored in the specified node.- Specified by:
ableToBreakCorrespondence
in interfaceIComparisonParticipant
- Parameters:
node
- the node to check if its correspondence can be broken by this participant, notnull
- Returns:
true
if this participant is able to break the correspondence, andfalse
otherwise
-
getMatchingSymlinks
public IMatchingSymlinks getMatchingSymlinks(ComparisonTreeNode node, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference reference, ComparisonSide sourceSide, String symlink, ComparisonContext comparisonContext, IMergeSession mergeSession)
Description copied from interface:ISymlinkTranslationContributor
Returns a "matching symlinks" object for the specified symbolic link in the specified context.- Specified by:
getMatchingSymlinks
in interfaceISymlinkTranslationContributor
- Parameters:
node
- the comparison result node hosting theeObject
- the referencing EObjectreference
- the referencesourceSide
- the side of the symbolic linksymlink
- the symbolic link for which to get matching symlinksmergeSession
- the merge session. If notnull
, the resulting matching symlinks must contain an accordingly translated other symlink in case when the other object will be imported during the merge session- Returns:
- a matching symbolic links object or
null
if the context is not supported by the contributor
-
getMatchingSymlinksToTopObject
public IMatchingSymlinks getMatchingSymlinksToTopObject(ComparisonContext comparisonContext, String symlink, ComparisonSide side, IMergeSession mergeSession)
Description copied from interface:ISymlinkTranslationContributor
Returns matched symlinks to the top object with the given symlink on a given comparison side.- Specified by:
getMatchingSymlinksToTopObject
in interfaceISymlinkTranslationContributor
- Parameters:
comparisonContext
- the comparison context, cannot benull
symlink
- the top object symlink to be matched, cannot benull
side
- the comparison side where the top object lies, cannot benull
mergeSession
- the merge session, can benull
if no merge process run- Returns:
- the triple of matched symlinks or
null
if no matched symlinks found
-
prepareRenameOperations
public List<IRenameOnMergeOperation> prepareRenameOperations(IMergeSession mergeSession, ComparisonContext context)
Description copied from interface:IComparisonParticipant
Gets a list of rename operations prepared by this participant.- Specified by:
prepareRenameOperations
in interfaceIComparisonParticipant
- Overrides:
prepareRenameOperations
in classAbstractEmfBasedComparisonParticipant
- Parameters:
mergeSession
- the merge session, notnull
context
- the comparison context, notnull
- Returns:
- the list of rename operations, never
null
-
supportsPrioritizedMerging
public boolean supportsPrioritizedMerging(ComparisonTreeNode node, IComparisonSession session)
Description copied from interface:IComparisonParticipant
Tells whether the given node supports prioritized merging.- Specified by:
supportsPrioritizedMerging
in interfaceIComparisonParticipant
- Overrides:
supportsPrioritizedMerging
in classAbstractMdAwareComparisonParticipant
- Parameters:
node
- the node to check, cannot benull
session
- the comparison session, cannot benull
- Returns:
true
if the node supports prioritized merging,false
otherwise
-
breakMainSideCorrespondence
public boolean breakMainSideCorrespondence(IComparisonSession comparisonSession, ComparisonTreeNode node)
Description copied from interface:IComparisonParticipant
Asks the participant to break main side correspondence represented by the specified model node. The participant may refuse to break main side correspondence if it does not support this kind of node.- Specified by:
breakMainSideCorrespondence
in interfaceIComparisonParticipant
- Parameters:
comparisonSession
- the comparison session hosting the model, can not benull
node
- the node with the correspondence to break, can not benull
- Returns:
true
if the participant supported the operation andfalse
otherwise
-
isExcludedFromComparison
public boolean isExcludedFromComparison(org.eclipse.emf.ecore.EStructuralFeature feature, AbstractComparedEmfObjects<?> comparedContextObjects, IComparisonSession session)
Description copied from interface:IComparisonParticipant
Checks whether the feature must be excluded from the comparison.- Specified by:
isExcludedFromComparison
in interfaceIComparisonParticipant
- Overrides:
isExcludedFromComparison
in classAbstractEmfBasedComparisonParticipant
- Parameters:
feature
- the feature to check, cannot benull
comparedContextObjects
- the triple of compared objects, cannot benull
session
- the comparison session, cannot benull
- Returns:
true
if the feature must be excluded,false
otherwise
-
getDefaultMergeRule
public MergeRule getDefaultMergeRule(ComparisonTreeNode node, IComparisonSession session)
Description copied from interface:IComparisonParticipant
Returns the default merge rule for the given node.- Specified by:
getDefaultMergeRule
in interfaceIComparisonParticipant
- Parameters:
node
- the node to get default merge rule for, can not benull
session
- the comparison session, can not benull
- Returns:
- the default merge rule or
null
if it wasn't specified
-
adoptMainSideFeature
public org.eclipse.emf.ecore.EStructuralFeature adoptMainSideFeature(org.eclipse.emf.ecore.EStructuralFeature mainSideFeature, IComparisonSession session)
Description copied from interface:IComparisonParticipant
Converts, if possible, the main side feature into a other supported by the other side object.- Specified by:
adoptMainSideFeature
in interfaceIComparisonParticipant
- Overrides:
adoptMainSideFeature
in classAbstractEmfBasedComparisonParticipant
- Parameters:
mainSideFeature
- the main side feature to convert, cannot benull
session
- the comparison session, cannot benull
- Returns:
- the converted feature applicable for other side object or
null
-
getDefaultMustBeMerged
public Boolean getDefaultMustBeMerged(ComparisonTreeNode node, IComparisonSession session)
Description copied from interface:IComparisonParticipant
Returns the default must be merged value for the given node.- Specified by:
getDefaultMustBeMerged
in interfaceIComparisonParticipant
- Parameters:
node
- the node to get default must be merged value for, can not benull
session
- the comparison session, can not benull
- Returns:
- the default must be merged value or
null
if it wasn't specified
-
isCandidateForPotentialMergeProblems
public boolean isCandidateForPotentialMergeProblems(ComparisonTreeNode node, IComparisonSession session)
Description copied from interface:IComparisonParticipant
Tells whether the given node may break the configuration if it is merged.- Specified by:
isCandidateForPotentialMergeProblems
in interfaceIComparisonParticipant
- Overrides:
isCandidateForPotentialMergeProblems
in classAbstractEmfBasedComparisonParticipant
- Parameters:
node
- the node to check, cannot benull
session
- the comparison session, cannot benull
- Returns:
true
if the node may break the configuration,false
otherwise
-
getPotentialMergeProblemsDescriptions
public List<PotentialMergeProblemDescription> getPotentialMergeProblemsDescriptions(ComparisonTreeNode node, ComparisonContext comparisonContext)
Description copied from interface:IComparisonParticipant
Returns human-readable descriptions of potential merge problems if the the specified node is merged.- Specified by:
getPotentialMergeProblemsDescriptions
in interfaceIComparisonParticipant
- Overrides:
getPotentialMergeProblemsDescriptions
in classAbstractEmfBasedComparisonParticipant
- Parameters:
node
- the node to get merge problems descriptions for, cannot benull
comparisonContext
- the comparison context, cannot benull
- Returns:
- the list of descriptions, never
null
, can be empty if the node doesn't bring any merge problems
-
fillOrderRules
protected void fillOrderRules(MergeSettingsContainer container, org.eclipse.emf.ecore.EClass nodeEClass, ComparisonTreeNode node)
Description copied from class:AbstractEmfBasedComparisonParticipant
Fills order rules from container into the node- Overrides:
fillOrderRules
in classAbstractEmfBasedComparisonParticipant
- Parameters:
container
- merge settings container, cannot benull
nodeEClass
- corresponding nodeEClass
, can benull
node
- node to fill order rules, cannot benull
-
getCustomMatcher
protected IEmfObjectMatcher getCustomMatcher(BmTopComparisonNode topNode, org.eclipse.emf.ecore.EReference reference, ComparisonContext comparisonContext)
Description copied from class:AbstractEmfBasedComparisonParticipant
Returns a custom matcher for the specified reference.- Overrides:
getCustomMatcher
in classAbstractMdAwareComparisonParticipant
- Parameters:
topNode
- the top nodereference
- the reference to get a custom matcher forcomparisonContext
- the current comparison context, cannot benull
- Returns:
- a custom matcher or
null
if no custom matcher can be found
-
createImportedEObject
protected org.eclipse.emf.ecore.EObject createImportedEObject(org.eclipse.emf.ecore.EObject otherObject, IMergeSession mergeSession)
- Specified by:
createImportedEObject
in classAbstractEmfBasedComparisonParticipant
-
isFeatureWithCustomMerge
protected boolean isFeatureWithCustomMerge(org.eclipse.emf.ecore.EStructuralFeature feature)
- Specified by:
isFeatureWithCustomMerge
in classAbstractEmfBasedComparisonParticipant
-
isSupported
protected boolean isSupported(ComparisonTreeNode node)
- Specified by:
isSupported
in classAbstractEmfBasedComparisonParticipant
-
calculateCompareValueFlags
protected ComparisonFlags calculateCompareValueFlags(AbstractComparedEmfObjects<?> comparingObject, ComparedObjects<Object> values, ComparedFeatures<?> comparedFeatures, ComparisonContext comparisonContext)
- Overrides:
calculateCompareValueFlags
in classAbstractEmfBasedComparisonParticipant
-
compareEmfObject
protected ComparisonFlags compareEmfObject(BmTopComparisonNode topParent, LazyNodeProvider nodeProvider, AbstractComparedEmfObjects<?> comparingObject, AbstractEmfBasedComparisonParticipant.BmIdsWrapper childBmIds, ComparisonContext comparisonContext)
- Overrides:
compareEmfObject
in classAbstractMdAwareComparisonParticipant
-
mergeOtherContainment
protected void mergeOtherContainment(MergeContext context, ComparisonTreeNode mergingNode, AbstractComparedEmfObjects<?> mergingObjects, ComparedFeatures<org.eclipse.emf.ecore.EReference> comparedReferences)
- Overrides:
mergeOtherContainment
in classAbstractEmfBasedComparisonParticipant
-
areDifferentEClassObjectsMergeable
protected boolean areDifferentEClassObjectsMergeable(org.eclipse.emf.ecore.EObject main, org.eclipse.emf.ecore.EObject other, ComparisonContext comparisonContext)
- Overrides:
areDifferentEClassObjectsMergeable
in classAbstractMdAwareComparisonParticipant
-
matchEmfObjects
protected Collection<MatchedEmfObjects> matchEmfObjects(BmTopComparisonNode topNode, AbstractComparedEmfObjects<?> comparingObject, ComparedFeatures<org.eclipse.emf.ecore.EReference> comparedReferences, ComparisonContext comparisonContext, ComparisonFlags parentFlags)
- Overrides:
matchEmfObjects
in classAbstractEmfBasedComparisonParticipant
-
createClassFeaturesInstance
protected MdObjectComparisonParticipant.MdObjectClassFeatures createClassFeaturesInstance()
Description copied from class:AbstractEmfBasedComparisonParticipant
Creates new instance ofAbstractEmfBasedComparisonParticipant.EObjectClassFeatures
class. Override in descendants if the class is to be extended.- Overrides:
createClassFeaturesInstance
in classAbstractEmfBasedComparisonParticipant
- Returns:
- the instance of
AbstractEmfBasedComparisonParticipant.EObjectClassFeatures
class, nevernull
-
getClassFeatures
protected MdObjectComparisonParticipant.MdObjectClassFeatures getClassFeatures(org.eclipse.emf.ecore.EObject object, IComparisonSession session)
Description copied from class:AbstractEmfBasedComparisonParticipant
Returns lists of features of the given EObject.- Overrides:
getClassFeatures
in classAbstractEmfBasedComparisonParticipant
- Parameters:
object
- the object to get class features for, cannot benull
session
- the comparison session, cannot benull
- Returns:
- the filled
AbstractEmfBasedComparisonParticipant.EObjectClassFeatures
instance, nevernull
-
getClassFeatures
protected MdObjectComparisonParticipant.MdObjectClassFeatures getClassFeatures(AbstractComparedEmfObjects<?> comparingObject, IComparisonSession session, boolean alwaysRecalculate)
Description copied from class:AbstractEmfBasedComparisonParticipant
Returns lists of features of the given EObjects being compared.- Overrides:
getClassFeatures
in classAbstractEmfBasedComparisonParticipant
- Parameters:
comparingObject
- the comparing object, cannot benull
session
- the comparison session, cannot benull
alwaysRecalculate
- tells whether EObject class features should be always recalculated- Returns:
- the filled
AbstractEmfBasedComparisonParticipant.EObjectClassFeatures
instance, nevernull
-
getFeaturesToCompareForOneSideObject
protected List<org.eclipse.emf.ecore.EReference> getFeaturesToCompareForOneSideObject(AbstractComparedEmfObjects<?> comparingObjects)
Description copied from class:AbstractEmfBasedComparisonParticipant
Returns list of features to be always compared for one-side nodes.- Overrides:
getFeaturesToCompareForOneSideObject
in classAbstractEmfBasedComparisonParticipant
- Parameters:
comparingObjects
- the triple of objects being compared, cannot benull
- Returns:
- the list of feature to be compared for one-side nodes, never
null
-
importEmfObject
protected org.eclipse.emf.ecore.EObject importEmfObject(MergeContext context, ComparisonTreeNode mergingNode, org.eclipse.emf.ecore.EObject otherObject)
- Overrides:
importEmfObject
in classAbstractEmfBasedComparisonParticipant
-
getPictureResourcePath
protected Path getPictureResourcePath(PictureDef picture, IComparisonDataSource dataSource)
Description copied from class:AbstractEmfBasedComparisonParticipant
Returns the picture resource path for the given data source. By default returnsnull
.- Overrides:
getPictureResourcePath
in classAbstractEmfBasedComparisonParticipant
- Parameters:
picture
- the picture to get resource path for, cannot benull
dataSource
- the comparison data source, cannot benull
- Returns:
- the picture resource path, may be
null
-
adoptEClassToImport
protected org.eclipse.emf.ecore.EClass adoptEClassToImport(org.eclipse.emf.ecore.EClass otherEClass, IComparisonSession session)
Description copied from class:AbstractEmfBasedComparisonParticipant
Converts, if possible, the other sideEClass
into a main supported by the main side to import object.- Overrides:
adoptEClassToImport
in classAbstractEmfBasedComparisonParticipant
- Parameters:
otherEClass
- the other sideEClass
to convert, cannot benull
session
- the comparison session, cannot benull
- Returns:
- the converted
EClass
, nevernull
-
isUnmatchableContainment
protected boolean isUnmatchableContainment(org.eclipse.emf.ecore.EReference reference)
Description copied from class:AbstractEmfBasedComparisonParticipant
Checks whether the specified containment feature cannot be matched by an identity-based matcher.- Overrides:
isUnmatchableContainment
in classAbstractEmfBasedComparisonParticipant
- Parameters:
reference
- the containment feature to check- Returns:
true
if the feature cannot be matched by an identity matcher
-
mergeEmfProperties
protected void mergeEmfProperties(MergeContext context, ComparisonTreeNode mergingNode, AbstractComparedEmfObjects<?> mergingObjects)
- Overrides:
mergeEmfProperties
in classAbstractEmfBasedComparisonParticipant
-
removeObjectFromListOnMerge
protected void removeObjectFromListOnMerge(MergeContext context, org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> mainList, org.eclipse.emf.ecore.EObject mainObject)
Description copied from class:AbstractEmfBasedComparisonParticipant
Removes the given object from the given list on the MAIN side during the merge phase. Override in descendants if need customized behavior on deletion.- Overrides:
removeObjectFromListOnMerge
in classAbstractEmfBasedComparisonParticipant
- Parameters:
context
- the merge context, cannot benull
mainList
- the list to remove the object from, cannot benull
mainObject
- the object to be removed, cannot benull
-
removeObjectFromContainerOnMerge
protected void removeObjectFromContainerOnMerge(MergeContext context, org.eclipse.emf.ecore.EObject mainContainer, org.eclipse.emf.ecore.EReference mainReference, org.eclipse.emf.ecore.EObject mainObject)
Description copied from class:AbstractEmfBasedComparisonParticipant
Removes the given object from the container on the MAIN side during the merge phase. Override in descendants if need customized behavior on deletion.- Overrides:
removeObjectFromContainerOnMerge
in classAbstractEmfBasedComparisonParticipant
- Parameters:
context
- the merge context, cannot benull
mainContainer
- the container to remove from, cannot benull
mainReference
- the reference to remove object by, cannot benull
mainObject
- the object to be removed, cannot benull
-
-