|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdifflib.DiffRowGenerator
public class DiffRowGenerator
This class for generating DiffRows for side-by-sidy view.
You can customize the way of generating. For example, show inline diffs on not, ignoring
white spaces or/and blank lines and so on. All parameters for generating are optional. If you do
not specify them, the class will use the default values.
These values are:
showInlineDiffs = false;
ignoreWhiteSpaces = true;
ignoreBlankLines = true;
...
For instantiating the DiffRowGenerator you should use the its builder. Like in example
DiffRowGenerator generator = new DiffRowGenerator.Builder().showInlineDiffs(true).
ignoreWhiteSpaces(true).columnWidth(100).build();
Nested Class Summary | |
---|---|
static class |
DiffRowGenerator.Builder
This class used for building the DiffRowGenerator. |
Method Summary | |
---|---|
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,
List<String> revised,
Patch<String> patch)
Generates the DiffRows describing the difference between original and revised texts using the given patch. |
static LinkedList<String> |
wrapInTag(LinkedList<String> sequence,
int startPosition,
int endPosition,
String tag,
String cssClass)
Wrap the elements in the sequence with the given tag |
static String |
wrapInTag(String line,
String tag,
String cssClass)
Wrap the given line with the given tag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public List<DiffRow> generateDiffRows(List<String> original, List<String> revised)
original
- the original textrevised
- the revised text
public List<DiffRow> generateDiffRows(List<String> original, List<String> revised, Patch<String> patch)
original
- the original textrevised
- the revised textpatch
- the given patch
public static LinkedList<String> wrapInTag(LinkedList<String> sequence, int startPosition, int endPosition, String tag, String cssClass)
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 classpublic static String wrapInTag(String line, String tag, String cssClass)
line
- the given linetag
- the tag name without angle brackets, just a wordcssClass
- the optional css class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |