public abstract static class Pattern.CustomNode extends Object
match method, you thus
provide a plugin into the regex engine that you can install via
Pattern.installPlugin(String, Class).| Constructor and Description |
|---|
CustomNode() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
isDeterministic() |
protected abstract boolean |
isMaxValid()
Says whether this node can match arbitrary many characters
This is used by Lookbehinds.
|
protected abstract boolean |
match(Matcher matcher,
int i,
CharSequence seq)
Matches the input character sequence against this node's pattern.
|
protected boolean |
matchNext(Matcher matcher,
int i,
CharSequence seq) |
protected abstract int |
maxLength()
Returns the maximum number of characters that this node matches.
|
protected abstract int |
minLength()
Returns the minimum number of characters that this node matches.
|
protected Object |
retrieveData(Matcher matcher)
Retrieves the data stored in matcher.
|
protected void |
storeData(Matcher matcher,
Object data)
Stores some search data in matcher.
|
protected abstract boolean match(Matcher matcher, int i, CharSequence seq)
matchNext(matcher, i+n, seq).
In case matchNext returns
true, this method usually should also return true. In case
matchNext returns false, this
node might try to match something different with possibly either more or less
characters and then call matchNext again. Then this node would be a backtracking crossroad. Or this
node might restore the state of matcher and return false.matchNext(Matcher, int, CharSequence)protected boolean matchNext(Matcher matcher, int i, CharSequence seq)
protected Object retrieveData(Matcher matcher)
storeData(Matcher, Object)protected void storeData(Matcher matcher, Object data)
Pattern class and all its nodes are completely
stateless allowing concurrent use. All state of the regex engine is therefore
stored in matcher, which is what this method allows subclasses to do.matcher - The Matcher in which to store the data.data - The data to store in matcher.retrieveData(Matcher)protected abstract int minLength()
protected abstract int maxLength()
protected abstract boolean isMaxValid()
protected abstract boolean isDeterministic()
Copyright © 2019. All rights reserved.