Package org.eclipse.jgit.diff
Class PatchIdDiffFormatter
java.lang.Object
org.eclipse.jgit.diff.DiffFormatter
org.eclipse.jgit.diff.PatchIdDiffFormatter
- All Implemented Interfaces:
AutoCloseable
A DiffFormatter used to calculate the patch-id of the diff.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidformatIndexLine(OutputStream o, DiffEntry ent) Format index lineShould be called after having called one of the format methodsprotected voidwriteHunkHeader(int aStartLine, int aEndLine, int bStartLine, int bEndLine) Output a hunk headerMethods inherited from class org.eclipse.jgit.diff.DiffFormatter
close, flush, format, format, format, format, format, format, format, formatGitDiffFirstHeaderLine, getNewPrefix, getOldPrefix, getOutputStream, getPathFilter, getRenameDetector, isDetectRenames, scan, scan, scan, setAbbreviationLength, setBinaryFileThreshold, setContext, setDetectRenames, setDiffAlgorithm, setDiffComparator, setNewPrefix, setOldPrefix, setPathFilter, setProgressMonitor, setQuotePaths, setReader, setRepository, toFileHeader, writeAddedLine, writeContextLine, writeLine, writeRemovedLine
-
Field Details
-
digest
-
-
Constructor Details
-
PatchIdDiffFormatter
public PatchIdDiffFormatter()Initialize a formatter to compute a patch id.
-
-
Method Details
-
getCalulatedPatchId
Should be called after having called one of the format methods- Returns:
- the patch id calculated for the provided diff.
-
writeHunkHeader
protected void writeHunkHeader(int aStartLine, int aEndLine, int bStartLine, int bEndLine) throws IOException Output a hunk header- Overrides:
writeHunkHeaderin classDiffFormatter- Parameters:
aStartLine- within first sourceaEndLine- within first sourcebStartLine- within second sourcebEndLine- within second source- Throws:
IOException
-
formatIndexLine
Format index line- Overrides:
formatIndexLinein classDiffFormatter- Parameters:
o- the stream the formatter will write line data toent- the DiffEntry to create the FileHeader for- Throws:
IOException- writing to the supplied stream failed.
-