final class GlobPathFilter extends java.lang.Object implements PathFilter
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
glob |
private static java.util.regex.Pattern |
GLOB_PATTERN |
private java.util.regex.Pattern |
pattern |
| Constructor and Description |
|---|
GlobPathFilter(java.lang.String glob)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(java.lang.String path)
Determine whether a path should be accepted.
|
boolean |
equals(GlobPathFilter obj) |
boolean |
equals(java.lang.Object obj)
Determine whether this filter is equal to another.
|
private static java.util.regex.Pattern |
getGlobPattern(java.lang.String glob)
Get a regular expression pattern which accept any path names which match the given glob.
|
int |
hashCode()
Calculate a unique hash code for this path filter.
|
java.lang.String |
toString() |
private static final java.util.regex.Pattern GLOB_PATTERN
private final java.lang.String glob
private final java.util.regex.Pattern pattern
GlobPathFilter(java.lang.String glob)
glob - the path glob to matchpublic boolean accept(java.lang.String path)
accept in interface PathFilterpath - the path to checkprivate static java.util.regex.Pattern getGlobPattern(java.lang.String glob)
ant file patterns. Valid metacharacters in the glob pattern include:
"\" - escape the next character (treat it literally, even if it is itself a recognized metacharacter)"?" - match any non-slash character"*" - match zero or more non-slash characters"**" - match zero or more characters, including slashes"/" - match one or more slash characters. Consecutive / characters are collapsed down into one./ is equivalent
to a glob pattern ending in /** in that the named directory is not itself included in the glob.
See also: "Patterns" in the Ant Manualglob - the glob to matchpublic int hashCode()
PathFilterhashCode in interface PathFilterhashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
PathFilterequals in interface PathFilterequals in class java.lang.Objectobj - the other objecttrue if this filter is the samepublic boolean equals(GlobPathFilter obj)
public java.lang.String toString()
toString in class java.lang.Object