public abstract class RegexChannel<O> extends Channel<O>
| Constructor and Description |
|---|
RegexChannel(String regex)
Create a RegexChannel object with the required regular expression
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
consume(CharSequence token,
O output)
The consume method is called each time the regular expression used to create the RegexChannel object matches the next characters in the
character streams.
|
boolean |
consume(CodeReader code,
O output)
Tries to consume the character stream at the current reading cursor position (provided by the
CodeReader). |
public RegexChannel(String regex)
regex - regular expression to be used to try matching the next characters in the streampublic final boolean consume(CodeReader code, O output)
ChannelCodeReader). If
the character stream is consumed the method must return true and the OUTPUT object can be fed.protected abstract void consume(CharSequence token, O output)
token - the token consumed in the character stream and matching the regular expressionthe - OUPUT object which can be optionally fedCopyright © 2009-2014 SonarSource. All Rights Reserved.