public class FastIgnoreRule extends Object
**
pattern.
This class is immutable and thread safe.
Modifier and Type | Field and Description |
---|---|
static char |
PATH_SEPARATOR
Character used as default path separator for ignore entries
|
Constructor and Description |
---|
FastIgnoreRule(String pattern)
Constructor for FastIgnoreRule
|
Modifier and Type | Method and Description |
---|---|
boolean |
dirOnly()
Whether the pattern should match directories only
|
boolean |
equals(Object obj) |
boolean |
getNameOnly()
Whether the pattern is just a file name and not a path
|
boolean |
getNegation()
Indicates whether the rule is non-negation or negation.
|
boolean |
getResult()
Indicates whether the rule is non-negation or negation.
|
int |
hashCode() |
boolean |
isEmpty()
Whether the rule never matches
|
boolean |
isMatch(String path,
boolean directory)
Returns true if a match was made.
|
boolean |
isMatch(String path,
boolean directory,
boolean pathMatch)
Returns true if a match was made.
|
String |
toString() |
public static final char PATH_SEPARATOR
public FastIgnoreRule(String pattern)
pattern
- ignore pattern as described in git manual. If pattern is invalid or is not a pattern
(comment), this rule doesn't match anything.public boolean isMatch(String path, boolean directory)
getResult()
for the negation status. The actual
ignore status may be true or false depending on whether this rule is an
ignore rule or a negation rule.path
- Name pattern of the file, relative to the base directory of
this ruledirectory
- Whether the target file is a directory or notgetResult()
for the
result.public boolean isMatch(String path, boolean directory, boolean pathMatch)
getResult()
for the negation status. The actual
ignore status may be true or false depending on whether this rule is an
ignore rule or a negation rule.path
- Name pattern of the file, relative to the base directory of
this ruledirectory
- Whether the target file is a directory or notpathMatch
- true
if the match is for the full path: see
IMatcher.matches(String, int, int)
getResult()
for the
result.public boolean getNameOnly()
true
if the pattern is just a file name and not a pathpublic boolean dirOnly()
true
if the pattern should match directories onlypublic boolean getNegation()
public boolean getResult()
public boolean isEmpty()
true
if the rule never matches (comment line or broken
pattern)Copyright © 2020 Eclipse JGit Project. All rights reserved.