com.liferay.portal.kernel.util
Class DiffUtil
java.lang.Object
com.liferay.portal.kernel.util.DiffUtil
public class DiffUtil
- extends java.lang.Object
View Source
This class can compare two different versions of a text. Source refers to
the earliest version of the text and target refers to a modified version of
source. Changes are considered either as a removal from the source or as an
addition to the target. This class detects changes to an entire line and also
detects changes within lines, such as, removal or addition of characters.
Take a look at DiffTest
to see the expected inputs and outputs.
- Author:
- Bruno Farache
- See Also:
DiffUtil
Method Summary |
static java.util.List<DiffResult>[] |
diff(java.io.Reader source,
java.io.Reader target)
|
static java.util.List<DiffResult>[] |
diff(java.io.Reader source,
java.io.Reader target,
java.lang.String addedMarkerStart,
java.lang.String addedMarkerEnd,
java.lang.String deletedMarkerStart,
java.lang.String deletedMarkerEnd,
int margin)
|
static Diff |
getDiff()
|
void |
setDiff(Diff diff)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DiffUtil
public DiffUtil()
diff
public static java.util.List<DiffResult>[] diff(java.io.Reader source,
java.io.Reader target)
diff
public static java.util.List<DiffResult>[] diff(java.io.Reader source,
java.io.Reader target,
java.lang.String addedMarkerStart,
java.lang.String addedMarkerEnd,
java.lang.String deletedMarkerStart,
java.lang.String deletedMarkerEnd,
int margin)
getDiff
public static Diff getDiff()
setDiff
public void setDiff(Diff diff)