Class AbstractMdObjectMatcher<T>
java.lang.Object
com._1c.g5.v8.dt.md.compare.matching.AbstractMdObjectMatcher<T>
- Type Parameters:
T- the type of objects to match
- Direct Known Subclasses:
ChildMdObjectMatcher,TopObjectMatcher
An abstract matcher of objects representing MD objects, capable of creating comparison result nodes.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMdObjectMatcher(IComparisonSession session, MdCollectionComparisonNode parentCollectionNode, List<T> mainObjects, List<T> otherObjects, List<T> ancestorObjects) Constructs a matcher. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanTells whether to check the md objects order change.protected abstract MdObjectComparisonNodecreateNode(T main, T other, T ancestor) Creates a comparison node for the triple of matched objects.protected abstract StringReturns the name of the matched object.protected org.eclipse.emf.ecore.EStructuralFeatureGets parent collection feature, if present.protected IComparisonSessionReturns the comparison session.protected abstract StringgetSymlink(T object) Returns the symbolic link of the matched object.protected abstract UUIDReturns the UUID of the matched object.match()Matches the specified collections and returns the result as a list of created child model nodes.
-
Constructor Details
-
AbstractMdObjectMatcher
protected AbstractMdObjectMatcher(IComparisonSession session, MdCollectionComparisonNode parentCollectionNode, List<T> mainObjects, List<T> otherObjects, List<T> ancestorObjects) Constructs a matcher.- Parameters:
session- the comparison session, cannot benullparentCollectionNode- the node related to the parent collection where the matching MD objects lie in, may benullif objects don't lie in any collectionmainObjects- the main objects to be matched, cannot benullotherObjects- the other objects to be matched, cannot benullancestorObjects- the ancestor objects to be matched, may benullin case of two-way comparison
-
-
Method Details
-
match
Matches the specified collections and returns the result as a list of created child model nodes.- Returns:
- a list of created child nodes corresponding to matched objects, never
null
-
getName
Returns the name of the matched object.- Returns:
- the name
-
getUuid
Returns the UUID of the matched object.- Returns:
- the UUID
-
getSymlink
Returns the symbolic link of the matched object.- Returns:
- the symbolic link
-
createNode
Creates a comparison node for the triple of matched objects. At least one of objects in the triple must not benull.- Parameters:
main- the main object, may benullother- the other object, may benullancestor- the common ancestor object, may benull- Returns:
- a new comparison node related to the triple of objects, never
null
-
getSession
Returns the comparison session.- Returns:
- the comparison session instance, never
null
-
getParentCollectionFeature
protected org.eclipse.emf.ecore.EStructuralFeature getParentCollectionFeature()Gets parent collection feature, if present.- Returns:
- the parent collection feature, may be
null
-
checkOrderChange
protected boolean checkOrderChange()Tells whether to check the md objects order change.- Returns:
trueif should check the md objects order change,falseotherwise
-