Package org.xwiki.diff.display
Interface InlineDiffDisplayer
-
@Role public interface InlineDiffDisplayer
Displays aDiffResult
as an in-line diff. An in-line diff is made of a list of chunks, each marked as added, removed or unmodified. For instance, if changes are computed at word level then you could have this in-line diff:the <del>quick</del><ins>sick</ins> brown fox
the <del>qu</del><ins>s</ins>ick brown fox
the <del>quick</del> brown fox the <ins>sick</ins> brown fox
- Since:
- 4.1RC1
- Version:
- $Id: 0f0a11a6c0853278c17a183b7e6f6f2f49737d42 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <E> List<InlineDiffChunk<E>>
display(DiffResult<E> diffResult)
Displays the given diff result as an in-line diff.
-
-
-
Method Detail
-
display
<E> List<InlineDiffChunk<E>> display(DiffResult<E> diffResult)
Displays the given diff result as an in-line diff. An in-line diff is a list of group of elements, each group being marked as added, removed or unmodified. The in-line diff includes all the elements from the previous and the next version that were compared to produce the diff:- the elements found in the previous version but not in the next version are marked at removed
- the elements from the next version that are not present in the previous version are marked as added
- the rest of the elements that are found in both versions are marked as unmodified.
Character
, then the in-line diff between "the quick fox" and "the sick fox" is:the <del>qu</del><ins>s</ins>ick fox
Character
s: "the " unmodified, "qu" removed, "s" added and "ick fox" unmodified.- Type Parameters:
E
- the type of elements that are add/remove/modified in the given diff result (specifies the granularity level of changes)- Parameters:
diffResult
- the diff result to be displayed- Returns:
- the list of chunks that form the in-line diff
-
-