net.sf.xslthl.highlighters
Class WordHighlighter

java.lang.Object
  extended by net.sf.xslthl.Highlighter
      extended by net.sf.xslthl.highlighters.WordHighlighter

public class WordHighlighter
extends Highlighter

Highlights the list of elements as they are encounterd. No special processing. This is a slow highlighter. Accepted parameters:

word
The word it recognizes, can be used multiple times.
ignoreCase
the words are recognized case insensitive


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.xslthl.Highlighter
Highlighter.IgnoreCaseComparator
 
Field Summary
protected  boolean caseInsensitive
          If true ingore the case
protected  List<String> words
          The words to recognize
 
Fields inherited from class net.sf.xslthl.Highlighter
styleName, XMLname
 
Constructor Summary
WordHighlighter()
           
 
Method Summary
 String getDefaultStyle()
          The default style name
 boolean highlight(CharIter in, List<Block> out)
          Perform highlighting on the current token stream.
 void init(Params params)
          Initializer
 boolean startsWith(CharIter in)
          return true if the current character is a possible match for this highlighter
 
Methods inherited from class net.sf.xslthl.Highlighter
isNewLine, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

words

protected List<String> words
The words to recognize


caseInsensitive

protected boolean caseInsensitive
If true ingore the case

Constructor Detail

WordHighlighter

public WordHighlighter()
Method Detail

init

public void init(Params params)
          throws HighlighterConfigurationException
Description copied from class: Highlighter
Initializer

Overrides:
init in class Highlighter
Throws:
HighlighterConfigurationException

startsWith

public boolean startsWith(CharIter in)
Description copied from class: Highlighter
return true if the current character is a possible match for this highlighter

Overrides:
startsWith in class Highlighter
Returns:

getDefaultStyle

public String getDefaultStyle()
Description copied from class: Highlighter
The default style name

Specified by:
getDefaultStyle in class Highlighter
Returns:

highlight

public boolean highlight(CharIter in,
                         List<Block> out)
Description copied from class: Highlighter
Perform highlighting on the current token stream. Return true when highlighting was performed, or false in case of a false positive.

Specified by:
highlight in class Highlighter
Returns:


Copyright © 2005-2014. All Rights Reserved.