org.sonar.colorizer
Class RegexpTokenizer

java.lang.Object
  extended by org.sonar.channel.Channel<HtmlCodeBuilder>
      extended by org.sonar.colorizer.Tokenizer
          extended by org.sonar.colorizer.NotThreadSafeTokenizer
              extended by org.sonar.colorizer.RegexpTokenizer
All Implemented Interfaces:
Cloneable

public class RegexpTokenizer
extends NotThreadSafeTokenizer


Constructor Summary
RegexpTokenizer(String tagBefore, String tagAfter, String regexp)
           
 
Method Summary
 RegexpTokenizer clone()
           
 boolean consume(CodeReader code, HtmlCodeBuilder codeBuilder)
          Tries to consume the character stream at the current reading cursor position (provided by the CodeReader).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexpTokenizer

public RegexpTokenizer(String tagBefore,
                       String tagAfter,
                       String regexp)
Parameters:
tagBefore - Html tag to add before the token
tagAfter - Html tag to add after the token
regexp - Regular expression which must be used to match token
Method Detail

consume

public boolean consume(CodeReader code,
                       HtmlCodeBuilder codeBuilder)
Description copied from class: Channel
Tries to consume the character stream at the current reading cursor position (provided by the CodeReader). If the character stream is consumed the method must return true and the OUTPUT object can be fed.

Specified by:
consume in class Channel<HtmlCodeBuilder>
Parameters:
code - the handle on the input character stream
codeBuilder - the OUTPUT that can be optionally fed by the Channel
Returns:
false if the Channel doesn't want to consume the character stream, true otherwise.

clone

public RegexpTokenizer clone()
Specified by:
clone in class NotThreadSafeTokenizer


Copyright © 2009-2012 SonarSource. All Rights Reserved.