Package org.jacoco.report.html
Class HTMLFormatter
java.lang.Object
org.jacoco.report.html.HTMLFormatter
- All Implemented Interfaces:
IHTMLReportContext
Formatter for coverage reports in multiple HTML pages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private ElementIndex
private ILanguageNames
private Locale
private String
private Resources
private SessionsPage
private Table
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addMissedTotalColumns
(Table table, String label, ICoverageNode.CounterEntity entity) private Table
createVisitor
(IMultiReportOutput output) Creates a new visitor to write a report to the given output.Returns a string of textual information to include in every page footer.Returns the service for index updates.Returns the language names call-back used in this report.Returns the locale used to format numbers and dates.Returns the encoding of the generated HTML documents.Returns the static resources used in this report.Returns the link to the sessions page.getTable()
Returns a table for rendering coverage nodes.void
setFooterText
(String footerText) Sets the optional text that should be included in every footer page.void
setLanguageNames
(ILanguageNames languageNames) Sets the implementation for language name display.void
Sets the locale used for report rendering.void
setOutputEncoding
(String outputEncoding) Sets the encoding used for generated HTML pages.
-
Field Details
-
languageNames
-
locale
-
outputEncoding
-
resources
-
index
-
sessionsPage
-
table
-
-
Constructor Details
-
HTMLFormatter
public HTMLFormatter()New instance with default settings.
-
-
Method Details
-
setLanguageNames
Sets the implementation for language name display. Java language names are defined by default.- Parameters:
languageNames
- converter for language specific names
-
setLocale
Sets the locale used for report rendering. The current default locale is used by default.- Parameters:
locale
- locale used for report rendering
-
setOutputEncoding
Sets the encoding used for generated HTML pages. Default is UTF-8.- Parameters:
outputEncoding
- HTML output encoding
-
getLanguageNames
Description copied from interface:IHTMLReportContext
Returns the language names call-back used in this report.- Specified by:
getLanguageNames
in interfaceIHTMLReportContext
- Returns:
- language names
-
getResources
Description copied from interface:IHTMLReportContext
Returns the static resources used in this report.- Specified by:
getResources
in interfaceIHTMLReportContext
- Returns:
- static resources
-
getTable
Description copied from interface:IHTMLReportContext
Returns a table for rendering coverage nodes.- Specified by:
getTable
in interfaceIHTMLReportContext
- Returns:
- table for rendering
-
createTable
-
addMissedTotalColumns
-
getSessionsPage
Description copied from interface:IHTMLReportContext
Returns the link to the sessions page.- Specified by:
getSessionsPage
in interfaceIHTMLReportContext
- Returns:
- sessions page link
-
getOutputEncoding
Description copied from interface:IHTMLReportContext
Returns the encoding of the generated HTML documents.- Specified by:
getOutputEncoding
in interfaceIHTMLReportContext
- Returns:
- encoding for generated HTML documents
-
getIndexUpdate
Description copied from interface:IHTMLReportContext
Returns the service for index updates.- Specified by:
getIndexUpdate
in interfaceIHTMLReportContext
- Returns:
- sevice for indes updates
-
getLocale
Description copied from interface:IHTMLReportContext
Returns the locale used to format numbers and dates.- Specified by:
getLocale
in interfaceIHTMLReportContext
- Returns:
- locale for numbers and dates
-
createVisitor
Creates a new visitor to write a report to the given output.- Parameters:
output
- output to write the report to- Returns:
- visitor to emit the report data to
- Throws:
IOException
- in case of problems with the output stream
-