org.apache.tools.ant.types.selectors
public class TokenizedPattern extends Object
Since: 1.8.0
See Also: SelectorUtils SelectorUtils
Field Summary | |
---|---|
static TokenizedPattern | EMPTY_PATTERN
Instance that holds no tokens at all. |
Constructor Summary | |
---|---|
TokenizedPattern(String pattern)
Initialize the PathPattern by parsing it. |
Method Summary | |
---|---|
boolean | containsPattern(String pat)
Does the tokenized pattern contain the given string? |
int | depth()
The depth (or length) of a pattern. |
boolean | endsWith(String s)
true if the last token equals the given string. |
boolean | equals(Object o)
true if the original patterns are equal. |
String | getPattern() |
int | hashCode() |
boolean | matchPath(TokenizedPath path, boolean isCaseSensitive)
Tests whether or not a given path matches a given pattern.
|
boolean | matchStartOf(TokenizedPath path, boolean caseSensitive)
Tests whether or not this pattern matches the start of
a path. |
TokenizedPath | rtrimWildcardTokens()
Returns a new TokenizedPath where all tokens of this pattern to
the right containing wildcards have been removed |
String | toString() |
TokenizedPattern | withoutLastToken()
Returns a new pattern without the last token of this pattern. |
Parameters: pattern The pattern to match against. Must not be
null
.
Parameters: path The path to match, as a String. Must not be
null
. isCaseSensitive Whether or not matching should be performed
case sensitively.
Returns: true
if the pattern matches against the string,
or false
otherwise.
Returns: the leftmost part of the pattern without wildcards
Returns: The pattern String