Interface ISymlinkTranslator


  • public interface ISymlinkTranslator
    A service responsible for translating symbolic links according to their context and taking into account the comparison model.
    • Method Detail

      • getMatchingSymlinks

        IMatchingSymlinks getMatchingSymlinks​(ComparisonNode node,
                                              org.eclipse.emf.ecore.EObject eObject,
                                              org.eclipse.emf.ecore.EReference reference,
                                              ComparisonSide sourceSide,
                                              String symlink,
                                              ComparisonContext comparisonContext,
                                              IMergeSession mergeSession)
        For the specified symbolic link in the specified context on the specified side ("source side"), returns an object with this link on the specified target side and symbolic links (within the same context) of objects corresponding to the source object in the comparison model.
        Parameters:
        node - the comparison result node
        eObject - the EObject containing the symbolic link
        reference - the reference of the link
        sourceSide - the source side
        symlink - the source symbolic link
        comparisonContext - the current comparison context, cannot be null
        mergeSession - the merge session or null
        Returns:
        an object with matching symbolic links where the source symbolic is on the source side
      • getMatchingSymlinksToTopObject

        IMatchingSymlinks getMatchingSymlinksToTopObject​(ComparisonContext comparisonContext,
                                                         String symlink,
                                                         ComparisonSide side,
                                                         IMergeSession mergeSession)
        Returns matched symlinks to the top object with the given symlink on a given comparison side.
        Parameters:
        comparisonContext - the comparison context, cannot be null
        symlink - the top object symlink to be matched, cannot be null
        side - the comparison side where the top object lies, cannot be null
        mergeSession - the merge session, can be null if no merge process run
        Returns:
        the triple of matched symlinks or null if no matched symlinks found
      • translateForImport

        String translateForImport​(IMergeSession mergeSession,
                                  ComparisonNode node,
                                  org.eclipse.emf.ecore.EObject eObject,
                                  org.eclipse.emf.ecore.EReference reference,
                                  String symlink,
                                  ComparisonContext comparisonContext)
        Translates the specified symbolic link referencing an object on the OTHER side of comparison for the purposes of import, that is, when the reference is situated in an imported other object. An object is imported if it is present only on the OTHER side of comparison and is merged according to the merge settings. The translated symlink, if the original symlink was referencing an object having a correspondence on the MAIN side of comparison, will be the same as in the getMatchingSymlinks method. If the symlink was pointing to an object not present on the MAIN side but imported in the specified session (or an object derived from one), the result will take into account the closest existing parent correspondence.
        Parameters:
        mergeSession - the merge session
        node - the comparison result node
        eObject - the EObject containing the symbolic link
        reference - the reference of the link
        symlink - the symbolic link on the other side
        comparisonContext - the current comparison context, cannot be null
        Returns:
        the symlink in terms of the main side after import