Skip to content

Commit a8d968c

Browse files
committed
added some documentation
1 parent 89f2659 commit a8d968c

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/main/java/com/github/difflib/text/DiffRowGenerator.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ public Builder ignoreWhiteSpaces(boolean val) {
400400
}
401401

402402
/**
403-
* Give the originial old and new text lines to Diffrow without any additional processing.
403+
* Give the originial old and new text lines to Diffrow without any additional processing and without any tags to
404+
* highlight the change.
404405
*
405406
* @param val the value to set. Default: false.
406407
* @return builder with configured reportLinesUnWrapped parameter
@@ -433,7 +434,7 @@ public Builder newTag(Function<Boolean, String> generator) {
433434
}
434435

435436
/**
436-
* Set the column with of generated lines of original and revised texts.
437+
* Set the column width of generated lines of original and revised texts.
437438
*
438439
* @param width the width to set. Making it < 0 doesn't have any sense. Default 80. @return builder with config
439440
* ured ignoreBlankLines parameter
@@ -466,19 +467,38 @@ public Builder mergeOriginalRevised(boolean mergeOriginalRevised) {
466467
}
467468

468469
/**
469-
* Per default each character is separatly processed. This variant introduces processing by word, which should
470-
* deliver no in word changes.
470+
* Per default each character is separatly processed. This variant introduces processing by word, which does not
471+
* deliver in word changes. Therefore the whole word will be tagged as changed:
472+
*
473+
* <pre>
474+
* false: (aBa : aba) -- changed: a(B)a : a(b)a
475+
* true: (aBa : aba) -- changed: (aBa) : (aba)
476+
* </pre>
471477
*/
472478
public Builder inlineDiffByWord(boolean inlineDiffByWord) {
473479
inlineDiffSplitter = inlineDiffByWord ? SPLITTER_BY_WORD : SPLITTER_BY_CHARACTER;
474480
return this;
475481
}
476482

483+
/**
484+
* To provide some customized splitting a splitter can be provided. Here someone could think about sentence splitter,
485+
* comma splitter or stuff like that.
486+
*
487+
* @param inlineDiffSplitter
488+
* @return
489+
*/
477490
public Builder inlineDiffBySplitter(Function<String, List<String>> inlineDiffSplitter) {
478491
this.inlineDiffSplitter = inlineDiffSplitter;
479492
return this;
480493
}
481494

495+
/**
496+
* By default DiffRowGenerator preprocesses lines for HTML output. Tabs and special HTML characters like "&lt;"
497+
* are replaced with its encoded value. To change this you can provide a customized line normalizer here.
498+
*
499+
* @param lineNormalizer
500+
* @return
501+
*/
482502
public Builder lineNormalizer(Function<String, String> lineNormalizer) {
483503
this.lineNormalizer = lineNormalizer;
484504
return this;

0 commit comments

Comments
 (0)