public 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 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.
|
| 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) |
static void |
wrapInTag(List<String> sequence,
int startPosition,
int endPosition,
Function<Boolean,String> generator)
Wrap the elements in the sequence with the given tag
|
public static final Pattern SPLIT_BY_WORD_PATTERN
public static final BiPredicate<String,String> IGNORE_WHITESPACE_EQUALIZER
public static final BiPredicate<String,String> DEFAULT_EQUALIZER
public static final Function<String,List<String>> SPLITTER_BY_WORD
public static DiffRowGenerator.Builder create()
public List<DiffRow> generateDiffRows(List<String> original, List<String> revised) throws DiffException
original - the original textrevised - the revised textDiffExceptionpublic List<DiffRow> generateDiffRows(List<String> original, Patch<String> patch) throws DiffException
original - the original textrevised - the revised textpatch - the given patchDiffExceptionpublic static void wrapInTag(List<String> sequence, int startPosition, int endPosition, Function<Boolean,String> generator)
startPosition - the position from which tag should start. The counting start from a zero.endPosition - the position before which tag should should be closed.tag - the tag name without angle brackets, just a wordcssClass - the optional css classCopyright © 2009–2017 java-diff-utils. All rights reserved.