Class ReportElement


  • public class ReportElement
    extends XMLElement
    A XMLElement with utility methods to create JaCoCo XML reports.
    • Constructor Detail

      • ReportElement

        public ReportElement​(java.lang.String name,
                             java.io.OutputStream output,
                             java.lang.String encoding)
                      throws java.io.IOException
        Creates a report root element for a XML report.
        Parameters:
        name - value for the name attribute
        encoding - character encoding used for output
        output - output stream will be closed if the root element is closed
        Throws:
        java.io.IOException - in case of problems with the underlying output
    • Method Detail

      • element

        public ReportElement element​(java.lang.String name)
                              throws java.io.IOException
        Description copied from class: XMLElement
        Creates a new child element for this element. Might be overridden in subclasses to return a instance of the subclass.
        Overrides:
        element in class XMLElement
        Parameters:
        name - name of the child element
        Returns:
        child element instance
        Throws:
        java.io.IOException - in case of problems with the underlying output
      • sessioninfo

        public void sessioninfo​(SessionInfo info)
                         throws java.io.IOException
        Creates a 'sessioninfo' element.
        Parameters:
        info - info object to write out
        Throws:
        java.io.IOException - in case of problems with the underlying output
      • group

        public ReportElement group​(java.lang.String name)
                            throws java.io.IOException
        Creates a 'group' element.
        Parameters:
        name - value for the name attribute
        Returns:
        'group' element
        Throws:
        java.io.IOException - in case of problems with the underlying output
      • packageElement

        public ReportElement packageElement​(java.lang.String name)
                                     throws java.io.IOException
        Creates a 'package' element.
        Parameters:
        name - value for the name attribute
        Returns:
        'package' element
        Throws:
        java.io.IOException - in case of problems with the underlying output
      • classElement

        public ReportElement classElement​(IClassCoverage coverage)
                                   throws java.io.IOException
        Creates a 'class' element.
        Parameters:
        coverage - class coverage node to write out
        Returns:
        'class' element
        Throws:
        java.io.IOException - in case of problems with the underlying output
      • method

        public ReportElement method​(IMethodCoverage coverage)
                             throws java.io.IOException
        Creates a 'method' element.
        Parameters:
        coverage - method coverage node to write out
        Returns:
        'method' element
        Throws:
        java.io.IOException - in case of problems with the underlying output
      • sourcefile

        public ReportElement sourcefile​(java.lang.String name)
                                 throws java.io.IOException
        Creates a 'sourcefile' element.
        Parameters:
        name - value for the name attribute
        Returns:
        'sourcefile' element
        Throws:
        java.io.IOException - in case of problems with the underlying output
      • line

        public void line​(int nr,
                         ILine line)
                  throws java.io.IOException
        Creates a 'line' element.
        Parameters:
        nr - line number
        line - line object to write out
        Throws:
        java.io.IOException - in case of problems with the underlying output
      • counter

        public void counter​(ICoverageNode.CounterEntity counterEntity,
                            ICounter counter)
                     throws java.io.IOException
        Creates a 'counter' element.
        Parameters:
        counterEntity - entity of this counter
        counter - counter object to write out
        Throws:
        java.io.IOException - in case of problems with the underlying output