public final class DiffRowGenerator extends Object
DiffRowGenerator generator = new DiffRowGenerator.Builder().showInlineDiffs(true).
ignoreWhiteSpaces(true).columnWidth(100).build();
Modifier and Type | Class and Description |
---|---|
static class |
DiffRowGenerator.Builder
This class used for building the DiffRowGenerator.
|
Modifier and Type | Field and Description |
---|---|
static BiPredicate<String,String> |
DEFAULT_EQUALIZER |
static BiPredicate<String,String> |
IGNORE_WHITESPACE_EQUALIZER |
static Function<String,String> |
LINE_NORMALIZER_FOR_HTML |
static Pattern |
SPLIT_BY_WORD_PATTERN |
static Function<String,List<String>> |
SPLITTER_BY_CHARACTER
Splitting lines by character to achieve char by char diff checking.
|
static Function<String,List<String>> |
SPLITTER_BY_WORD
Splitting lines by word to achieve word by word diff checking.
|
static Pattern |
WHITESPACE_PATTERN |
Modifier and Type | Method and Description |
---|---|
static DiffRowGenerator.Builder |
create() |
List<DiffRow> |
generateDiffRows(List<String> original,
List<String> revised)
Get the DiffRows describing the difference between original and revised texts using the given
patch.
|
List<DiffRow> |
generateDiffRows(List<String> original,
Patch<String> patch)
Generates the DiffRows describing the difference between original and revised texts using the
given patch.
|
protected static List<String> |
splitStringPreserveDelimiter(String str,
Pattern SPLIT_PATTERN) |
public static final BiPredicate<String,String> DEFAULT_EQUALIZER
public static final BiPredicate<String,String> IGNORE_WHITESPACE_EQUALIZER
public static final Function<String,List<String>> SPLITTER_BY_CHARACTER
public static final Pattern SPLIT_BY_WORD_PATTERN
public static final Function<String,List<String>> SPLITTER_BY_WORD
public static final Pattern WHITESPACE_PATTERN
public static DiffRowGenerator.Builder create()
protected static final List<String> splitStringPreserveDelimiter(String str, Pattern SPLIT_PATTERN)
public List<DiffRow> generateDiffRows(List<String> original, List<String> revised)
original
- the original textrevised
- the revised textpublic List<DiffRow> generateDiffRows(List<String> original, Patch<String> patch)
original
- the original textpatch
- the given patchCopyright © 2009–2020 java-diff-utils. All rights reserved.