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 ClassCoverageImplprivate final IFilterprivate final boolean[]private Stringprivate final StringPoolFields 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 voidaddMethodCoverage(String name, String desc, String signature, InstructionsBuilder icc, org.objectweb.asm.tree.MethodNode methodNode) voidvisit(int version, int access, String name, String signature, String superName, String[] interfaces) org.objectweb.asm.AnnotationVisitorvisitAnnotation(String desc, boolean visible) voidvisitAttribute(org.objectweb.asm.Attribute attribute) org.objectweb.asm.FieldVisitorvisitField(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 aMethodProbesVisitorto handle the probes of that method.voidvisitSource(String source, String debug) voidvisitTotalProbeCount(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 ornullstringPool- shared pool to minimize the number ofStringinstances
-
-
Method Details
-
visit
-
visitAnnotation
- Overrides:
visitAnnotationin classorg.objectweb.asm.ClassVisitor
-
visitAttribute
public void visitAttribute(org.objectweb.asm.Attribute attribute) - Overrides:
visitAttributein classorg.objectweb.asm.ClassVisitor
-
visitSource
-
visitMethod
public MethodProbesVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) Description copied from class:ClassProbesVisitorWhen visiting a method we need aMethodProbesVisitorto handle the probes of that method.- Specified by:
visitMethodin classClassProbesVisitor
-
addMethodCoverage
private void addMethodCoverage(String name, String desc, String signature, InstructionsBuilder icc, org.objectweb.asm.tree.MethodNode methodNode) -
visitField
-
visitTotalProbeCount
public void visitTotalProbeCount(int count) Description copied from class:ClassProbesVisitorReports the total number of encountered probes. This method is called just beforeClassVisitor.visitEnd()- Specified by:
visitTotalProbeCountin classClassProbesVisitor- Parameters:
count- total number of probes
-
getClassName
- Specified by:
getClassNamein interfaceIFilterContext- Returns:
- vm name of the enclosing class
-
getSuperClassName
- Specified by:
getSuperClassNamein interfaceIFilterContext- Returns:
- vm name of the super class of the enclosing class
-
getClassAnnotations
- Specified by:
getClassAnnotationsin interfaceIFilterContext- Returns:
- vm names of the class annotations of the enclosing class
-
getClassAttributes
- Specified by:
getClassAttributesin interfaceIFilterContext- Returns:
- names of the class attributes
-
getSourceFileName
- Specified by:
getSourceFileNamein interfaceIFilterContext- Returns:
- file name of the corresponding source file or
nullif not available
-
getSourceDebugExtension
- Specified by:
getSourceDebugExtensionin interfaceIFilterContext- Returns:
- value of SourceDebugExtension attribute or
nullif not available
-