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.
-
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, String funcName) Output a hunk headerMethods inherited from class org.eclipse.jgit.diff.DiffFormatter
close, flush, format, format, 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, writeHunkHeader, writeLine, writeRemovedLine
-
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, String funcName) throws IOException Description copied from class:DiffFormatterOutput a hunk header- Overrides:
writeHunkHeaderin classDiffFormatter- Parameters:
aStartLine- within first sourceaEndLine- within first sourcebStartLine- within second sourcebEndLine- within second sourcefuncName- function name of this hunk- Throws:
IOException- if an IO error occurred
-
formatIndexLine
Description copied from class:DiffFormatterFormat 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.
-