Package com._1c.g5.v8.dt.bsl.compare
Class BslCompareUtils
java.lang.Object
com._1c.g5.v8.dt.bsl.compare.BslCompareUtils
Utility methods used for comparison and merge Bsl module.
-
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamgetBslModuleContentStream(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Returns the Bsl module content stream on the specified comparison side.static InputStreamgetBslModuleContentStreamOnMerge(BslModuleComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Returns the Bsl module content stream on the specified comparison side on merge.static StringgetLocalizedBslModuleName(String symlink, String comparisonSideName, ISymbolicLinkLocalizer symbolicLinkLocalizer) Returns the localized Bsl module node name.static StringgetTrimmedLocalizedModuleSymlink(String symlink, ISymbolicLinkLocalizer symbolicLinkLocalizer) Returns the trimmed localized Bsl module symlink.mergeModuleUsingExternalTool(BslModuleComparisonNode node, IComparisonSession session, ExternalMergeToolConfiguration externalMergeToolConfiguration, int timeout, boolean runAutoMergeByDefault, String mainComparisonSideName, String otherComparisonSideName, File mergeResultFile, IQualifiedNameFilePathConverter filePathConverter, ISymbolicLinkLocalizer symbolicLinkLocalizer) Merges the Bsl module using an external tool for the specified node.static org.eclipse.xtext.parser.IParseResultparseBslModuleContent(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Parses the Bsl module content stream on the specified comparison side.static org.eclipse.xtext.parser.IParseResultparseBslModuleContent(InputStream inputStream) Parses the Bsl module content stream.static BslModuleContentInforeadBslModuleContent(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, boolean detectIsBinary, IQualifiedNameFilePathConverter filePathConverter) Reads the Bsl module content on the specified comparison side.static StringreadBslModuleContent(BslModuleSectionComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Reads the Bsl module content on the specified comparison side.static StringreadBslModuleContentOnMerge(BslModuleComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Reads the Bsl module content on the specified comparison side on merge.
-
Method Details
-
readBslModuleContent
public static BslModuleContentInfo readBslModuleContent(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, boolean detectIsBinary, IQualifiedNameFilePathConverter filePathConverter) Reads the Bsl module content on the specified comparison side.- Parameters:
node- the Bsl module comparison node to get content for, cannot benullsession- the comparison session, cannot benullside- the comparison side to get content on, cannot benulldetectIsBinary- tells whether to detect is Bsl module content is binaryfilePathConverter- the qualified name file path converted, cannot benull- Returns:
- the Bsl module content info, never
null
-
readBslModuleContent
public static String readBslModuleContent(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 benullsession- the comparison session, cannot benullside- the comparison side to get content on, cannot benullfilePathConverter- the qualified name file path converted, cannot benull- Returns:
- the Bsl module content, may be
null
-
readBslModuleContentOnMerge
public static String readBslModuleContentOnMerge(BslModuleComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Reads the Bsl module content on the specified comparison side on merge.- Parameters:
node- the Bsl module comparison node to get content for, cannot benullmergeSession- the merge session, cannot benullside- the comparison side to get content on, cannot benullfilePathConverter- the qualified name file path converted, cannot benull- Returns:
- the Bsl module content on merge, may be
null
-
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 benullsession- the comparison session, cannot benullside- the comparison side to parse content on, cannot benullfilePathConverter- the qualified name file path converted, cannot benull- Returns:
- the result of the parsing or
nullif nothing to parse or it failed
-
parseBslModuleContent
Parses the Bsl module content stream.- Parameters:
inputStream- the Bsl module input stream to parse, cannot benull- Returns:
- the result of the parsing or
nullif it failed
-
getBslModuleContentStream
public static InputStream getBslModuleContentStream(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Returns the Bsl module content stream on the specified comparison side.- Parameters:
node- the Bsl module comparison node to get content stream for, cannot benullsession- the comparison session, cannot benullside- the comparison side to get content stream on, cannot benullfilePathConverter- the qualified name file path converted, cannot benull- Returns:
- the Bsl module content stream or
nullif there is no module on the specified comparison side
-
getBslModuleContentStreamOnMerge
public static InputStream getBslModuleContentStreamOnMerge(BslModuleComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Returns the Bsl module content stream on the specified comparison side on merge.- Parameters:
node- the Bsl module comparison node to get content stream for, cannot benullmergeSession- the merge session, cannot benullside- the comparison side to get content stream on, cannot benullfilePathConverter- the qualified name file path converted, cannot benull- Returns:
- the Bsl module content stream or
nullif there is no module on the specified comparison side
-
getTrimmedLocalizedModuleSymlink
public static String getTrimmedLocalizedModuleSymlink(String symlink, ISymbolicLinkLocalizer symbolicLinkLocalizer) Returns the trimmed localized Bsl module symlink.- Parameters:
symlink- the Bsl module symlink to localize, cannot benullsymbolicLinkLocalizer- the symbolic link localizer, cannot benull- Returns:
- the trimmed localized Bsl module symlink, never
null
-
getLocalizedBslModuleName
public static String getLocalizedBslModuleName(String symlink, String comparisonSideName, ISymbolicLinkLocalizer symbolicLinkLocalizer) Returns the localized Bsl module node name.- Parameters:
symlink- the Bsl module node symlink, cannot benullcomparisonSideName- the comparison side name, cannot benullsymbolicLinkLocalizer- the symbolic link localizer, cannot benull- Returns:
- the localized Bsl module node name, never
null
-
mergeModuleUsingExternalTool
public static ExternalMergeToolExecutionStatus mergeModuleUsingExternalTool(BslModuleComparisonNode node, IComparisonSession session, ExternalMergeToolConfiguration externalMergeToolConfiguration, int timeout, boolean runAutoMergeByDefault, String mainComparisonSideName, String otherComparisonSideName, File mergeResultFile, IQualifiedNameFilePathConverter filePathConverter, ISymbolicLinkLocalizer symbolicLinkLocalizer) throws IOException Merges the Bsl module using an external tool for the specified node.- Parameters:
node- the Bsl module node, should not be one side, cannot benullsession- the comparison session, cannot benullexternalMergeToolConfiguration- the external merge tool configuration, cannot benulltimeout- session timeout for exteral tool executionrunAutoMergeByDefault-trueif needed to run automatic merge by default if possible,falseotherwisemainComparisonSideName- the main comparison side name, cannot benullotherComparisonSideName- the other comparison side name, cannot benullmergeResultFile- the file to store merge result, cannot benullfilePathConverter- the file path converter, cannot benullsymbolicLinkLocalizer- the symbolic link localizer, cannot benull- Returns:
- the external merge tool execution status, never
null - Throws:
IOException- if failed to read Bsl module content
-