Top Description Fields Constructors Methods
org.eclipse.jgit.diff

public Class PatchIdDiffFormatter

extends DiffFormatter
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.security.DigestOutputStream, .MessageDigest, org.eclipse.jgit.lib.Constants, .ObjectId, org.eclipse.jgit.util.io.NullOutputStream

A DiffFormatter used to calculate the patch-id of the diff.

Field Summary

Modifier and TypeField and Description
private final MessageDigest

Constructor Summary

AccessConstructor and Description
public
PatchIdDiffFormatter()

Initialize a formatter to compute a patch id.

Method Summary

Modifier and TypeMethod and Description
protected void
formatIndexLine(OutputStream
the stream the formatter will write line data to
o
,
DiffEntry
the DiffEntry to create the FileHeader for
ent
)

Overrides org.eclipse.jgit.diff.DiffFormatter.formatIndexLine.

Format index line

public ObjectId

Returns:

the patch id calculated for the provided diff.
getCalulatedPatchId
()

Should be called after having called one of the format methods

protected void
writeHunkHeader(int
within first source
aStartLine
,
int
within first source
aEndLine
,
int
within second source
bStartLine
,
int
within second source
bEndLine
,
String
function name of this hunk
funcName
)

Overrides org.eclipse.jgit.diff.DiffFormatter.writeHunkHeader.

Output a hunk header

Inherited from org.eclipse.jgit.diff.DiffFormatter:
closeflushformatformatformatformatformatformatformatformatformatformatGitDiffFirstHeaderLinegetNewPrefixgetOldPrefixgetOutputStreamgetPathFiltergetRenameDetectorisDetectRenamesscanscanscansetAbbreviationLengthsetBinaryFileThresholdsetContextsetDetectRenamessetDiffAlgorithmsetDiffComparatorsetNewPrefixsetOldPrefixsetPathFiltersetProgressMonitorsetQuotePathssetReadersetRepositorytoFileHeaderwriteAddedLinewriteContextLinewriteHunkHeaderwriteLinewriteRemovedLine

Field Detail

digestback to summary
private final MessageDigest digest

Constructor Detail

PatchIdDiffFormatterback to summary
public PatchIdDiffFormatter()

Initialize a formatter to compute a patch id.

Method Detail

formatIndexLineback to summary
protected void formatIndexLine(OutputStream o, DiffEntry ent) throws IOException

Overrides org.eclipse.jgit.diff.DiffFormatter.formatIndexLine.

Doc from org.eclipse.jgit.diff.DiffFormatter.formatIndexLine.

Format index line

Parameters
o:OutputStream

the stream the formatter will write line data to

ent:DiffEntry

the DiffEntry to create the FileHeader for

Annotations
@Override
Exceptions
IOException:
writing to the supplied stream failed.
getCalulatedPatchIdback to summary
public ObjectId getCalulatedPatchId()

Should be called after having called one of the format methods

Returns:ObjectId

the patch id calculated for the provided diff.

writeHunkHeaderback to summary
protected void writeHunkHeader(int aStartLine, int aEndLine, int bStartLine, int bEndLine, String funcName) throws IOException

Overrides org.eclipse.jgit.diff.DiffFormatter.writeHunkHeader.

Doc from org.eclipse.jgit.diff.DiffFormatter.writeHunkHeader.

Output a hunk header

Parameters
aStartLine:int

within first source

aEndLine:int

within first source

bStartLine:int

within second source

bEndLine:int

within second source

funcName:String

function name of this hunk

Annotations
@Override
Exceptions
IOException:
if an IO error occurred