public abstract class RegexChannel<OUTPUT> extends Channel<OUTPUT>
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,
OUTPUT 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,
OUTPUT 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, OUTPUT output)
Channel
CodeReader
). If
the character stream is consumed the method must return true and the OUTPUT object can be fed.protected abstract void consume(CharSequence token, OUTPUT output)
token
- the token consumed in the character stream and matching the regular expressionthe
- OUPUT object which can be optionally fedCopyright © 2009-2012 SonarSource. All Rights Reserved.