Class AbstractMdAwareComparisonParticipant
- java.lang.Object
-
- com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
-
- com._1c.g5.v8.dt.md.compare.participant.AbstractMdAwareComparisonParticipant
-
- All Implemented Interfaces:
IComparisonParticipant
public abstract class AbstractMdAwareComparisonParticipant extends AbstractEmfBasedComparisonParticipant
Abstract MD aware comparison participant.
-
-
Nested Class Summary
-
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 IBmModelManager
bmModelManager
protected static Pattern
INVALID_SYMLINK_PATTERN
protected static boolean
LOGGING
protected org.eclipse.xtext.naming.IQualifiedNameProvider
qualifiedNameProvider
protected static Character
SYMLINK_SEPARATOR
-
Fields inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
LOG_TYPES, pictureManager, projectFileSystemSupportProvider, qualifiedNameFilePathConverter, scopeProvider, topObjectFqnGenerator
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMdAwareComparisonParticipant()
Creates new participant instance with default comparison nodes factory.protected
AbstractMdAwareComparisonParticipant(ComparisonNodeFactory nodeFactory)
Creates new participant instance with specific comparison nodes factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
areDifferentEClassObjectsMergeable(org.eclipse.emf.ecore.EObject main, org.eclipse.emf.ecore.EObject other, ComparisonContext comparisonContext)
protected ComparisonFlags
compareEmfObject(TopComparisonNode topParent, LazyNodeProvider<? extends ComparisonNode> nodeProvider, AbstractComparedEmfObjects<?> comparingObject, AbstractEmfBasedComparisonParticipant.BmIdsWrapper childBmIds, ComparisonContext comparisonContext)
protected String
extractTopLink(String symlink)
protected IEmfObjectMatcher
getCustomMatcher(TopComparisonNode topNode, org.eclipse.emf.ecore.EReference reference, ComparisonContext objectContext)
Returns a custom matcher for the specified reference.MergeRule
getDefaultMergeRule(ComparisonNode node, IComparisonSession session)
Returns the default merge rule for the given node.protected String
getExternalPropertyQualifyingType(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference externalProperty)
Returns the EClass of the specified external property of the specified EObject.protected String
getExternalPropertySymlink(TopComparisonNode node, org.eclipse.emf.ecore.EReference externalProperty, ComparisonSide side, org.eclipse.emf.ecore.EObject eObject)
Returns the symbolic link (FQN) of the specified external property.protected boolean
hasConflictChangesInCollection(ComparedFeatures<org.eclipse.emf.ecore.EReference> comparedReferences, Collection<? extends MatchedEmfObjects> matchedElements)
Tells whether the collection being compared should be treated as containing conflicts.protected boolean
isBmIdMayChangeOnMerge(IBmObject bmObject)
Tells whether bmId of an object may change during the merge phase.protected boolean
isFeatureTakenFromPreferredSide(org.eclipse.emf.ecore.EObject item, org.eclipse.emf.ecore.EStructuralFeature feature, MatchedEmfObjects matchedElement, MergeRule rule)
Checks whether specified feature of a merged item got from the preferred side or not.boolean
supportsPrioritizedMerging(ComparisonNode node, IComparisonSession session)
Tells whether the given node supports prioritized merging.-
Methods inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
adaptOtherReference, adoptEClassToImport, adoptMainSideFeature, assertEClassesMatch, calculateCompareValueFlags, checkForOneSideConflict, clear, compareEmfContainment, compareOneSideObject, comparePictureResource, compareReference, compareValue, createClassFeaturesInstance, createImportedEObject, createResourceForImportedObject, deletePictureResourceFile, findChildNodeByFeature, findChildNodeByMatchedId, getClassFeatures, getClassFeatures, getFeaturesToCompareForOneSideObject, getFeatureTypeDescription, getForcedDDRebuildScope, getMultiReferenceSymlinks, getMultiReferenceValueSymlink, getNodeFactory, getOtherSideFeature, getPictureResourcePath, getPotentialMergeProblemsDescriptions, getQualifiedName, getSingleReferenceSymlink, getTopNode, importEmfObject, importPictureResourceFile, isCandidateForPotentialMergeProblems, isExcludedFromComparison, isFeatureWithCustomMerge, isUnmatchableContainment, matchEmfObjects, mergeEmfProperties, mergeEmfReference, mergeOtherContainment, mergeUsingExternalTool, needCreateOneSideNode, onChildrenMerged, prepareRenameOperations, removeObjectFromContainerOnMerge, removeObjectFromListOnMerge, restoreCustomSettings, saveCustomSettings, setObjectToContainerOnMerge, supportsCustomMerging, supportsMergingUsingExternalTool, translateReferencesInImportedObject, updatePictureResourceFile, wrapOtherReference
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.v8.dt.compare.core.IComparisonParticipant
ableToBreakCorrespondence, addNewTopObjectToComparison, adoptExternalProperty, breakCorrespondence, breakMainSideCorrespondence, combineOneSideNodes, compare, createMergeContext, getDefaultMustBeMerged, getModelPackage, getPotentialCorrespondingNodes, merge, retrieveComparedObjects, supports, updateComparison, validateMerge
-
-
-
-
Field Detail
-
LOGGING
protected static final boolean LOGGING
-
SYMLINK_SEPARATOR
protected static final Character SYMLINK_SEPARATOR
-
INVALID_SYMLINK_PATTERN
protected static final Pattern INVALID_SYMLINK_PATTERN
-
qualifiedNameProvider
@Inject protected org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider
-
bmModelManager
@Inject protected IBmModelManager bmModelManager
-
-
Constructor Detail
-
AbstractMdAwareComparisonParticipant
protected AbstractMdAwareComparisonParticipant()
Creates new participant instance with default comparison nodes factory.
-
AbstractMdAwareComparisonParticipant
protected AbstractMdAwareComparisonParticipant(ComparisonNodeFactory nodeFactory)
Creates new participant instance with specific comparison nodes factory.- Parameters:
nodeFactory
- the node factory to use, cannot benull
-
-
Method Detail
-
supportsPrioritizedMerging
public boolean supportsPrioritizedMerging(ComparisonNode node, IComparisonSession session)
Description copied from interface:IComparisonParticipant
Tells whether the given node supports prioritized merging.- Specified by:
supportsPrioritizedMerging
in interfaceIComparisonParticipant
- Overrides:
supportsPrioritizedMerging
in classAbstractEmfBasedComparisonParticipant
- Parameters:
node
- the node to check, cannot benull
session
- the comparison session, cannot benull
- Returns:
true
if the node supports prioritized merging,false
otherwise
-
getDefaultMergeRule
public MergeRule getDefaultMergeRule(ComparisonNode node, IComparisonSession session)
Description copied from interface:IComparisonParticipant
Returns the default merge rule for the given node.- 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
-
getCustomMatcher
protected IEmfObjectMatcher getCustomMatcher(TopComparisonNode topNode, org.eclipse.emf.ecore.EReference reference, ComparisonContext objectContext)
Description copied from class:AbstractEmfBasedComparisonParticipant
Returns a custom matcher for the specified reference.- Overrides:
getCustomMatcher
in classAbstractEmfBasedComparisonParticipant
- Parameters:
topNode
- the top nodereference
- the reference to get a custom matcher forobjectContext
- the current comparison context, cannot benull
- Returns:
- a custom matcher or
null
if no custom matcher can be found
-
getExternalPropertySymlink
protected String getExternalPropertySymlink(TopComparisonNode node, org.eclipse.emf.ecore.EReference externalProperty, ComparisonSide side, org.eclipse.emf.ecore.EObject eObject)
Description copied from class:AbstractEmfBasedComparisonParticipant
Returns the symbolic link (FQN) of the specified external property.- Specified by:
getExternalPropertySymlink
in classAbstractEmfBasedComparisonParticipant
- Parameters:
node
- the node with the external propertyexternalProperty
- theEReference
to the external propertyside
- the comparison sideeObject
- theEObject
referencing the external property- Returns:
- the symbolic link
-
compareEmfObject
protected ComparisonFlags compareEmfObject(TopComparisonNode topParent, LazyNodeProvider<? extends ComparisonNode> nodeProvider, AbstractComparedEmfObjects<?> comparingObject, AbstractEmfBasedComparisonParticipant.BmIdsWrapper childBmIds, ComparisonContext comparisonContext)
- Overrides:
compareEmfObject
in classAbstractEmfBasedComparisonParticipant
-
getExternalPropertyQualifyingType
protected String getExternalPropertyQualifyingType(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference externalProperty)
Description copied from class:AbstractEmfBasedComparisonParticipant
Returns the EClass of the specified external property of the specified EObject.- Specified by:
getExternalPropertyQualifyingType
in classAbstractEmfBasedComparisonParticipant
- Returns:
-
isFeatureTakenFromPreferredSide
protected boolean isFeatureTakenFromPreferredSide(org.eclipse.emf.ecore.EObject item, org.eclipse.emf.ecore.EStructuralFeature feature, MatchedEmfObjects matchedElement, MergeRule rule)
Checks whether specified feature of a merged item got from the preferred side or not.- Parameters:
item
- the item which feature to check, cannot benull
feature
- the feature to check, cannot benull
matchedElement
- the item-related element matched on comparison stage, cannot benull
rule
- the merge rule, cannot benull
- Returns:
true
if item's property got from preferred side,false
otherwise
-
areDifferentEClassObjectsMergeable
protected boolean areDifferentEClassObjectsMergeable(org.eclipse.emf.ecore.EObject main, org.eclipse.emf.ecore.EObject other, ComparisonContext comparisonContext)
- Overrides:
areDifferentEClassObjectsMergeable
in classAbstractEmfBasedComparisonParticipant
-
hasConflictChangesInCollection
protected boolean hasConflictChangesInCollection(ComparedFeatures<org.eclipse.emf.ecore.EReference> comparedReferences, Collection<? extends MatchedEmfObjects> matchedElements)
Description copied from class:AbstractEmfBasedComparisonParticipant
Tells whether the collection being compared should be treated as containing conflicts.- Overrides:
hasConflictChangesInCollection
in classAbstractEmfBasedComparisonParticipant
- Parameters:
comparedReferences
- the triple of many-features being compared, cannot benull
- Returns:
true
if the collection should be treated as containing conflicts,false
otherwise
-
isBmIdMayChangeOnMerge
protected boolean isBmIdMayChangeOnMerge(IBmObject bmObject)
Description copied from class:AbstractEmfBasedComparisonParticipant
Tells whether bmId of an object may change during the merge phase. Override in descendants for specific types.- Overrides:
isBmIdMayChangeOnMerge
in classAbstractEmfBasedComparisonParticipant
- Parameters:
bmObject
- the object to be checked, cannot benull
- Returns:
true
if bmId may change,false
otherwise
-
-