Package com.day.util.diff
Class DefaultChangeListener
java.lang.Object
com.day.util.diff.DefaultChangeListener
- All Implemented Interfaces:
ChangeListener
Provides a default output for a diff.
-
Field Summary
Fields inherited from interface com.day.util.diff.ChangeListener
CVS_ID -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new default change listener that will write to the given writer.DefaultChangeListener(PrintWriter out, boolean debug) Creates a new default change listener that will write to the given writer. -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked after a change finished.voidonChangeStart(int leftLine, int leftLen, int rightLine, int rightLen) Invoked before a change starts.voidonDeleted(int leftLine, int rightLine, Document.Element text) Invoked for a deleted elementvoidonDocumentsEnd(Document left, Document right) Invoked after the iteration over the changes finished.voidonDocumentsStart(Document left, Document right) Invoked before the iteration over the changes start.voidonInserted(int leftLine, int rightLine, Document.Element text) Invoked for an inserted elementvoidonUnmodified(int leftLine, int rightLine, Document.Element text) Invoked for an unmodified element
-
Constructor Details
-
DefaultChangeListener
Creates a new default change listener that will write to the given writer.- Parameters:
out- the writer
-
DefaultChangeListener
Creates a new default change listener that will write to the given writer. if debug istruethe line numbers are also included in the output.- Parameters:
out- the writerdebug- flag
-
-
Method Details
-
onDocumentsStart
Invoked before the iteration over the changes start.- Specified by:
onDocumentsStartin interfaceChangeListener- Parameters:
left- the left documentright- the right document
-
onDocumentsEnd
Invoked after the iteration over the changes finished.- Specified by:
onDocumentsEndin interfaceChangeListener- Parameters:
left- the left documentright- the right document
-
onChangeStart
public void onChangeStart(int leftLine, int leftLen, int rightLine, int rightLen) Invoked before a change starts.- Specified by:
onChangeStartin interfaceChangeListener- Parameters:
leftLine- the index of the left element of this change.leftLen- the number of changed left elements.rightLine- the index of the right element of this change.rightLen- the number of changed right elements.
-
onChangeEnd
public void onChangeEnd()Invoked after a change finished.- Specified by:
onChangeEndin interfaceChangeListener
-
onUnmodified
Invoked for an unmodified element- Specified by:
onUnmodifiedin interfaceChangeListener- Parameters:
leftLine- the index of the left elementrightLine- the index of the right elementtext- the element
-
onDeleted
Invoked for a deleted element- Specified by:
onDeletedin interfaceChangeListener- Parameters:
leftLine- the index of the left elementrightLine- the index of the right elementtext- the element
-
onInserted
Invoked for an inserted element- Specified by:
onInsertedin interfaceChangeListener- Parameters:
leftLine- the index of the left elementrightLine- the index of the right elementtext- the element
-