Package org.jacoco.core.analysis
Class CoverageBuilder
java.lang.Object
org.jacoco.core.analysis.CoverageBuilder
- All Implemented Interfaces:
ICoverageVisitor
Builder for hierarchical
ICoverageNode
structures from single
IClassCoverage
nodes. The nodes are feed into the builder through its
ICoverageVisitor
interface. Afterwards the aggregated data can be
obtained with getClasses()
, getSourceFiles()
or
getBundle(String)
in the following hierarchy:
IBundleCoverage
+--IPackageCoverage
* +--IClassCoverage
* +--ISourceFileCoverage
*
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String,
IClassCoverage> private final Map<String,
ISourceFileCoverage> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a bundle from all nodes currently contained in this bundle.Returns all class nodes currently contained in this builder.Returns all classes for which execution data does not match.private SourceFileCoverageImpl
getSourceFile
(String filename, String packagename) Returns all source file nodes currently contained in this builder.void
visitCoverage
(IClassCoverage coverage) For analyzed class coverage data is emitted to this method.
-
Field Details
-
classes
-
sourcefiles
-
-
Constructor Details
-
CoverageBuilder
public CoverageBuilder()Create a new builder.
-
-
Method Details
-
getClasses
Returns all class nodes currently contained in this builder.- Returns:
- all class nodes
-
getSourceFiles
Returns all source file nodes currently contained in this builder.- Returns:
- all source file nodes
-
getBundle
Creates a bundle from all nodes currently contained in this bundle.- Parameters:
name
- Name of the bundle- Returns:
- bundle containing all classes and source files
-
getNoMatchClasses
Returns all classes for which execution data does not match.- Returns:
- collection of classes with non-matching execution data
- See Also:
-
visitCoverage
Description copied from interface:ICoverageVisitor
For analyzed class coverage data is emitted to this method.- Specified by:
visitCoverage
in interfaceICoverageVisitor
- Parameters:
coverage
- coverage data for a class
-
getSourceFile
-