java.lang.Object | |
↳ | com.atlassian.bitbucket.content.AbstractDiffContentCallback |
Convenience implementation of DiffContentCallback
that provides no-op implementations for all methods.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Offers
threads for any comments which should be included in the diff to the callback. | |||||||||||
Called to indicate a binary file differs.
| |||||||||||
Called upon reaching the end of the current overall diff, indicating no more changes exist for the current
source/destination pair.
| |||||||||||
Called to mark the start of an overall diff.
| |||||||||||
Called after the final
onDiffEnd(boolean) , after all diffs have been streamed. | |||||||||||
Called upon reaching the end of a hunk of segments within the current overall diff.
| |||||||||||
Delegates to
onHunkStart(int, int, int, int) , ignoring any provided context . | |||||||||||
This method is deprecated.
in 5.5 for removal in 6.0. Callbacks should implement
onHunkStart(int, int, int, int, String) instead.
| |||||||||||
Called upon reaching the end of a segment within the current hunk, where a segment may end either because lines
with a different type were encountered or because there are no more contiguous lines in the hunk.
| |||||||||||
Called to process a line within the current segment.
| |||||||||||
Called to mark the start of a new segment within the current hunk, containing one or more contiguous lines which
all share the same
type . | |||||||||||
Called before the first
onDiffStart(Path, Path) . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.bitbucket.content.DiffContentCallback
|
Offers threads
for any comments which should be included in the diff to the callback.
Threads with both File
and line
anchors may both be included in the provided stream.
Note: If this method is going to be invoked, it will always be invoked before the first invocation
of onDiffStart(Path, Path)
. This method will be called at most once. If multiple diffs are going
to be output to the callback, the paths
of the anchors may reference
any of the files whose diffs will follow. Reconciling anchors to diffs is left to the implementation.
threads | a stream of zero or more threads describing comments within the diff or diffs that will be streamed to the callback. It can only be consumed once |
---|
IOException |
---|
Called to indicate a binary file differs. The exact differences cannot be effectively conveyed, however, so no hunks/segments will be provided for binary files.
src | the source binary file |
---|---|
dst | the destination binary file |
IOException |
---|
Called upon reaching the end of the current overall diff, indicating no more changes exist for the current source/destination pair.
truncated | true if any segment or hunk in the diff had to be truncated; otherwise, false |
---|
IOException |
---|
Called to mark the start of an overall diff. The source and destination paths being compared, relative to their
containing repository
, are provided.
src | the source file being compared |
---|---|
dst | the destination file being compared |
IOException |
---|
Called after the final onDiffEnd(boolean)
, after all diffs have been streamed.
summary | ignored |
---|
IOException | may be thrown by derived classes |
---|
Called upon reaching the end of a hunk of segments within the current overall diff.
truncated | true if any segment in the hunk had to be truncated; otherwise, false |
---|
IOException |
---|
Delegates to onHunkStart(int, int, int, int)
, ignoring any provided context
.
srcLine | the line in the source file at which the hunk starts |
---|---|
srcSpan | the number of lines spanned by this hunk in the source file |
dstLine | the line in the destination file at which the hunk starts |
dstSpan | the number of lines spanned by this hunk in the destination file |
context | an optional context, such as a method or class name, for the hunk's lines |
IOException | may be thrown by derived classes |
---|
This method is deprecated.
in 5.5 for removal in 6.0. Callbacks should implement
onHunkStart(int, int, int, int, String)
instead.
Called to mark the start of a new hunk within the current overall diff, containing one or more contiguous segments of lines anchored at the provided line numbers in the source and destination files.
srcLine | the line in the source file at which the hunk starts |
---|---|
srcSpan | the number of lines spanned by this hunk in the source file |
dstLine | the line in the destination file at which the hunk starts |
dstSpan | the number of lines spanned by this hunk in the destination file |
IOException | May be thrown by implementations which perform I/O. |
---|
Called upon reaching the end of a segment within the current hunk, where a segment may end either because lines with a different type were encountered or because there are no more contiguous lines in the hunk.
Note: Internal restrictions may prevent streaming full segments if they are overly large. For example, if a new file containing tens of thousands of lines is added (or an existing file of such size is deleted), the resulting segment may be truncated.
truncated | true if the overall segment exceeded the maximum allowed lines, indicating one or more
lines were omitted from the segment; otherwise false to indicate all lines were sent |
---|
IOException |
---|
Called to process a line within the current segment.
Pull request
diffs may contain conflicts, if the pull request
cannot be merged cleanly. The marker
conveys this information.
null
: The line is not conflictedMARKER
: The line is a conflict markerOURS
: The line is conflicting, and is present in the merge targetTHEIRS
: The line is conflicting, and is present in the merge source
Note: Internal restrictions may prevent receiving the full line if it contains too many characters. When this
happens truncated
will be set to true
to indicate the line is not complete.
line | a single line of content |
---|---|
marker | indicates whether the line is conflicted and, if it is, which side of the conflict it's on |
truncated | true if the line exceeded the maximum allowed length and was truncated; otherwise,
false to indicate the line is complete |
IOException |
---|
Called to mark the start of a new segment within the current hunk, containing one or more contiguous lines which
all share the same type
.
type | the shared type for all lines in the new segment |
---|
IOException |
---|
Called before the first onDiffStart(Path, Path)
.
context | ignored |
---|
IOException | may be thrown by derived classes |
---|