public class PatchBuilder extends Object
Modifier and Type | Field and Description |
---|---|
static char |
ADDITION_PREFIX
Line prefix used to mark an added lines.
|
static char |
CONTEXT_PREFIX
Line prefix used to mark context lines.
|
static char |
REMOVAL_PREFIX
Line prefix used to mark an removed lines.
|
Constructor and Description |
---|
PatchBuilder() |
Modifier and Type | Method and Description |
---|---|
static IFilePatch2 |
addHunks(IFilePatch2 filePatch,
IHunk[] toAdd)
Adds IHunks to a given IFilePatch2 and performs recalculation of all
hunks' after positions.
|
static IFilePatch2 |
createFilePatch(IPath oldPath,
long oldDate,
IPath newPath,
long newDate,
IHunk[] hunks)
Creates an IFilePatch2 instance and performs recalculation of all hunks'
after positions.
|
static IHunk |
createHunk(int start,
String[] lines)
Creates an IHunk instance.
|
static IFilePatch2 |
removeHunks(IFilePatch2 filePatch,
IHunk[] toRemove)
Removes IHunks from a given IFilePatch2 and performs recalculation of all
hunks' after positions.
|
public static final char CONTEXT_PREFIX
public static final char ADDITION_PREFIX
public static final char REMOVAL_PREFIX
public static IHunk createHunk(int start, String[] lines)
start
- the start position in the before filelines
- content of the hunk. Each line starts with a control
character. Their meaning is as follows:
public static IFilePatch2 createFilePatch(IPath oldPath, long oldDate, IPath newPath, long newDate, IHunk[] hunks)
oldPath
- the path of the before state of the fileoldDate
- the timestamp of the before state of the file, see also
IFilePatch2.DATE_UNKNOWN
newPath
- the path of the after state of the filenewDate
- the timestamp of the after state of the file, see also
IFilePatch2.DATE_UNKNOWN
hunks
- a set of hunks to insert into IFilePatch2public static IFilePatch2 addHunks(IFilePatch2 filePatch, IHunk[] toAdd)
filePatch
- a file patch to add hunks totoAdd
- a set of IHunks to addpublic static IFilePatch2 removeHunks(IFilePatch2 filePatch, IHunk[] toRemove)
filePatch
- a file patch to add hunks totoRemove
- a set of IHunks to add
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.