TokenizedPattern
is preferable to equivalent SelectorUtils
methods if you need to
execute multiple matching with the same pattern because here the pattern
itself will be parsed only once.
SelectorUtils#matchPath(String, String)
, SelectorUtils#matchPath(String, String, boolean)
Modifier and Type | Field and Description |
---|---|
public static final TokenizedPattern | EMPTY_PATTERN
Instance that holds no tokens at all. |
private final String | |
private final String[] |
Access | Constructor and Description |
---|---|
public | TokenizedPattern(String
The pattern to match against. Must not be pattern)null .Initialize the |
pack-priv |
Modifier and Type | Method and Description |
---|---|
public boolean | |
public int | |
public boolean | |
public boolean | equals(Object o)
Overrides java. |
public String | |
public int | |
public boolean | Returns: true if the pattern matches against the string,
or false otherwise.The path to match, as a path, boolean String . Must not be
null .Whether or not matching should be performed
case sensitively. isCaseSensitive)Tests whether or not a given path matches a given pattern. |
public boolean | Returns: boolean boolean Tests whether or not this pattern matches the start of a path. |
public TokenizedPath | Returns: the leftmost part of the pattern without wildcardsReturns a new |
public String | Returns: The patternString Overrides java. |
public TokenizedPattern | Returns: TokenizedPattern Returns a new pattern without the last token of this pattern. |
EMPTY_PATTERN | back to summary |
---|---|
public static final TokenizedPattern EMPTY_PATTERN Instance that holds no tokens at all. |
pattern | back to summary |
---|---|
private final String pattern |
tokenizedPattern | back to summary |
---|---|
private final String[] tokenizedPattern |
TokenizedPattern | back to summary |
---|---|
public TokenizedPattern(String pattern) Initialize the
|
TokenizedPattern | back to summary |
---|---|
pack-priv TokenizedPattern(String pattern, String[] tokens) |
containsPattern | back to summary |
---|---|
public boolean containsPattern(String pat) Does the tokenized pattern contain the given string? |
depth | back to summary |
---|---|
public int depth() Get the depth (or length) of a pattern.
|
endsWith | back to summary |
---|---|
public boolean endsWith(String s) Learn whether the last token equals the given string. |
equals | back to summary |
---|---|
public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on
into equivalence classes; all the members of an
equivalence class are equal to each other. Members of an
equivalence class are substitutable for each other, at least
for some purposes.
|
getPattern | back to summary |
---|---|
public String getPattern() Get the pattern. |
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
|
matchPath | back to summary |
---|---|
public boolean matchPath(TokenizedPath path, boolean isCaseSensitive) Tests whether or not a given path matches a given pattern.
|
matchStartOf | back to summary |
---|---|
public boolean matchStartOf(TokenizedPath path, boolean caseSensitive) Tests whether or not this pattern matches the start of a path.
|
rtrimWildcardTokens | back to summary |
---|---|
public TokenizedPath rtrimWildcardTokens() Returns a new
|
toString | back to summary |
---|---|
public String toString() Overrides java. Doc from java. Returns a string representation of the object. |
withoutLastToken | back to summary |
---|---|
public TokenizedPattern withoutLastToken() Returns a new pattern without the last token of this pattern.
|