DiffRowGenerator generator = new DiffRowGenerator.Builder().showInlineDiffs(true).
ignoreWhiteSpaces(true).columnWidth(100).build();
| Modifier and Type | Class and Description |
|---|---|
| public static class | DiffRowGenerator.
This class used for building the DiffRowGenerator. |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final boolean | |
| public static final BiPredicate | |
| private final BiPredicate | |
| public static final BiPredicate | |
| private final boolean | |
| private final Function | |
| public static final Function | |
| private final Function | |
| private final boolean | |
| private final BiFunction | |
| private final BiFunction | |
| private final Function | |
| private final boolean | |
| private final boolean | |
| private final boolean | |
| public static final Pattern | |
| public static final Function | SPLITTER_BY_CHARACTER
Splitting lines by character to achieve char by char diff checking. |
| public static final Function | SPLITTER_BY_WORD
Splitting lines by word to achieve word by word diff checking. |
| public static final Pattern |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| private DiffRow | |
| private DiffRow | |
| public static DiffRowGenerator. | |
| private List | decompressDeltas(AbstractDelta<String> delta)
Decompresses ChangeDeltas with different source and target size to a ChangeDelta with same size and a following InsertDelta or DeleteDelta. |
| public List | Returns: the DiffRows between original and revised textsthe original text original, List<String> the revised text revised)Get the DiffRows describing the difference between original and revised texts using the given patch. |
| public List | Returns: the DiffRows between original and revised textsthe original text original, Patch<String> the given patch patch)Generates the DiffRows describing the difference between original and revised texts using the given patch. |
| private List | |
| pack-priv List | |
| private String | |
| protected static final List | |
| private int | transformDeltaIntoDiffRow(final List<String> original, int endPos, List<DiffRow> diffRows, AbstractDelta<String> delta)
Transforms one patch delta into a DiffRow object. |
| pack-priv static void | wrapInTag(List<String> sequence, int
the position from which tag should start. The
counting start from a zero. startPosition, int the position before which tag should should be closed. endPosition, DiffRow.the tag generator tagGenerator,Wrap the elements in the sequence with the given tag |
| columnWidth | back to summary |
|---|---|
| private final int columnWidth | |
| decompressDeltas | back to summary |
|---|---|
| private final boolean decompressDeltas | |
| DEFAULT_EQUALIZER | back to summary |
|---|---|
| public static final BiPredicate<String, String> DEFAULT_EQUALIZER | |
| equalizer | back to summary |
|---|---|
| private final BiPredicate<String, String> equalizer | |
| IGNORE_WHITESPACE_EQUALIZER | back to summary |
|---|---|
| public static final BiPredicate<String, String> IGNORE_WHITESPACE_EQUALIZER | |
| ignoreWhiteSpaces | back to summary |
|---|---|
| private final boolean ignoreWhiteSpaces | |
| inlineDiffSplitter | back to summary |
|---|---|
| private final Function<String, List<String>> inlineDiffSplitter | |
| LINE_NORMALIZER_FOR_HTML | back to summary |
|---|---|
| public static final Function<String, String> LINE_NORMALIZER_FOR_HTML | |
| lineNormalizer | back to summary |
|---|---|
| private final Function<String, String> lineNormalizer | |
| mergeOriginalRevised | back to summary |
|---|---|
| private final boolean mergeOriginalRevised | |
| newTag | back to summary |
|---|---|
| private final BiFunction<DiffRow. | |
| oldTag | back to summary |
|---|---|
| private final BiFunction<DiffRow. | |
| processDiffs | back to summary |
|---|---|
| private final Function<String, String> processDiffs | |
| replaceOriginalLinefeedInChangesWithSpaces | back to summary |
|---|---|
| private final boolean replaceOriginalLinefeedInChangesWithSpaces | |
| reportLinesUnchanged | back to summary |
|---|---|
| private final boolean reportLinesUnchanged | |
| showInlineDiffs | back to summary |
|---|---|
| private final boolean showInlineDiffs | |
| SPLIT_BY_WORD_PATTERN | back to summary |
|---|---|
| public static final Pattern SPLIT_BY_WORD_PATTERN | |
| SPLITTER_BY_CHARACTER | back to summary |
|---|---|
| public static final Function<String, List<String>> SPLITTER_BY_CHARACTER Splitting lines by character to achieve char by char diff checking. | |
| SPLITTER_BY_WORD | back to summary |
|---|---|
| public static final Function<String, List<String>> SPLITTER_BY_WORD Splitting lines by word to achieve word by word diff checking. | |
| WHITESPACE_PATTERN | back to summary |
|---|---|
| public static final Pattern WHITESPACE_PATTERN | |
| DiffRowGenerator | back to summary |
|---|---|
| private DiffRowGenerator(DiffRowGenerator. | |
| adjustWhitespace | back to summary |
|---|---|
| private static String adjustWhitespace(String raw) | |
| buildDiffRow | back to summary |
|---|---|
| private DiffRow buildDiffRow(DiffRow. | |
| buildDiffRowWithoutNormalizing | back to summary |
|---|---|
| private DiffRow buildDiffRowWithoutNormalizing(DiffRow. | |
| create | back to summary |
|---|---|
| public static DiffRowGenerator. | |
| decompressDeltas | back to summary |
|---|---|
| private List Decompresses ChangeDeltas with different source and target size to a ChangeDelta with same size and a following InsertDelta or DeleteDelta. With this problems of building DiffRows getting smaller. | |
| generateDiffRows | back to summary |
|---|---|
| public List Get the DiffRows describing the difference between original and revised texts using the given patch. Useful for displaying side-by-side diff. | |
| generateDiffRows | back to summary |
|---|---|
| public List Generates the DiffRows describing the difference between original and revised texts using the given patch. Useful for displaying side-by-side diff. | |
| generateInlineDiffs | back to summary |
|---|---|
| private List Add the inline diffs for given delta
| |
| normalizeLines | back to summary |
|---|---|
| pack-priv List | |
| preprocessLine | back to summary |
|---|---|
| private String preprocessLine(String line) | |
| splitStringPreserveDelimiter | back to summary |
|---|---|
| protected static final List | |
| transformDeltaIntoDiffRow | back to summary |
|---|---|
| private int transformDeltaIntoDiffRow(final List<String> original, int endPos, List<DiffRow> diffRows, AbstractDelta<String> delta) Transforms one patch delta into a DiffRow object. | |
| wrapInTag | back to summary |
|---|---|
| pack-priv static void wrapInTag(List<String> sequence, int startPosition, int endPosition, DiffRow. Wrap the elements in the sequence with the given tag
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private boolean | |
| private BiPredicate | |
| private boolean | |
| private Function | |
| private Function | |
| private boolean | |
| private BiFunction | |
| private BiFunction | |
| private Function | |
| private boolean | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public DiffRowGenerator | |
| public DiffRowGenerator. | Returns: builder with config of column widththe width to set. Making it < 0 doesn't make any
sense. Default 80. width)Set the column width of generated lines of original and revised texts. |
| public DiffRowGenerator. | decompressDeltas(boolean decompressDeltas)
Deltas could be in a state, that would produce some unreasonable results within an inline diff. |
| public DiffRowGenerator. | Returns: builder with configured equalizer parameterequalizer for diff processing. equalizer)Provide an equalizer for diff processing. |
| public DiffRowGenerator. | Returns: builder with configured ignoreWhiteSpaces parameterthe value to set. Default: true. val)Ignore white spaces in generating diff rows or not. |
| public DiffRowGenerator. | inlineDiffBySplitter(Function<String, List<String>> inlineDiffSplitter)
To provide some customized splitting a splitter can be provided. |
| public DiffRowGenerator. | |
| public DiffRowGenerator. | lineNormalizer(Function<String, String> lineNormalizer)
By default DiffRowGenerator preprocesses lines for HTML output. |
| public DiffRowGenerator. | mergeOriginalRevised(boolean mergeOriginalRevised)
Merge the complete result within the original text. |
| public DiffRowGenerator. | |
| public DiffRowGenerator. | |
| public DiffRowGenerator. | |
| public DiffRowGenerator. | |
| public DiffRowGenerator. | |
| public DiffRowGenerator. | replaceOriginalLinefeedInChangesWithSpaces(boolean replace)
Sometimes it happens that a change contains multiple lines. |
| public DiffRowGenerator. | Returns: builder with configured reportLinesUnchanged parameterthe value to set. Default: false. val)Report all lines without markup on the old or new text. |
| public DiffRowGenerator. | Returns: builder with configured showInlineDiff parameterthe value to set. Default: false. val)Show inline diffs in generating diff rows or not. |
| columnWidth | back to summary |
|---|---|
| private int columnWidth | |
| decompressDeltas | back to summary |
|---|---|
| private boolean decompressDeltas | |
| equalizer | back to summary |
|---|---|
| private BiPredicate<String, String> equalizer | |
| ignoreWhiteSpaces | back to summary |
|---|---|
| private boolean ignoreWhiteSpaces | |
| inlineDiffSplitter | back to summary |
|---|---|
| private Function<String, List<String>> inlineDiffSplitter | |
| lineNormalizer | back to summary |
|---|---|
| private Function<String, String> lineNormalizer | |
| mergeOriginalRevised | back to summary |
|---|---|
| private boolean mergeOriginalRevised | |
| newTag | back to summary |
|---|---|
| private BiFunction<DiffRow. | |
| oldTag | back to summary |
|---|---|
| private BiFunction<DiffRow. | |
| processDiffs | back to summary |
|---|---|
| private Function<String, String> processDiffs | |
| replaceOriginalLinefeedInChangesWithSpaces | back to summary |
|---|---|
| private boolean replaceOriginalLinefeedInChangesWithSpaces | |
| reportLinesUnchanged | back to summary |
|---|---|
| private boolean reportLinesUnchanged | |
| showInlineDiffs | back to summary |
|---|---|
| private boolean showInlineDiffs | |
| Builder | back to summary |
|---|---|
| private Builder() | |
| build | back to summary |
|---|---|
| public DiffRowGenerator build() Build the DiffRowGenerator. If some parameters is not set, the default values are used.
| |
| columnWidth | back to summary |
|---|---|
| public DiffRowGenerator. Set the column width of generated lines of original and revised texts.
| |
| decompressDeltas | back to summary |
|---|---|
| public DiffRowGenerator. Deltas could be in a state, that would produce some unreasonable results within an inline diff. So the deltas are decompressed into smaller parts and rebuild. But this could result in more differences. | |
| equalizer | back to summary |
|---|---|
| public DiffRowGenerator. Provide an equalizer for diff processing.
| |
| ignoreWhiteSpaces | back to summary |
|---|---|
| public DiffRowGenerator. Ignore white spaces in generating diff rows or not.
| |
| inlineDiffBySplitter | back to summary |
|---|---|
| public DiffRowGenerator. To provide some customized splitting a splitter can be provided. Here someone could think about sentence splitter, comma splitter or stuff like that. | |
| inlineDiffByWord | back to summary |
|---|---|
| public DiffRowGenerator. Per default each character is separatly processed. This variant introduces processing by word, which does not deliver in word changes. Therefore the whole word will be tagged as changed: false: (aBa : aba) -- changed: a(B)a : a(b)a true: (aBa : aba) -- changed: (aBa) : (aba) | |
| lineNormalizer | back to summary |
|---|---|
| public DiffRowGenerator. By default DiffRowGenerator preprocesses lines for HTML output. Tabs and special HTML characters like "<" are replaced with its encoded value. To change this you can provide a customized line normalizer here. | |
| mergeOriginalRevised | back to summary |
|---|---|
| public DiffRowGenerator. Merge the complete result within the original text. This makes sense for one line display. | |
| newTag | back to summary |
|---|---|
| public DiffRowGenerator. Generator for New-Text-Tags. | |
| newTag | back to summary |
|---|---|
| public DiffRowGenerator. Generator for New-Text-Tags. | |
| oldTag | back to summary |
|---|---|
| public DiffRowGenerator. Generator for Old-Text-Tags.
| |
| oldTag | back to summary |
|---|---|
| public DiffRowGenerator. Generator for Old-Text-Tags.
| |
| processDiffs | back to summary |
|---|---|
| public DiffRowGenerator. Processor for diffed text parts. Here e.g. whitecharacters could be replaced by something visible. | |
| replaceOriginalLinefeedInChangesWithSpaces | back to summary |
|---|---|
| public DiffRowGenerator. Sometimes it happens that a change contains multiple lines. If there is no correspondence in old and new. To keep the merged line more readable the linefeeds could be replaced by spaces. | |
| reportLinesUnchanged | back to summary |
|---|---|
| public DiffRowGenerator. Report all lines without markup on the old or new text.
| |
| showInlineDiffs | back to summary |
|---|---|
| public DiffRowGenerator. Show inline diffs in generating diff rows or not.
| |