public class WildcardKits extends Object
copy from vipshop VJTools(com.vip.vjtools.vjkit.text.WildcardMatcher) and made some changes.
| 限定符和类型 | 字段和说明 |
|---|---|
protected static String |
PATH_MATCH |
protected static com.google.common.base.Splitter |
PATH_SPLITTER |
| 构造器和说明 |
|---|
WildcardKits() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
match(CharSequence string,
CharSequence pattern)
Checks whether a string matches a given wildcard pattern.
|
static int |
matchOne(String src,
String... patterns)
Matches string to at least one pattern.
|
static boolean |
matchPath(String path,
String pattern)
Matches path against pattern using *, ?
|
static int |
matchPathOne(String platformDependentPath,
String... patterns)
Matches path to at least one pattern.
|
protected static boolean |
matchTokens(String[] tokens,
String[] patterns)
Match tokenized string and pattern.
|
public static boolean match(CharSequence string, CharSequence pattern)
string - input stringpattern - pattern to matchtrue if string matches the pattern, otherwise falsepublic static int matchOne(String src, String... patterns)
-1 otherwise.src - patterns - match(CharSequence, CharSequence)public static int matchPathOne(String platformDependentPath, String... patterns)
-1 otherwise.platformDependentPath - patterns - matchPath(String, String)public static boolean matchPath(String path, String pattern)
path - pattern - Copyright © 2019. All rights reserved.