public abstract class Matchers extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
Matchers() |
| Modifier and Type | Method and Description |
|---|---|
static Matchers |
charMatcher(char ch)
构造函数
|
static Matchers |
charSetMatcher(char... chars)
构造函数
|
static Matchers |
charSetMatcher(String chars)
构造函数
|
static Matchers |
commaMatcher()
返回一个匹配逗号字符的匹配器
|
static Matchers |
doubleQuoteMatcher()
匹配字符串双引号字符.
|
int |
isMatch(char[] buffer,
int pos)
返回匹配字符的数量,如果没有匹配,则返回0
|
abstract int |
isMatch(char[] buffer,
int pos,
int bufferStart,
int bufferEnd)
返回匹配字符的数量,如果没有匹配,则返回0
|
static Matchers |
noneMatcher()
匹配任何字符.
|
static Matchers |
quoteMatcher()
匹配字符串单引号/双引号字符.
|
static Matchers |
singleQuoteMatcher()
匹配字符串单引号字符.
|
static Matchers |
spaceMatcher()
返回一个匹配空格字符的匹配器
|
static Matchers |
splitMatcher()
匹配相同的字符,即空格、制表符、换行符等.
|
static Matchers |
stringMatcher(String text)
构造函数
|
static Matchers |
tabMatcher()
返回一个匹配tab字符的匹配器
|
static Matchers |
trimMatcher()
匹配字符串trim()空白字符.
|
public static Matchers commaMatcher()
public static Matchers tabMatcher()
public static Matchers spaceMatcher()
public static Matchers splitMatcher()
public static Matchers trimMatcher()
public static Matchers singleQuoteMatcher()
public static Matchers doubleQuoteMatcher()
public static Matchers quoteMatcher()
public static Matchers noneMatcher()
public static Matchers charMatcher(char ch)
ch - 匹配的字符不能为空public static Matchers charSetMatcher(char... chars)
chars - 对要匹配的字符进行字符切分,null或empty不匹配任何字符public static Matchers charSetMatcher(String chars)
chars - 对要匹配的字符进行字符切分,null或empty不匹配任何字符public static Matchers stringMatcher(String text)
text - 匹配的字符串为null或空,不匹配任何内容public abstract int isMatch(char[] buffer,
int pos,
int bufferStart,
int bufferEnd)
buffer - 要匹配的文本内容,不要更改pos - 匹配的起始位置,对buffer有效bufferStart - 缓冲区中的第一个活动索引,对缓冲区有效bufferEnd - 活动缓冲区的结束索引(排除),对缓冲区有效public int isMatch(char[] buffer,
int pos)
pos - 匹配的起始位置,对buffer有效buffer - 要匹配的文本内容,不要更改Copyright © 2021. All rights reserved.