Class DocumentDiff3
java.lang.Object
org.apache.jackrabbit.vault.util.diff.DocumentDiff3
Implements a tree-way diff between a base document and 2 dervied ones.
The result of the diff operation is a list of
Hunk3 that can
record the changes and conflicts.-
Constructor Summary
ConstructorsConstructorDescriptionDocumentDiff3(Document base, Document left, Document right) Creates a new document diff 3 object. -
Method Summary
Modifier and TypeMethodDescriptiongetHunks()Returns a chain ofHunk3s that contain the modifications.booleanIndicates if any of the hunks has a conflict.voidwrite(StringBuffer buf, String lineSeparator, boolean showBase) Writes the resulting document to the given string buffer. this may include conflicting regions.voidwrite(DiffWriter w, boolean showBase) Writes the resulting document to the given write. this may include conflicting regions.
-
Constructor Details
-
DocumentDiff3
Creates a new document diff 3 object.- Parameters:
base- the base documentleft- the left documentright- the right document
-
-
Method Details
-
getHunks
Returns a chain ofHunk3s that contain the modifications.- Returns:
- a chain of
Hunk3s.
-
hasConflicts
public boolean hasConflicts()Indicates if any of the hunks has a conflict.- Returns:
trueif any of the hunks has a conflict.
-
write
Writes the resulting document to the given string buffer. this may include conflicting regions.- Parameters:
buf- the string buffer to write tolineSeparator- the line separator to useshowBase- if set totruethe base section of a conflict is also included in the output.
-
write
Writes the resulting document to the given write. this may include conflicting regions.- Parameters:
w- the writer to write toshowBase- if set totruethe base section of a conflict is also included in the output.- Throws:
IOException- if an I/O error occurs
-