Package com._1c.g5.v8.dt.bsl.compare
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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InputStream
getBslModuleContentStream(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
Returns the Bsl module content stream on the specified comparison side.static InputStream
getBslModuleContentStreamOnMerge(BslModuleComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
Returns the Bsl module content stream on the specified comparison side on merge.static String
getLocalizedBslModuleName(String symlink, String comparisonSideName, ISymbolicLinkLocalizer symbolicLinkLocalizer)
Returns the localized Bsl module node name.static String
getTrimmedLocalizedModuleSymlink(String symlink, ISymbolicLinkLocalizer symbolicLinkLocalizer)
Returns the trimmed localized Bsl module symlink.static ExternalMergeToolExecutionStatus
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.IParseResult
parseBslModuleContent(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
Parses the Bsl module content stream on the specified comparison side.static org.eclipse.xtext.parser.IParseResult
parseBslModuleContent(InputStream inputStream)
Parses the Bsl module content stream.static BslModuleContentInfo
readBslModuleContent(BslModuleComparisonNode node, IComparisonSession session, ComparisonSide side, boolean detectIsBinary, IQualifiedNameFilePathConverter filePathConverter)
Reads the Bsl module content on the specified comparison side.static String
readBslModuleContent(BslModuleSectionComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
Reads the Bsl module content on the specified comparison side.static String
readBslModuleContentOnMerge(BslModuleComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
Reads the Bsl module content on the specified comparison side on merge.
-
-
-
Method Detail
-
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 benull
session
- the comparison session, cannot benull
side
- the comparison side to get content on, cannot benull
detectIsBinary
- 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 benull
session
- the comparison session, cannot benull
side
- the comparison side to get content on, cannot benull
filePathConverter
- 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 benull
mergeSession
- the merge session, cannot benull
side
- the comparison side to get content on, cannot benull
filePathConverter
- 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 benull
session
- the comparison session, cannot benull
side
- the comparison side to parse content on, cannot benull
filePathConverter
- the qualified name file path converted, cannot benull
- 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 benull
- Returns:
- the result of the parsing or
null
if 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 benull
session
- the comparison session, cannot benull
side
- the comparison side to get content stream on, cannot benull
filePathConverter
- the qualified name file path converted, cannot benull
- Returns:
- the Bsl module content stream or
null
if 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 benull
mergeSession
- the merge session, cannot benull
side
- the comparison side to get content stream on, cannot benull
filePathConverter
- the qualified name file path converted, cannot benull
- Returns:
- the Bsl module content stream or
null
if 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 benull
symbolicLinkLocalizer
- 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 benull
comparisonSideName
- the comparison side name, cannot benull
symbolicLinkLocalizer
- 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 benull
session
- the comparison session, cannot benull
externalMergeToolConfiguration
- the external merge tool configuration, cannot benull
timeout
- session timeout for exteral tool executionrunAutoMergeByDefault
-true
if needed to run automatic merge by default if possible,false
otherwisemainComparisonSideName
- the main comparison side name, cannot benull
otherComparisonSideName
- the other comparison side name, cannot benull
mergeResultFile
- the file to store merge result, cannot benull
filePathConverter
- the file path converter, cannot benull
symbolicLinkLocalizer
- the symbolic link localizer, cannot benull
- Returns:
- the external merge tool execution status, never
null
- Throws:
IOException
- if failed to read Bsl module content
-
-