- java.lang.Object
-
- org.eclipse.jgit.diff.DiffFormatter
-
- org.eclipse.jgit.diff.PatchIdDiffFormatter
-
- All Implemented Interfaces:
AutoCloseable
public class PatchIdDiffFormatter extends DiffFormatter
A DiffFormatter used to calculate the patch-id of the diff.
-
-
Constructor Summary
Constructors Constructor Description PatchIdDiffFormatter()Initialize a formatter to compute a patch id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidformatIndexLine(OutputStream o, DiffEntry ent)Format index lineObjectIdgetCalulatedPatchId()Should be called after having called one of the format methodsprotected voidwriteHunkHeader(int aStartLine, int aEndLine, int bStartLine, int bEndLine)Output a hunk header-
Methods 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
-
-
-
-
Method Detail
-
getCalulatedPatchId
public ObjectId 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 IOExceptionOutput a hunk header- Overrides:
writeHunkHeaderin classDiffFormatter- Parameters:
aStartLine- within first sourceaEndLine- within first sourcebStartLine- within second sourcebEndLine- within second source- Throws:
IOException
-
formatIndexLine
protected void formatIndexLine(OutputStream o, DiffEntry ent) throws IOException
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.
-
-