public final class StringMatcherFactory extends Object
Modifier and Type | Field and Description |
---|---|
static StringMatcherFactory |
INSTANCE
Defines the singleton for this class.
|
Modifier and Type | Method and Description |
---|---|
StringMatcher |
andMatcher(StringMatcher... stringMatchers)
Creates a matcher that matches all of the given matchers in order.
|
StringMatcher |
charMatcher(char ch)
Constructor that creates a matcher from a character.
|
StringMatcher |
charSetMatcher(char... chars)
Constructor that creates a matcher from a set of characters.
|
StringMatcher |
charSetMatcher(String chars)
Creates a matcher from a string representing a set of characters.
|
StringMatcher |
commaMatcher()
Returns a matcher which matches the comma character.
|
StringMatcher |
doubleQuoteMatcher()
Returns a matcher which matches the double quote character.
|
StringMatcher |
noneMatcher()
Matches no characters.
|
StringMatcher |
quoteMatcher()
Returns a matcher which matches the single or double quote character.
|
StringMatcher |
singleQuoteMatcher()
Returns a matcher which matches the single quote character.
|
StringMatcher |
spaceMatcher()
Returns a matcher which matches the space character.
|
StringMatcher |
splitMatcher()
Matches the same characters as StringTokenizer, namely space, tab, newline and form feed.
|
StringMatcher |
stringMatcher(char... chars)
Creates a matcher from a string.
|
StringMatcher |
stringMatcher(String str)
Creates a matcher from a string.
|
StringMatcher |
tabMatcher()
Returns a matcher which matches the tab character.
|
StringMatcher |
trimMatcher()
Matches the String trim() whitespace characters.
|
public static final StringMatcherFactory INSTANCE
public StringMatcher andMatcher(StringMatcher... stringMatchers)
stringMatchers
- the matcherpublic StringMatcher charMatcher(char ch)
ch
- the character to match, must not be nullpublic StringMatcher charSetMatcher(char... chars)
chars
- the characters to match, null or empty matches nothingpublic StringMatcher charSetMatcher(String chars)
chars
- the characters to match, null or empty matches nothingpublic StringMatcher commaMatcher()
public StringMatcher doubleQuoteMatcher()
public StringMatcher noneMatcher()
public StringMatcher quoteMatcher()
public StringMatcher singleQuoteMatcher()
public StringMatcher spaceMatcher()
public StringMatcher splitMatcher()
public StringMatcher stringMatcher(char... chars)
chars
- the string to match, null or empty matches nothingpublic StringMatcher stringMatcher(String str)
str
- the string to match, null or empty matches nothingpublic StringMatcher tabMatcher()
public StringMatcher trimMatcher()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.