org.sonar.colorizer
Class KeywordsTokenizer
java.lang.Object
org.sonar.channel.Channel<HtmlCodeBuilder>
org.sonar.colorizer.Tokenizer
org.sonar.colorizer.NotThreadSafeTokenizer
org.sonar.colorizer.KeywordsTokenizer
- All Implemented Interfaces:
- Cloneable
- Direct Known Subclasses:
- CaseInsensitiveKeywordsTokenizer
public class KeywordsTokenizer
- extends NotThreadSafeTokenizer
Detect case-sensitive keywords
KeywordsTokenizer
public KeywordsTokenizer(String tagBefore,
String tagAfter,
Set<String> keywords)
KeywordsTokenizer
public KeywordsTokenizer(String tagBefore,
String tagAfter,
Set<String> keywords,
String regex)
KeywordsTokenizer
public KeywordsTokenizer(String tagBefore,
String tagAfter,
String... keywords)
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 streamcodeBuilder
- 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.
setCaseInsensitive
public void setCaseInsensitive(boolean caseInsensitive)
clone
public KeywordsTokenizer clone()
- Specified by:
clone
in class NotThreadSafeTokenizer
Copyright © 2009-2012 SonarSource. All Rights Reserved.