Class HTMLFormatter

  • All Implemented Interfaces:
    IHTMLReportContext

    public class HTMLFormatter
    extends java.lang.Object
    implements IHTMLReportContext
    Formatter for coverage reports in multiple HTML pages.
    • Field Detail

      • locale

        private java.util.Locale locale
      • footerText

        private java.lang.String footerText
      • outputEncoding

        private java.lang.String outputEncoding
      • table

        private Table table
    • Constructor Detail

      • HTMLFormatter

        public HTMLFormatter()
        New instance with default settings.
    • 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
      • createTable

        private Table createTable()
      • getFooterText

        public java.lang.String getFooterText()
        Description copied from interface: IHTMLReportContext
        Returns a string of textual information to include in every page footer.
        Specified by:
        getFooterText in interface IHTMLReportContext
        Returns:
        footer text or empty string
      • getOutputEncoding

        public java.lang.String getOutputEncoding()
        Description copied from interface: IHTMLReportContext
        Returns the encoding of the generated HTML documents.
        Specified by:
        getOutputEncoding in interface IHTMLReportContext
        Returns:
        encoding for generated HTML documents
      • getLocale

        public java.util.Locale getLocale()
        Description copied from interface: IHTMLReportContext
        Returns the locale used to format numbers and dates.
        Specified by:
        getLocale in interface IHTMLReportContext
        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