Package org.jacoco.report.html
Class HTMLFormatter
- java.lang.Object
-
- org.jacoco.report.html.HTMLFormatter
-
- All Implemented Interfaces:
IHTMLReportContext
public class HTMLFormatter extends java.lang.Object implements IHTMLReportContext
Formatter for coverage reports in multiple HTML pages.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringfooterTextprivate ElementIndexindexprivate ILanguageNameslanguageNamesprivate java.util.Localelocaleprivate java.lang.StringoutputEncodingprivate Resourcesresourcesprivate SessionsPagesessionsPageprivate Tabletable
-
Constructor Summary
Constructors Constructor Description HTMLFormatter()New instance with default settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddMissedTotalColumns(Table table, java.lang.String label, ICoverageNode.CounterEntity entity)private TablecreateTable()IReportVisitorcreateVisitor(IMultiReportOutput output)Creates a new visitor to write a report to the given output.java.lang.StringgetFooterText()Returns a string of textual information to include in every page footer.IIndexUpdategetIndexUpdate()Returns the service for index updates.ILanguageNamesgetLanguageNames()Returns the language names call-back used in this report.java.util.LocalegetLocale()Returns the locale used to format numbers and dates.java.lang.StringgetOutputEncoding()Returns the encoding of the generated HTML documents.ResourcesgetResources()Returns the static resources used in this report.ILinkablegetSessionsPage()Returns the link to the sessions page.TablegetTable()Returns a table for rendering coverage nodes.voidsetFooterText(java.lang.String footerText)Sets the optional text that should be included in every footer page.voidsetLanguageNames(ILanguageNames languageNames)Sets the implementation for language name display.voidsetLocale(java.util.Locale locale)Sets the locale used for report rendering.voidsetOutputEncoding(java.lang.String outputEncoding)Sets the encoding used for generated HTML pages.
-
-
-
Field Detail
-
languageNames
private ILanguageNames languageNames
-
locale
private java.util.Locale locale
-
footerText
private java.lang.String footerText
-
outputEncoding
private java.lang.String outputEncoding
-
resources
private Resources resources
-
index
private ElementIndex index
-
sessionsPage
private SessionsPage sessionsPage
-
table
private Table table
-
-
Method Detail
-
setLanguageNames
public void setLanguageNames(ILanguageNames languageNames)
Sets the implementation for language name display. Java language names are defined by default.- Parameters:
languageNames- converter for language specific names
-
setLocale
public void setLocale(java.util.Locale locale)
Sets the locale used for report rendering. The current default locale is used by default.- Parameters:
locale- locale used for report rendering
-
setFooterText
public void setFooterText(java.lang.String footerText)
Sets the optional text that should be included in every footer page.- Parameters:
footerText- footer text
-
setOutputEncoding
public void setOutputEncoding(java.lang.String outputEncoding)
Sets the encoding used for generated HTML pages. Default is UTF-8.- Parameters:
outputEncoding- HTML output encoding
-
getLanguageNames
public ILanguageNames getLanguageNames()
Description copied from interface:IHTMLReportContextReturns the language names call-back used in this report.- Specified by:
getLanguageNamesin interfaceIHTMLReportContext- Returns:
- language names
-
getResources
public Resources getResources()
Description copied from interface:IHTMLReportContextReturns the static resources used in this report.- Specified by:
getResourcesin interfaceIHTMLReportContext- Returns:
- static resources
-
getTable
public Table getTable()
Description copied from interface:IHTMLReportContextReturns a table for rendering coverage nodes.- Specified by:
getTablein interfaceIHTMLReportContext- Returns:
- table for rendering
-
createTable
private Table createTable()
-
addMissedTotalColumns
private void addMissedTotalColumns(Table table, java.lang.String label, ICoverageNode.CounterEntity entity)
-
getFooterText
public java.lang.String getFooterText()
Description copied from interface:IHTMLReportContextReturns a string of textual information to include in every page footer.- Specified by:
getFooterTextin interfaceIHTMLReportContext- Returns:
- footer text or empty string
-
getSessionsPage
public ILinkable getSessionsPage()
Description copied from interface:IHTMLReportContextReturns the link to the sessions page.- Specified by:
getSessionsPagein interfaceIHTMLReportContext- Returns:
- sessions page link
-
getOutputEncoding
public java.lang.String getOutputEncoding()
Description copied from interface:IHTMLReportContextReturns the encoding of the generated HTML documents.- Specified by:
getOutputEncodingin interfaceIHTMLReportContext- Returns:
- encoding for generated HTML documents
-
getIndexUpdate
public IIndexUpdate getIndexUpdate()
Description copied from interface:IHTMLReportContextReturns the service for index updates.- Specified by:
getIndexUpdatein interfaceIHTMLReportContext- Returns:
- sevice for indes updates
-
getLocale
public java.util.Locale getLocale()
Description copied from interface:IHTMLReportContextReturns the locale used to format numbers and dates.- Specified by:
getLocalein interfaceIHTMLReportContext- Returns:
- locale for numbers and dates
-
createVisitor
public IReportVisitor createVisitor(IMultiReportOutput output) throws java.io.IOException
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:
java.io.IOException- in case of problems with the output stream
-
-