static class RegexStringComparator.JavaRegexEngine extends Object implements RegexStringComparator.Engine
This is the default engine.
Modifier and Type | Field and Description |
---|---|
private Charset |
charset |
private Pattern |
pattern |
Constructor and Description |
---|
JavaRegexEngine(String regex,
int flags) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(byte[] value,
int offset,
int length)
Match the given input against the configured pattern
|
String |
getCharset()
Returns the name of the configured charset
|
int |
getFlags()
Returns the set of configured match flags, a bit mask that may include
Pattern flags |
String |
getPattern()
Returns the string representation of the configured regular expression
for matching
|
void |
setCharset(String charset)
Set the charset used when matching
|
byte[] |
toByteArray()
Return the serialized form of the configured matcher
|
public JavaRegexEngine(String regex, int flags)
public String getPattern()
RegexStringComparator.Engine
getPattern
in interface RegexStringComparator.Engine
public int getFlags()
RegexStringComparator.Engine
Pattern
flagsgetFlags
in interface RegexStringComparator.Engine
public String getCharset()
RegexStringComparator.Engine
getCharset
in interface RegexStringComparator.Engine
public void setCharset(String charset)
RegexStringComparator.Engine
setCharset
in interface RegexStringComparator.Engine
charset
- the name of the desired charset for matchingpublic int compareTo(byte[] value, int offset, int length)
RegexStringComparator.Engine
compareTo
in interface RegexStringComparator.Engine
value
- the data to be matchedoffset
- offset of the data to be matchedlength
- length of the data to be matchedpublic byte[] toByteArray()
RegexStringComparator.Engine
toByteArray
in interface RegexStringComparator.Engine
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.