public class SVNPatchHunk
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SVNPatchHunk.SVNPatchHunkRange |
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator |
COMPARATOR
Compare function for sorting hunks after parsing.
|
private SVNPatchFileStream |
diffText
The hunk's unidiff text as it appeared in the patch file, without range
information.
|
private long |
leadingContext
Number of lines starting with ' ' before first '+' or '-'.
|
private SVNPatchHunk.SVNPatchHunkRange |
modified |
private static SVNPatchFileStream.SVNPatchFileLineFilter |
modified_line_filter
A stream line-filter which allows only modified text from a hunk, and
filters special lines (which start with a backslash).
|
private SVNPatchFileStream |
modifiedText |
private SVNPatchHunk.SVNPatchHunkRange |
original
Hunk ranges as they appeared in the patch file.
|
private static SVNPatchFileStream.SVNPatchFileLineFilter |
original_line_filter
A stream line-filter which allows only original text from a hunk, and
filters special lines (which start with a backslash).
|
private SVNPatchFileStream |
originalText
The original and modified texts in the hunk range.
|
private static SVNPatchFileStream.SVNPatchFileLineTransformer |
remove_leading_char_transformer
Line-transformer callback to shave leading diff symbols.
|
private long |
trailingContext
Number of lines starting with ' ' after last '+' or '-'.
|
Constructor and Description |
---|
SVNPatchHunk() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private static char |
getChar(java.lang.String line,
int i) |
SVNPatchFileStream |
getDiffText() |
long |
getLeadingContext() |
SVNPatchHunk.SVNPatchHunkRange |
getModified() |
SVNPatchFileStream |
getModifiedText() |
SVNPatchHunk.SVNPatchHunkRange |
getOriginal() |
SVNPatchFileStream |
getOriginalText() |
long |
getTrailingContext() |
private static boolean |
parseHunkHeader(java.lang.String header,
SVNPatchHunk hunk)
Try to parse a hunk header in string HEADER, putting parsed information
into HUNK.
|
static SVNPatchHunk |
parseNextHunk(SVNPatch patch)
Return the next HUNK from a PATCH, using STREAM to read data from the
patch file.
|
private static java.lang.Integer |
parseOffset(java.lang.String number)
Try to parse a positive number from a decimal number encoded in the
string NUMBER.
|
private static boolean |
parseRange(SVNPatchHunk.SVNPatchHunkRange hunkRange,
java.lang.StringBuffer range)
Try to parse a hunk range specification from the string RANGE.
|
public static final java.util.Comparator COMPARATOR
private static final SVNPatchFileStream.SVNPatchFileLineFilter original_line_filter
private static final SVNPatchFileStream.SVNPatchFileLineFilter modified_line_filter
private static final SVNPatchFileStream.SVNPatchFileLineTransformer remove_leading_char_transformer
private SVNPatchFileStream diffText
private SVNPatchFileStream originalText
private SVNPatchFileStream modifiedText
private SVNPatchHunk.SVNPatchHunkRange original
private SVNPatchHunk.SVNPatchHunkRange modified
private long leadingContext
private long trailingContext
public SVNPatchFileStream getDiffText()
public SVNPatchFileStream getOriginalText()
public SVNPatchFileStream getModifiedText()
public SVNPatchHunk.SVNPatchHunkRange getOriginal()
public SVNPatchHunk.SVNPatchHunkRange getModified()
public long getLeadingContext()
public long getTrailingContext()
public void close() throws java.io.IOException
java.io.IOException
public static SVNPatchHunk parseNextHunk(SVNPatch patch) throws java.io.IOException, SVNException
java.io.IOException
SVNException
private static char getChar(java.lang.String line, int i)
private static boolean parseHunkHeader(java.lang.String header, SVNPatchHunk hunk)
private static boolean parseRange(SVNPatchHunk.SVNPatchHunkRange hunkRange, java.lang.StringBuffer range)
private static java.lang.Integer parseOffset(java.lang.String number)