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
public abstract class AbstractMdObjectMatcher<T> extends Object
An abstract matcher of objects representing MD objects, capable of creating comparison result nodes.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMdObjectMatcher(IComparisonSession session, MdCollectionComparisonNode parentCollectionNode, List<T> mainObjects, List<T> otherObjects, List<T> ancestorObjects)
Constructs a matcher.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
checkOrderChange()
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
getName(T object)
Returns the name of the matched object.protected org.eclipse.emf.ecore.EStructuralFeature
getParentCollectionFeature()
Gets parent collection feature, if present.protected IComparisonSession
getSession()
Returns the comparison session.protected abstract String
getSymlink(T object)
Returns the symbolic link of the matched object.protected abstract UUID
getUuid(T object)
Returns the UUID of the matched object.List<MdObjectComparisonNode>
match()
Matches the specified collections and returns the result as a list of created child model nodes.
-
-
-
Constructor Detail
-
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 Detail
-
match
public List<MdObjectComparisonNode> 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
protected abstract String getName(T object)
Returns the name of the matched object.- Returns:
- the name
-
getUuid
protected abstract UUID getUuid(T object)
Returns the UUID of the matched object.- Returns:
- the UUID
-
getSymlink
protected abstract String getSymlink(T object)
Returns the symbolic link of the matched object.- Returns:
- the symbolic link
-
createNode
protected abstract MdObjectComparisonNode createNode(T main, T other, T ancestor)
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
protected IComparisonSession 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
-
-