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 IBmModelManagerbmModelManagerprotected static PatternINVALID_SYMLINK_PATTERNprotected static booleanLOGGINGprotected org.eclipse.xtext.naming.IQualifiedNameProviderqualifiedNameProviderprotected static CharacterSYMLINK_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 protectedAbstractMdAwareComparisonParticipant()Creates new participant instance with default comparison nodes factory.protectedAbstractMdAwareComparisonParticipant(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 booleanareDifferentEClassObjectsMergeable(org.eclipse.emf.ecore.EObject main, org.eclipse.emf.ecore.EObject other, ComparisonContext comparisonContext)protected ComparisonFlagscompareEmfObject(TopComparisonNode topParent, LazyNodeProvider<? extends ComparisonNode> nodeProvider, AbstractComparedEmfObjects<?> comparingObject, AbstractEmfBasedComparisonParticipant.BmIdsWrapper childBmIds, ComparisonContext comparisonContext)protected StringextractTopLink(String symlink)protected IEmfObjectMatchergetCustomMatcher(TopComparisonNode topNode, org.eclipse.emf.ecore.EReference reference, ComparisonContext objectContext)Returns a custom matcher for the specified reference.MergeRulegetDefaultMergeRule(ComparisonNode node, IComparisonSession session)Returns the default merge rule for the given node.protected StringgetExternalPropertyQualifyingType(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 StringgetExternalPropertySymlink(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 booleanhasConflictChangesInCollection(ComparedFeatures<org.eclipse.emf.ecore.EReference> comparedReferences, Collection<? extends MatchedEmfObjects> matchedElements)Tells whether the collection being compared should be treated as containing conflicts.protected booleanisBmIdMayChangeOnMerge(IBmObject bmObject)Tells whether bmId of an object may change during the merge phase.protected booleanisFeatureTakenFromPreferredSide(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.booleansupportsPrioritizedMerging(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:IComparisonParticipantTells whether the given node supports prioritized merging.- Specified by:
supportsPrioritizedMergingin interfaceIComparisonParticipant- Overrides:
supportsPrioritizedMergingin classAbstractEmfBasedComparisonParticipant- Parameters:
node- the node to check, cannot benullsession- the comparison session, cannot benull- Returns:
trueif the node supports prioritized merging,falseotherwise
-
getDefaultMergeRule
public MergeRule getDefaultMergeRule(ComparisonNode node, IComparisonSession session)
Description copied from interface:IComparisonParticipantReturns the default merge rule for the given node.- Parameters:
node- the node to get default merge rule for, can not benullsession- the comparison session, can not benull- Returns:
- the default merge rule or
nullif it wasn't specified
-
getCustomMatcher
protected IEmfObjectMatcher getCustomMatcher(TopComparisonNode topNode, org.eclipse.emf.ecore.EReference reference, ComparisonContext objectContext)
Description copied from class:AbstractEmfBasedComparisonParticipantReturns a custom matcher for the specified reference.- Overrides:
getCustomMatcherin 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
nullif 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:AbstractEmfBasedComparisonParticipantReturns the symbolic link (FQN) of the specified external property.- Specified by:
getExternalPropertySymlinkin classAbstractEmfBasedComparisonParticipant- Parameters:
node- the node with the external propertyexternalProperty- theEReferenceto the external propertyside- the comparison sideeObject- theEObjectreferencing 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:
compareEmfObjectin classAbstractEmfBasedComparisonParticipant
-
getExternalPropertyQualifyingType
protected String getExternalPropertyQualifyingType(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference externalProperty)
Description copied from class:AbstractEmfBasedComparisonParticipantReturns the EClass of the specified external property of the specified EObject.- Specified by:
getExternalPropertyQualifyingTypein 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 benullfeature- the feature to check, cannot benullmatchedElement- the item-related element matched on comparison stage, cannot benullrule- the merge rule, cannot benull- Returns:
trueif item's property got from preferred side,falseotherwise
-
areDifferentEClassObjectsMergeable
protected boolean areDifferentEClassObjectsMergeable(org.eclipse.emf.ecore.EObject main, org.eclipse.emf.ecore.EObject other, ComparisonContext comparisonContext)- Overrides:
areDifferentEClassObjectsMergeablein classAbstractEmfBasedComparisonParticipant
-
hasConflictChangesInCollection
protected boolean hasConflictChangesInCollection(ComparedFeatures<org.eclipse.emf.ecore.EReference> comparedReferences, Collection<? extends MatchedEmfObjects> matchedElements)
Description copied from class:AbstractEmfBasedComparisonParticipantTells whether the collection being compared should be treated as containing conflicts.- Overrides:
hasConflictChangesInCollectionin classAbstractEmfBasedComparisonParticipant- Parameters:
comparedReferences- the triple of many-features being compared, cannot benull- Returns:
trueif the collection should be treated as containing conflicts,falseotherwise
-
isBmIdMayChangeOnMerge
protected boolean isBmIdMayChangeOnMerge(IBmObject bmObject)
Description copied from class:AbstractEmfBasedComparisonParticipantTells whether bmId of an object may change during the merge phase. Override in descendants for specific types.- Overrides:
isBmIdMayChangeOnMergein classAbstractEmfBasedComparisonParticipant- Parameters:
bmObject- the object to be checked, cannot benull- Returns:
trueif bmId may change,falseotherwise
-
-