Package org.jacoco.report.internal.xml
Class ReportElement
java.lang.Object
org.jacoco.report.internal.xml.XMLElement
org.jacoco.report.internal.xml.ReportElement
A
XMLElement
with utility methods to create JaCoCo XML reports.-
Field Summary
FieldsFields inherited from class org.jacoco.report.internal.xml.XMLElement
writer
-
Constructor Summary
ConstructorsModifierConstructorDescriptionReportElement
(String name, OutputStream output, String encoding) Creates areport
root element for a XML report.private
ReportElement
(String name, ReportElement parent) -
Method Summary
Modifier and TypeMethodDescriptionclassElement
(IClassCoverage coverage) Creates a 'class' element.void
counter
(ICoverageNode.CounterEntity counterEntity, ICounter counter) Creates a 'counter' element.private static void
counterAttributes
(XMLElement element, String missedattr, String coveredattr, ICounter counter) Creates a new child element for this element.Creates a 'group' element.void
Creates a 'line' element.method
(IMethodCoverage coverage) Creates a 'method' element.private ReportElement
namedElement
(String elementName, String name) packageElement
(String name) Creates a 'package' element.void
sessioninfo
(SessionInfo info) Creates a 'sessioninfo' element.sourcefile
(String name) Creates a 'sourcefile' element.
-
Field Details
-
PUBID
- See Also:
-
SYSTEM
- See Also:
-
-
Constructor Details
-
ReportElement
Creates areport
root element for a XML report.- Parameters:
name
- value for the name attributeencoding
- character encoding used for outputoutput
- output stream will be closed if the root element is closed- Throws:
IOException
- in case of problems with the underlying output
-
ReportElement
- Throws:
IOException
-
-
Method Details
-
element
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 classXMLElement
- Parameters:
name
- name of the child element- Returns:
- child element instance
- Throws:
IOException
- in case of problems with the underlying output
-
namedElement
- Throws:
IOException
-
sessioninfo
Creates a 'sessioninfo' element.- Parameters:
info
- info object to write out- Throws:
IOException
- in case of problems with the underlying output
-
group
Creates a 'group' element.- Parameters:
name
- value for the name attribute- Returns:
- 'group' element
- Throws:
IOException
- in case of problems with the underlying output
-
packageElement
Creates a 'package' element.- Parameters:
name
- value for the name attribute- Returns:
- 'package' element
- Throws:
IOException
- in case of problems with the underlying output
-
classElement
Creates a 'class' element.- Parameters:
coverage
- class coverage node to write out- Returns:
- 'class' element
- Throws:
IOException
- in case of problems with the underlying output
-
method
Creates a 'method' element.- Parameters:
coverage
- method coverage node to write out- Returns:
- 'method' element
- Throws:
IOException
- in case of problems with the underlying output
-
sourcefile
Creates a 'sourcefile' element.- Parameters:
name
- value for the name attribute- Returns:
- 'sourcefile' element
- Throws:
IOException
- in case of problems with the underlying output
-
line
Creates a 'line' element.- Parameters:
nr
- line numberline
- line object to write out- Throws:
IOException
- in case of problems with the underlying output
-
counter
Creates a 'counter' element.- Parameters:
counterEntity
- entity of this countercounter
- counter object to write out- Throws:
IOException
- in case of problems with the underlying output
-
counterAttributes
private static void counterAttributes(XMLElement element, String missedattr, String coveredattr, ICounter counter) throws IOException - Throws:
IOException
-