java comparisonSettingsWhenComparingFiles.java
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java comparisonSettingsWhenComparingFiles.java相关的知识,希望对你有一定的参考价值。
// For complete examples and data files, please go to https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java
String sourcePath = Utilities.sourcePath + sourceFile;
String targetPath = Utilities.targetPath + targetFile;
ComparisonSettings settings = new ComparisonSettings();
settings.setGenerateSummaryPage(true);
settings.setShowDeletedContent(true);
settings.setStyleChangeDetection(true);
//settings.setDetailLevel(DetailLevel.Low);
/**WordsSeparatorChars is array that contain separators for compared text**/
//settings.setWordsSeparatorChars(new char[] {' '});
/**setting to draw frames for shapes in Comparison.Words**/
//settings.setUseFramesForDelInsElements(false);
/**Inserted, deleted and style changed items styles setting**/
/*
settings.getInsertedItemsStyle().setColor(Color.LIGHT_GRAY);
settings.getInsertedItemsStyle().setBeginSeparatorString("<inserted>");
settings.getInsertedItemsStyle().setEndSeparatorString("</inserted>");
settings.getDeletedItemsStyle().setColor(Color.CYAN);
settings.getDeletedItemsStyle().setBeginSeparatorString("<deleted>");
settings.getDeletedItemsStyle().setEndSeparatorString("</deleted>");
settings.getStyleChangedItemsStyle().setColor(Color.BLUE);
settings.getStyleChangedItemsStyle().setBeginSeparatorString("<style>");
settings.getStyleChangedItemsStyle().setEndSeparatorString("</style>");
*/
Comparer comparer = new Comparer();
ICompareResult result = comparer.compare(sourcePath, targetPath,settings);
result.saveDocument(Utilities.outputFileName(extension));
以上是关于java comparisonSettingsWhenComparingFiles.java的主要内容,如果未能解决你的问题,请参考以下文章
Java 布尔运算
java [Java] Java常用代码#java
Java - 35 Java 实例
Java While 循环
Java 字符串
Java If ... Else