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
ConstructorsModifierConstructorDescriptionprotected
AbstractMdObjectMatcher
(IComparisonSession session, MdCollectionComparisonNode parentCollectionNode, List<T> mainObjects, List<T> otherObjects, List<T> ancestorObjects) Constructs a matcher. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Tells whether to check the md objects order change.protected abstract MdObjectComparisonNode
createNode
(T main, T other, T ancestor) Creates a comparison node for the triple of matched objects.protected abstract String
Returns the name of the matched object.protected org.eclipse.emf.ecore.EStructuralFeature
Gets parent collection feature, if present.protected IComparisonSession
Returns the comparison session.protected abstract String
getSymlink
(T object) Returns the symbolic link of the matched object.protected abstract UUID
Returns 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 benull
parentCollectionNode
- the node related to the parent collection where the matching MD objects lie in, may benull
if objects don't lie in any collectionmainObjects
- the main objects to be matched, cannot benull
otherObjects
- the other objects to be matched, cannot benull
ancestorObjects
- the ancestor objects to be matched, may benull
in 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 benull
other
- the other object, may benull
ancestor
- 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:
true
if should check the md objects order change,false
otherwise
-