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 XMLElement
writer -
Constructor Summary
ConstructorsModifierConstructorDescriptionReportElement(String name, OutputStream output, String encoding) Creates areportroot element for a XML report.privateReportElement(String name, ReportElement parent) -
Method Summary
Modifier and TypeMethodDescriptionclassElement(IClassCoverage coverage) Creates a 'class' element.voidcounter(ICoverageNode.CounterEntity counterEntity, ICounter counter) Creates a 'counter' element.private static voidcounterAttributes(XMLElement element, String missedattr, String coveredattr, ICounter counter) Creates a new child element for this element.Creates a 'group' element.voidCreates a 'line' element.method(IMethodCoverage coverage) Creates a 'method' element.private ReportElementnamedElement(String elementName, String name) packageElement(String name) Creates a 'package' element.voidsessioninfo(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 areportroot element for a XML report.- Parameters:
name- value for the name attributeoutput- output stream will be closed if the root element is closedencoding- character encoding used for output- Throws:
IOException- in case of problems with the underlying output
-
ReportElement
- Throws:
IOException
-
-
Method Details
-
element
Description copied from class:XMLElementCreates a new child element for this element. Might be overridden in subclasses to return a instance of the subclass.- Overrides:
elementin 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
-