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
- Direct Known Subclasses:
AdditionalIndexesComparisonParticipant
,ChartComparisonParticipant
,DcsComparisonParticipant
,FormComparisonParticipant
,MdObjectComparisonParticipant
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
FieldsModifier and TypeFieldDescriptionprotected IBmModelManager
protected static final Pattern
protected static final boolean
protected org.eclipse.xtext.naming.IQualifiedNameProvider
protected static final Character
Fields inherited from class com._1c.g5.v8.dt.compare.participant.AbstractEmfBasedComparisonParticipant
LOG_TYPES, pictureManager, projectFileSystemSupportProvider, qualifiedNameFilePathConverter, scopeProvider, topObjectFqnGenerator
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates new participant instance with default comparison nodes factory.protected
Creates new participant instance with specific comparison nodes factory. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.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, skipFeatureOnImportEmfObject, 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 Details
-
LOGGING
protected static final boolean LOGGING -
SYMLINK_SEPARATOR
-
INVALID_SYMLINK_PATTERN
-
qualifiedNameProvider
@Inject protected org.eclipse.xtext.naming.IQualifiedNameProvider qualifiedNameProvider -
bmModelManager
-
-
Constructor Details
-
AbstractMdAwareComparisonParticipant
protected AbstractMdAwareComparisonParticipant()Creates new participant instance with default comparison nodes factory. -
AbstractMdAwareComparisonParticipant
Creates new participant instance with specific comparison nodes factory.- Parameters:
nodeFactory
- the node factory to use, cannot benull
-
-
Method Details
-
supportsPrioritizedMerging
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
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
-
extractTopLink
-
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
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
-