Package org.jacoco.report.internal
Class AbstractGroupVisitor
- java.lang.Object
-
- org.jacoco.report.internal.AbstractGroupVisitor
-
- All Implemented Interfaces:
IReportGroupVisitor
- Direct Known Subclasses:
HTMLGroupVisitor,XMLGroupVisitor
public abstract class AbstractGroupVisitor extends java.lang.Object implements IReportGroupVisitor
Internal base visitor to calculate group counter summaries for hierarchical reports.
-
-
Field Summary
Fields Modifier and Type Field Description protected CoverageNodeImpltotalcoverage node for this group to total counters
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractGroupVisitor(java.lang.String name)Creates a new group with the given name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidhandleBundle(IBundleCoverage bundle, ISourceFileLocator locator)Called to handle the given bundle in a specific way.protected abstract voidhandleEnd()Called to handle the end of this group in a specific way.protected abstract AbstractGroupVisitorhandleGroup(java.lang.String name)Called to handle a group with the given name in a specific way.voidvisitBundle(IBundleCoverage bundle, ISourceFileLocator locator)Called to add a bundle to the the report.voidvisitEnd()Must be called at the end of every group.IReportGroupVisitorvisitGroup(java.lang.String name)Called to add a new group to the report.
-
-
-
Field Detail
-
total
protected final CoverageNodeImpl total
coverage node for this group to total counters
-
-
Method Detail
-
visitBundle
public final void visitBundle(IBundleCoverage bundle, ISourceFileLocator locator) throws java.io.IOException
Description copied from interface:IReportGroupVisitorCalled to add a bundle to the the report.- Specified by:
visitBundlein interfaceIReportGroupVisitor- Parameters:
bundle- a bundle to include in the reportlocator- source locator for this bundle- Throws:
java.io.IOException- in case of IO problems with the report writer
-
handleBundle
protected abstract void handleBundle(IBundleCoverage bundle, ISourceFileLocator locator) throws java.io.IOException
Called to handle the given bundle in a specific way.- Parameters:
bundle- analyzed bundlelocator- source locator- Throws:
java.io.IOException- if the report can't be written
-
visitGroup
public final IReportGroupVisitor visitGroup(java.lang.String name) throws java.io.IOException
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:
java.io.IOException- in case of IO problems with the report writer
-
handleGroup
protected abstract AbstractGroupVisitor handleGroup(java.lang.String name) throws java.io.IOException
Called to handle a group with the given name in a specific way.- Parameters:
name- name of the group- Returns:
- created child group
- Throws:
java.io.IOException- if the report can't be written
-
visitEnd
public final void visitEnd() throws java.io.IOExceptionMust be called at the end of every group.- Throws:
java.io.IOException- if the report can't be written
-
handleEnd
protected abstract void handleEnd() throws java.io.IOExceptionCalled to handle the end of this group in a specific way.- Throws:
java.io.IOException- if the report can't be written
-
-