Package org.eclipse.compare.patch
Class PatchConfiguration
java.lang.Object
org.eclipse.compare.patch.PatchConfiguration
A patch configuration allows clients to set parameters that control how a
patch is applied.
- Since:
- 3.3
- See Also:
- Restriction:
- This class may be instantiated by clients but is not intended to be subclassed.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addHunkFilter
(IHunkFilter filter) Adds a hunk filter.int
getFuzz()
Return the fuzz factor to be used when applying a patch.Return an array of hunk filters that have been added to this configuration.int
Return the number of prefix segments to be stripped when attempting to apply a patch.getProperty
(String key) Return the property associated with the given key ornull
if there is no property for the key.boolean
Return whether whitespace should be ignored.boolean
Return whether the patch should be reversed when applied.void
removeHunkFilter
(IHunkFilter filter) Removes a hunk filter.void
setFuzz
(int fuzz) Set the fuzz factor to be used when applying a patch.void
setIgnoreWhitespace
(boolean ignoreWhitespace) Set whether whitespace should be ignoredvoid
setPrefixSegmentStripCount
(int stripCount) Set the number of prefix segments to be stripped when attempting to apply a patch.void
setProperty
(String key, Object value) Set the property associated with the given keyvoid
setReversed
(boolean reversed) Set whether the patch should be reversed when applied.
-
Constructor Details
-
PatchConfiguration
public PatchConfiguration()
-
-
Method Details
-
isReversed
public boolean isReversed()Return whether the patch should be reversed when applied.- Returns:
- whether the patch should be reversed when applied
-
setReversed
public void setReversed(boolean reversed) Set whether the patch should be reversed when applied.- Parameters:
reversed
- whether the patch should be reversed when applied
-
getPrefixSegmentStripCount
public int getPrefixSegmentStripCount()Return the number of prefix segments to be stripped when attempting to apply a patch.- Returns:
- the number of prefix segments to be stripped when attempting to apply a patch
-
setPrefixSegmentStripCount
public void setPrefixSegmentStripCount(int stripCount) Set the number of prefix segments to be stripped when attempting to apply a patch.- Parameters:
stripCount
- the number of prefix segments to be stripped when attempting to apply a patch.
-
getFuzz
public int getFuzz()Return the fuzz factor to be used when applying a patch. If the fuzz factor is set to -1, then the patcher is to make a best effort to apply the patch by adjusting the fuzz factor accordingly.- Returns:
- the fuzz factor to be used when applying a patch.
-
setFuzz
public void setFuzz(int fuzz) Set the fuzz factor to be used when applying a patch.- Parameters:
fuzz
- the fuzz factor to be used when applying a patch.
-
isIgnoreWhitespace
public boolean isIgnoreWhitespace()Return whether whitespace should be ignored.- Returns:
- whether whitespace should be ignored
-
setIgnoreWhitespace
public void setIgnoreWhitespace(boolean ignoreWhitespace) Set whether whitespace should be ignored- Parameters:
ignoreWhitespace
- whether whitespace should be ignored
-
getProperty
Return the property associated with the given key ornull
if there is no property for the key.- Parameters:
key
- the key- Returns:
- the property associated with the given key or
null
-
setProperty
Set the property associated with the given key- Parameters:
key
- the keyvalue
- the value to be associated with the key
-
addHunkFilter
Adds a hunk filter.- Parameters:
filter
- the filter- Since:
- org.eclipse.compare.core 3.5
-
removeHunkFilter
Removes a hunk filter.- Parameters:
filter
- the filter- Since:
- org.eclipse.compare.core 3.5
-
getHunkFilters
Return an array of hunk filters that have been added to this configuration.- Returns:
- an array of hunk filters that have been added to this configuration
- Since:
- org.eclipse.compare.core 3.5
-