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 protectedAbstractMdObjectMatcher(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 booleancheckOrderChange()Tells 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 StringgetName(T object)Returns the name of the matched object.protected org.eclipse.emf.ecore.EStructuralFeaturegetParentCollectionFeature()Gets parent collection feature, if present.protected IComparisonSessiongetSession()Returns the comparison session.protected abstract StringgetSymlink(T object)Returns the symbolic link of the matched object.protected abstract UUIDgetUuid(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 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 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 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
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:
trueif should check the md objects order change,falseotherwise
-
-