Class ClassAnalyzer
java.lang.Object
org.objectweb.asm.ClassVisitor
org.jacoco.core.internal.flow.ClassProbesVisitor
org.jacoco.core.internal.analysis.ClassAnalyzer
- All Implemented Interfaces:
IFilterContext
Analyzes the structure of a class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassCoverageImpl
private final IFilter
private final boolean[]
private String
private final StringPool
Fields inherited from class org.objectweb.asm.ClassVisitor
api, cv
-
Constructor Summary
ConstructorsConstructorDescriptionClassAnalyzer
(ClassCoverageImpl coverage, boolean[] probes, StringPool stringPool) Creates a new analyzer that builds coverage data for a class. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addMethodCoverage
(String name, String desc, String signature, InstructionsBuilder icc, org.objectweb.asm.tree.MethodNode methodNode) void
visit
(int version, int access, String name, String signature, String superName, String[] interfaces) org.objectweb.asm.AnnotationVisitor
visitAnnotation
(String desc, boolean visible) void
visitAttribute
(org.objectweb.asm.Attribute attribute) org.objectweb.asm.FieldVisitor
visitField
(int access, String name, String desc, String signature, Object value) visitMethod
(int access, String name, String desc, String signature, String[] exceptions) When visiting a method we need aMethodProbesVisitor
to handle the probes of that method.void
visitSource
(String source, String debug) void
visitTotalProbeCount
(int count) Reports the total number of encountered probes.Methods inherited from class org.objectweb.asm.ClassVisitor
getDelegate, visitEnd, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitPermittedSubclass, visitRecordComponent, visitTypeAnnotation
-
Field Details
-
coverage
-
probes
private final boolean[] probes -
stringPool
-
classAnnotations
-
classAttributes
-
sourceDebugExtension
-
filter
-
-
Constructor Details
-
ClassAnalyzer
Creates a new analyzer that builds coverage data for a class.- Parameters:
coverage
- coverage node for the analyzed class dataprobes
- execution data for this class ornull
stringPool
- shared pool to minimize the number ofString
instances
-
-
Method Details
-
visit
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) - Overrides:
visit
in classorg.objectweb.asm.ClassVisitor
-
visitAnnotation
- Overrides:
visitAnnotation
in classorg.objectweb.asm.ClassVisitor
-
visitAttribute
public void visitAttribute(org.objectweb.asm.Attribute attribute) - Overrides:
visitAttribute
in classorg.objectweb.asm.ClassVisitor
-
visitSource
- Overrides:
visitSource
in classorg.objectweb.asm.ClassVisitor
-
visitMethod
public MethodProbesVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) Description copied from class:ClassProbesVisitor
When visiting a method we need aMethodProbesVisitor
to handle the probes of that method.- Specified by:
visitMethod
in classClassProbesVisitor
-
addMethodCoverage
private void addMethodCoverage(String name, String desc, String signature, InstructionsBuilder icc, org.objectweb.asm.tree.MethodNode methodNode) -
visitField
public org.objectweb.asm.FieldVisitor visitField(int access, String name, String desc, String signature, Object value) - Overrides:
visitField
in classorg.objectweb.asm.ClassVisitor
-
visitTotalProbeCount
public void visitTotalProbeCount(int count) Description copied from class:ClassProbesVisitor
Reports the total number of encountered probes. This method is called just beforeClassVisitor.visitEnd()
- Specified by:
visitTotalProbeCount
in classClassProbesVisitor
- Parameters:
count
- total number of probes
-
getClassName
- Specified by:
getClassName
in interfaceIFilterContext
- Returns:
- vm name of the enclosing class
-
getSuperClassName
- Specified by:
getSuperClassName
in interfaceIFilterContext
- Returns:
- vm name of the super class of the enclosing class
-
getClassAnnotations
- Specified by:
getClassAnnotations
in interfaceIFilterContext
- Returns:
- vm names of the class annotations of the enclosing class
-
getClassAttributes
- Specified by:
getClassAttributes
in interfaceIFilterContext
- Returns:
- names of the class attributes
-
getSourceFileName
- Specified by:
getSourceFileName
in interfaceIFilterContext
- Returns:
- file name of the corresponding source file or
null
if not available
-
getSourceDebugExtension
- Specified by:
getSourceDebugExtension
in interfaceIFilterContext
- Returns:
- value of SourceDebugExtension attribute or
null
if not available
-