net.sf.xslthl.highlighters
Class HTMLHighlighter

java.lang.Object
  extended by net.sf.xslthl.Highlighter
      extended by net.sf.xslthl.WholeHighlighter
          extended by net.sf.xslthl.highlighters.HTMLHighlighter

public class HTMLHighlighter
extends WholeHighlighter

XML/SGML highlighter. It has a couple of default styles: tag, attribute, value, directive. Accepted parameters:

elementSet
Specialized highlighting for set elements
elementPrefix
Specialized highlighting for element prefixes
styleElement
The style to use for elements, defaults to 'tag'
styleAttributes
The style to use for attributes, defaults to 'attribute'
styleValue
The style to use for attribute values, defaults to 'value'
stylePi
The style to use for processing instructions, defaults to 'directive'
styleComment
The style to use for comments, defaults to 'comment'
styleDoctype
The style to use for the doctype declaration, defaults to 'doccomment'


Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.xslthl.Highlighter
Highlighter.IgnoreCaseComparator
 
Field Summary
protected  Collection<ElementSet> elementSets
          Overriden styles
protected  String styleAttribute
          The style for attributes
protected  String styleComment
          The style for comments
protected  String styleDoctype
          Style to use for the doctype part
protected  String styleElement
          Style to use for elements
protected  String stylePi
          The style for processing instructions
protected  String styleValue
          The style for attribute values
 
Fields inherited from class net.sf.xslthl.Highlighter
styleName, XMLname
 
Constructor Summary
HTMLHighlighter()
           
 
Method Summary
 String getDefaultStyle()
          The default style name
protected  String getStyleForTagName(String tagName)
           
 boolean highlight(CharIter in, List<Block> out)
          Perform highlighting on the current token stream.
 void init(Params params)
          Initializer
 
Methods inherited from class net.sf.xslthl.Highlighter
isNewLine, reset, startsWith
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elementSets

protected Collection<ElementSet> elementSets
Overriden styles


styleElement

protected String styleElement
Style to use for elements


styleAttribute

protected String styleAttribute
The style for attributes


styleValue

protected String styleValue
The style for attribute values


stylePi

protected String stylePi
The style for processing instructions


styleComment

protected String styleComment
The style for comments


styleDoctype

protected String styleDoctype
Style to use for the doctype part

Constructor Detail

HTMLHighlighter

public HTMLHighlighter()
Method Detail

getStyleForTagName

protected String getStyleForTagName(String tagName)
Parameters:
tagName -
Returns:

init

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

Overrides:
init in class WholeHighlighter
Throws:
HighlighterConfigurationException

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:

getDefaultStyle

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

Specified by:
getDefaultStyle in class Highlighter
Returns:


Copyright © 2005-2014. All Rights Reserved.