Class AbstractGroupVisitor
java.lang.Object
org.jacoco.report.internal.AbstractGroupVisitor
- All Implemented Interfaces:
IReportGroupVisitor
- Direct Known Subclasses:
HTMLGroupVisitor, XMLGroupVisitor
Internal base visitor to calculate group counter summaries for hierarchical
reports.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AbstractGroupVisitorprotected final CoverageNodeImplcoverage node for this group to total counters -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractGroupVisitor(String name) Creates a new group with the given name. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprotected abstract voidhandleBundle(IBundleCoverage bundle, ISourceFileLocator locator) Called to handle the given bundle in a specific way.protected abstract voidCalled to handle the end of this group in a specific way.protected abstract AbstractGroupVisitorhandleGroup(String name) Called to handle a group with the given name in a specific way.final voidvisitBundle(IBundleCoverage bundle, ISourceFileLocator locator) Called to add a bundle to the report.final voidvisitEnd()Must be called at the end of every group.final IReportGroupVisitorvisitGroup(String name) Called to add a new group to the report.
-
Field Details
-
total
coverage node for this group to total counters -
lastChild
-
-
Constructor Details
-
AbstractGroupVisitor
Creates a new group with the given name.- Parameters:
name- name for the coverage node created internally
-
-
Method Details
-
visitBundle
public final void visitBundle(IBundleCoverage bundle, ISourceFileLocator locator) throws IOException Description copied from interface:IReportGroupVisitorCalled to add a bundle to the report.- Specified by:
visitBundlein interfaceIReportGroupVisitor- Parameters:
bundle- a bundle to include in the reportlocator- source locator for this bundle- Throws:
IOException- in case of IO problems with the report writer
-
handleBundle
protected abstract void handleBundle(IBundleCoverage bundle, ISourceFileLocator locator) throws IOException Called to handle the given bundle in a specific way.- Parameters:
bundle- analyzed bundlelocator- source locator- Throws:
IOException- if the report can't be written
-
visitGroup
Description copied from interface:IReportGroupVisitorCalled to add a new group to the report. The returnedIReportGroupVisitorinstance can be used to add nested bundles or groups. The content of the group has to be completed before this or any parent visitor can be used again ("deep first").- Specified by:
visitGroupin interfaceIReportGroupVisitor- Parameters:
name- name of the group- Returns:
- visitor for the group's content
- Throws:
IOException- in case of IO problems with the report writer
-
handleGroup
Called to handle a group with the given name in a specific way.- Parameters:
name- name of the group- Returns:
- created child group
- Throws:
IOException- if the report can't be written
-
visitEnd
Must be called at the end of every group.- Throws:
IOException- if the report can't be written
-
handleEnd
Called to handle the end of this group in a specific way.- Throws:
IOException- if the report can't be written
-
finalizeLastChild
- Throws:
IOException
-