Class BslCompareUtils

java.lang.Object
com._1c.g5.v8.dt.bsl.compare.BslCompareUtils

public class BslCompareUtils extends Object
Utility methods used for comparison and merge Bsl module.
  • Field Details

  • Method Details

    • isBinaryModule

      public static boolean isBinaryModule(BslModuleComparisonNode node)
      Tells is bsl module binary or not.
      Parameters:
      node - the bsl module comparison node, cannot be null
      Returns:
      true if bsl module is binary and false if not
    • executeExternalMergeToolForBslModuleSection

      public static ExternalMergeToolExecutionStatus executeExternalMergeToolForBslModuleSection(BslModuleSectionComparisonNode node, IComparisonSession session, IComparedObjects<org.eclipse.jface.text.IDocument> comparingDocuments, boolean isMerge, File mergeResultFile, IExternalMergeToolProvider externalMergeToolProvider) throws IOException, org.eclipse.jface.text.BadLocationException
      Executes external merge tool for bsl module section. Runs compare or merge, depends on parameters.
      Parameters:
      node - the bsl module section comparison node, should not be one side, cannot be null
      session - the comparison session, cannot be null
      comparingDocuments - the bsl module comparing document to get content from, cannot be null
      isMerge - true if run merge using external tool, and false if start comparison
      mergeResultFile - the file to store merge result, can be null only if isMerge is false
      externalMergeToolProvider - the external merge tool provider, cannot be null
      Returns:
      the external merge tool execution status, never null
      Throws:
      IOException - if failed to read the section content
      org.eclipse.jface.text.BadLocationException - if it fails to read the section content
    • readBslModuleContentInfo

      public static BslModuleContentInfo readBslModuleContentInfo(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, boolean detectIsBinary, IQualifiedNameFilePathConverter filePathConverter)
      Reads the Bsl module content info on the specified comparison side.
      Parameters:
      node - the Bsl module comparison node to get content for, cannot be null
      session - the comparison session, cannot be null
      side - the comparison side to get content on, cannot be null
      detectIsBinary - tells whether to detect is Bsl module content is binary
      filePathConverter - the qualified name file path converted, cannot be null
      Returns:
      the Bsl module content info, never null
    • readBslModuleContentBySectionNode

      public static String readBslModuleContentBySectionNode(BslModuleSectionComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
      Reads the Bsl module content on the specified comparison side.
      Parameters:
      node - the Bsl module section comparison node to get content for, cannot be null
      session - the comparison session, cannot be null
      side - the comparison side to get content on, cannot be null
      filePathConverter - the qualified name file path converted, cannot be null
      Returns:
      the Bsl module content, may be null
    • getSectionContent

      public static String getSectionContent(BslModuleSectionComparisonNode node, IComparedObjects<org.eclipse.jface.text.IDocument> comparingDocuments, ComparisonSide side) throws org.eclipse.jface.text.BadLocationException
      Returns the Bsl module section content on the specified size.
      Parameters:
      node - the Bsl module section node, cannot be null
      comparingDocuments - the Bsl module comparing document to get content from, cannot be null
      side - the comparison side to get section content on, cannot be null
      Returns:
      the Bsl module section content on the specified size, may be null
      Throws:
      org.eclipse.jface.text.BadLocationException - if it fails to read the section content
    • parseBslModuleContent

      public static org.eclipse.xtext.parser.IParseResult parseBslModuleContent(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
      Parses the Bsl module content stream on the specified comparison side.
      Parameters:
      node - the Bsl module comparison node to parse content for, cannot be null
      session - the comparison session, cannot be null
      side - the comparison side to parse content on, cannot be null
      filePathConverter - the qualified name file path converted, cannot be null
      Returns:
      the result of the parsing or null if nothing to parse or it failed
    • parseBslModuleContent

      public static org.eclipse.xtext.parser.IParseResult parseBslModuleContent(InputStream inputStream)
      Parses the Bsl module content stream.
      Parameters:
      inputStream - the Bsl module input stream to parse, cannot be null
      Returns:
      the result of the parsing or null if it failed