Class ComparisonNodeFactory


  • public class ComparisonNodeFactory
    extends Object
    Factory to produce comparison nodes and to attach them to the comparison model.
    • Constructor Detail

      • ComparisonNodeFactory

        public ComparisonNodeFactory()
    • Method Detail

      • createSingleValueComparisonNode

        public SingleValueComparisonNode createSingleValueComparisonNode​(ComparisonNode parent,
                                                                         AbstractComparedEmfObjects<?> parentComparedObjects,
                                                                         ComparedObjects<?> comparedObjects,
                                                                         ComparedFeatures<?> comparedFeatures,
                                                                         IComparisonSession session)
        Creates a comparison node for a single value.
        Parameters:
        parent - the parent comparison node this node to be attached to, cannot be null
        parentComparedObjects - the triple of parent compared objects, cannot be null
        comparedObjects - the triple of compared objects this node to be related to, cannot be null
        comparedFeatures - the triple of features identifying the single value, cannot be null
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null
      • createSingleReferenceComparisonNode

        public SingleReferenceFeatureComparisonNode createSingleReferenceComparisonNode​(ComparisonNode parent,
                                                                                        AbstractComparedEmfObjects<?> parentComparedObjects,
                                                                                        ComparedSymlinks matchedSymlinks,
                                                                                        ComparedFeatures<?> comparedFeatures,
                                                                                        IComparisonSession session)
        Creates a comparison node for a single reference (non-containment) feature.
        Parameters:
        parent - the parent comparison node this node to be attached to, cannot be null
        parentComparedObjects - the triple of parent compared objects, cannot be null
        matchedSymlinks - the triple of matched symlinks this node to be related to, cannot be null
        comparedFeatures - the triple of features identifying the single reference, cannot be null
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null
      • createSingleContainmentComparisonNode

        public SingleContainmentFeatureComparisonNode createSingleContainmentComparisonNode​(ComparisonNode parent,
                                                                                            AbstractComparedEmfObjects<?> parentComparedObjects,
                                                                                            MatchedEmfObjects matchedObjects,
                                                                                            ComparedFeatures<?> comparedFeatures,
                                                                                            IComparisonSession session)
        Creates a comparison node for a single containment feature.
        Parameters:
        parent - the parent comparison node this node to be attached to, cannot be null
        matchedObjects - the triple of matched objects this node to be related to, cannot be null
        comparedFeatures - the triple of features identifying the single containment, cannot be null
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null
      • createReferenceCollectionNode

        public ReferenceCollectionComparisonNode createReferenceCollectionNode​(ComparisonNode parent,
                                                                               AbstractComparedEmfObjects<?> parentComparedObjects,
                                                                               ComparedFeatures<?> comparedFeatures,
                                                                               IComparisonSession session)
        Creates a comparison node for some reference collection.
        Parameters:
        parent - the parent comparison node this node to be attached to, cannot be null
        parentComparedObjects - the triple of parent objects containing the collection, cannot be null
        comparedFeatures - the triple of features identifying the reference collection, cannot be null
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null
      • createContainmentCollectionNode

        public ContainmentCollectionComparisonNode createContainmentCollectionNode​(ComparisonNode parent,
                                                                                   AbstractComparedEmfObjects<?> parentComparedObjects,
                                                                                   ComparedFeatures<?> comparedFeatures,
                                                                                   IComparisonSession session)
        Creates a comparison node for some containment collection.
        Parameters:
        parent - the parent comparison node this node to be attached to, cannot be null
        parentComparedObjects - the triple of parent objects containing the collection, cannot be null
        comparedFeatures - the triple of features identifying the containment collection, cannot be null
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null
      • createReferenceCollectionElementComparisonNode

        public ReferenceCollectionElementComparisonNode createReferenceCollectionElementComparisonNode​(ComparisonNode parent,
                                                                                                       AbstractComparedEmfObjects<?> parentComparedObjects,
                                                                                                       MatchedReference matchedRef,
                                                                                                       ComparedFeatures<?> collectionFeatures,
                                                                                                       int positionAfterMerge,
                                                                                                       IComparisonSession session)
        Creates a comparison node for the element in the reference (non-containment) collection.
        Parameters:
        parent - the parent comparison node this node to be attached to, cannot be null
        parentComparedObjects - the triple of parent objects containing the collection, cannot be null
        matchedRef - the triple of matched references this node to be related to, cannot be null
        collectionFeatures - the triple of features identifying the parent collection, cannot be null
        positionAfterMerge - the expected position of the element after merge finish
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null
      • createContainmentCollectionElementComparisonNode

        public ContainmentCollectionElementComparisonNode createContainmentCollectionElementComparisonNode​(ComparisonNode parent,
                                                                                                           AbstractComparedEmfObjects<?> parentComparedObjects,
                                                                                                           MatchedEmfObjects matchedObjects,
                                                                                                           ComparedFeatures<?> collectionFeatures,
                                                                                                           int positionAfterMerge,
                                                                                                           IComparisonSession session)
        Creates a comparison node for the element in the containment collection.
        Parameters:
        parent - the parent comparison node this node to be attached to, cannot be null
        parentComparedObjects - the triple of parent objects containing the collection, cannot be null
        matchedObjects - the triple of matched collection elements this node to be related to, cannot be null
        collectionFeatures - the triple of features identifying the parent collection, cannot be null
        positionAfterMerge - the expected position of the element after merge finish
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null
      • createExternalPropertyNode

        public ExternalPropertyComparisonNode createExternalPropertyNode​(ComparisonNode parent,
                                                                         ExternalPropertyComparisonData extPropData,
                                                                         IComparisonSession session)
        Creates a comparison node for some external property.
        Parameters:
        parent - the parent comparison node this node to be attached to, cannot be null
        extPropData - the external property data to create the comparison node from, cannot be null
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null
      • createRelatedFeature

        protected final RelatedFeature createRelatedFeature​(org.eclipse.emf.ecore.EStructuralFeature feature,
                                                            IComparisonSession session)
        Creates related feature object from the given EStructuralFeature instance.
        Parameters:
        feature - the feature to create related feature object for, cannot be null
        session - the comparison session, cannot be null
        Returns:
        the related feature object, never null
      • create

        protected <T extends ComparisonNode> T create​(org.eclipse.emf.ecore.EClass nodeType)
        Creates new comparison node instance.
        Type Parameters:
        T - the type of node to return, must inherit ContainmentComparisonNode
        Parameters:
        nodeType - the EClass of node to be created, cannot be null
        Returns:
        the comparison node created, never null
      • createCollectionNode

        protected <T extends CollectionComparisonNode> T createCollectionNode​(org.eclipse.emf.ecore.EClass nodeType,
                                                                              ComparisonNode parent,
                                                                              AbstractComparedEmfObjects<?> parentComparedObjects,
                                                                              ComparedFeatures<?> comparedFeatures,
                                                                              IComparisonSession session)
        Creates a comparison node for some collection.
        Type Parameters:
        T - the type of collection node to return, must inherit CollectionComparisonNode
        Parameters:
        nodeType - the EClass of node to be created, cannot be null
        parent - the parent comparison node this node to be attached to, cannot be null
        parentComparedObjects - the triple of parent objects containing the collection, cannot be null
        comparedFeatures - the triple of features identifying the collection, cannot be null
        session - the comparison session this node to be added to, cannot be null
        Returns:
        the comparison node created, never null