org.jacoco.report.html
Class SourceHighlighter

java.lang.Object
  extended by org.jacoco.report.html.SourceHighlighter

public class SourceHighlighter
extends Object

Creates a highlighted output of a source file.

Version:
0.4.1.20101007204400
Author:
Marc R. Hoffmann

Constructor Summary
SourceHighlighter()
          Creates a new highlighter with default settings.
 
Method Summary
 void render(HTMLElement parent, ILines lines, Reader contents)
          Highlights the given source file.
 void setLanguage(String lang)
          Specifies the source language.
 void setTabWidth(int width)
          Specifies the number of spaces that are represented by a single tab.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceHighlighter

public SourceHighlighter()
Creates a new highlighter with default settings.

Method Detail

setTabWidth

public void setTabWidth(int width)
Specifies the number of spaces that are represented by a single tab. Default is 4.

Parameters:
width - spaces per tab

setLanguage

public void setLanguage(String lang)
Specifies the source language. This value might be used for syntax highlighting. Default is "java".

Parameters:
lang - source language identifier

render

public void render(HTMLElement parent,
                   ILines lines,
                   Reader contents)
            throws IOException
Highlights the given source file.

Parameters:
parent - parent HTML element
lines - highlighting information
contents - contents of the source file
Throws:
IOException - problems while reading the source file or writing the output