public class FixedStringMatcher extends StringMatcher
StringMatcher tests whether strings start with a given fixed string
and then match another optional given StringMatcher.| Constructor and Description |
|---|
FixedStringMatcher(java.lang.String fixedString)
Creates a new FixedStringMatcher.
|
FixedStringMatcher(java.lang.String fixedString,
StringMatcher nextMatcher)
Creates a new FixedStringMatcher.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
matches(java.lang.String string,
int beginOffset,
int endOffset)
Checks whether the given substring matches.
|
java.lang.String |
prefix()
Returns a common prefix of all strings matched by this
StringMatcher. |
matchespublic FixedStringMatcher(java.lang.String fixedString)
fixedString - the string to match.public FixedStringMatcher(java.lang.String fixedString,
StringMatcher nextMatcher)
fixedString - the string prefix to match.nextMatcher - an optional string matcher to match the remainder of
the string.public java.lang.String prefix()
StringMatcherStringMatcher.
If the returned value is null, then this StringMatcher does not match any string.prefix in class StringMatcherprotected boolean matches(java.lang.String string,
int beginOffset,
int endOffset)
StringMatchermatches in class StringMatcherstring - the string to match.beginOffset - the start offset of the substring (inclusive).endOffset - the end offset of the substring (exclusive).