|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.liferay.util.diff.DiffUtil
DiffUtil
public class DiffUtil
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.
Field Summary | |
---|---|
static String |
CLOSE_DEL
Deprecated. |
static String |
CLOSE_INS
Deprecated. |
static String |
CONTEXT_LINE
Deprecated. |
static String |
OPEN_DEL
Deprecated. |
static String |
OPEN_INS
Deprecated. |
Constructor Summary | |
---|---|
DiffUtil()
Deprecated. |
Method Summary | |
---|---|
static List<DiffResult>[] |
diff(Reader source,
Reader target)
Deprecated. This is a diff method with default values. |
static List<DiffResult>[] |
diff(Reader source,
Reader target,
String addedMarkerStart,
String addedMarkerEnd,
String deletedMarkerStart,
String deletedMarkerEnd,
int margin)
Deprecated. The main entrance of this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CLOSE_DEL
public static final String CLOSE_INS
public static final String CONTEXT_LINE
public static final String OPEN_DEL
public static final String OPEN_INS
Constructor Detail |
---|
public DiffUtil()
Method Detail |
---|
public static List<DiffResult>[] diff(Reader source, Reader target)
source
- the source texttarget
- the modified version of the source text
DiffResults
, the
first element contains DiffResults related to changes in source
and the second element to changes in targetpublic static List<DiffResult>[] diff(Reader source, Reader target, String addedMarkerStart, String addedMarkerEnd, String deletedMarkerStart, String deletedMarkerEnd, int margin)
DiffResults
.
source
- the source texttarget
- the modified version of the source textaddedMarkerStart
- the marker to indicate the start of text added
to the sourceaddedMarkerEnd
- the marker to indicate the end of text added to
the sourcedeletedMarkerStart
- the marker to indicate the start of text
deleted from the sourcedeletedMarkerEnd
- the marker to indicate the end of text deleted
from the sourcemargin
- the vertical margin to use in displaying differences
between changed line changes
DiffResults
, the
first element contains DiffResults related to changes in source
and the second element to changes in target
|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |