com.atlassian.confluence.diff
Class LineLevelDiffer

java.lang.Object
  extended by com.atlassian.confluence.diff.LineLevelDiffer

public class LineLevelDiffer
extends Object

Wraps an Apache Diff with Atlassian goodness, making it closer to how a human expects the difference to appear.


Constructor Summary
LineLevelDiffer()
           
 
Method Summary
static List<ChangeChunk> diff(String[] originalContent, String[] revisedContent, int linesOfContext)
           
static List<ChangeChunk> diff(String[] originalContent, String[] revisedContent, int linesContext, boolean ignoreWhiteSpace)
          Diff lines of text, showing all context.
static List<ChangeChunk> diff(String origContent, String revdContent)
           
static List<ChangeChunk> diff(String origContent, String revdContent, boolean ignoreWhiteSpace)
           
static List<ChangeChunk> diff(String origContent, String revdContent, int linesContext, boolean ignoreWhiteSpace)
           
static List<ChangeChunk> diffLines(String[] origLines, String[] revdLines, int linesOfContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineLevelDiffer

public LineLevelDiffer()
Method Detail

diff

public static List<ChangeChunk> diff(String[] originalContent,
                                     String[] revisedContent,
                                     int linesContext,
                                     boolean ignoreWhiteSpace)
                              throws org.apache.commons.jrcs.diff.DifferentiationFailedException
Diff lines of text, showing all context.

Parameters:
ignoreWhiteSpace - Do not show added/removed spaces and newlines as changes.
Throws:
org.apache.commons.jrcs.diff.DifferentiationFailedException

diffLines

public static List<ChangeChunk> diffLines(String[] origLines,
                                          String[] revdLines,
                                          int linesOfContext)
                                   throws org.apache.commons.jrcs.diff.DifferentiationFailedException
Throws:
org.apache.commons.jrcs.diff.DifferentiationFailedException

diff

public static List<ChangeChunk> diff(String origContent,
                                     String revdContent)
                              throws org.apache.commons.jrcs.diff.DifferentiationFailedException
Throws:
org.apache.commons.jrcs.diff.DifferentiationFailedException

diff

public static List<ChangeChunk> diff(String[] originalContent,
                                     String[] revisedContent,
                                     int linesOfContext)
                              throws org.apache.commons.jrcs.diff.DifferentiationFailedException
Throws:
org.apache.commons.jrcs.diff.DifferentiationFailedException

diff

public static List<ChangeChunk> diff(String origContent,
                                     String revdContent,
                                     boolean ignoreWhiteSpace)
                              throws org.apache.commons.jrcs.diff.DifferentiationFailedException
Throws:
org.apache.commons.jrcs.diff.DifferentiationFailedException

diff

public static List<ChangeChunk> diff(String origContent,
                                     String revdContent,
                                     int linesContext,
                                     boolean ignoreWhiteSpace)
                              throws org.apache.commons.jrcs.diff.DifferentiationFailedException
Throws:
org.apache.commons.jrcs.diff.DifferentiationFailedException


Copyright © 2003-2012 Atlassian. All Rights Reserved.