Package org.jacoco.core.internal.analysis

## 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`

    public class ClassAnalyzer
    extends ClassProbesVisitor
    implements IFilterContext

Analyzes the structure of a class.

### Field Summary

### Fields inherited from class org.objectweb.asm.ClassVisitor

`api, cv`

### Constructor Summary

Constructors
`ClassAnalyzer​(ClassCoverageImpl coverage, boolean[] probes, StringPool stringPool)` Creates a new analyzer that builds coverage data for a class.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.util.Set<java.lang.String>` `getClassAnnotations()`
`java.lang.String` `getClassName()`
`java.lang.String` `getSourceDebugExtension()`
`java.lang.String` `getSourceFileName()`
`java.lang.String` `getSuperClassName()`
`void` `visit​(int version, int access, java.lang.String name, java.lang.String signature, java.lang.String superName, java.lang.String[] interfaces)`
`org.objectweb.asm.AnnotationVisitor` `visitAnnotation​(java.lang.String desc, boolean visible)`
`org.objectweb.asm.FieldVisitor` `visitField​(int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.Object value)`
`MethodProbesVisitor` `visitMethod​(int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.String[] exceptions)` When visiting a method we need a `MethodProbesVisitor` to handle the probes of that method.
`void` `visitSource​(java.lang.String source, java.lang.String debug)`
`void` `visitTotalProbeCount​(int count)` Reports the total number of encountered probes.

### Methods inherited from class org.objectweb.asm.ClassVisitor

`visitAttribute, visitEnd, visitInnerClass, visitModule, visitNestHost, visitNestMember, visitOuterClass, visitTypeAnnotation`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ClassAnalyzer

    public ClassAnalyzer​(ClassCoverageImpl coverage,
                         boolean[] probes,
                         StringPool stringPool)

Creates a new analyzer that builds coverage data for a class.

Parameters:
  `coverage` - coverage node for the analyzed class data
  `probes` - execution data for this class or `null`
  `stringPool` - shared pool to minimize the number of `String` instances

### Method Detail

#### visit

    public void visit​(int version,
                      int access,
                      java.lang.String name,
                      java.lang.String signature,
                      java.lang.String superName,
                      java.lang.String[] interfaces)

Overrides:
  `visit` in class `org.objectweb.asm.ClassVisitor`

#### visitAnnotation

    public org.objectweb.asm.AnnotationVisitor visitAnnotation​(java.lang.String desc,
                                                               boolean visible)

Overrides:
  `visitAnnotation` in class `org.objectweb.asm.ClassVisitor`

#### visitSource

    public void visitSource​(java.lang.String source,
                            java.lang.String debug)

Overrides:
  `visitSource` in class `org.objectweb.asm.ClassVisitor`

#### visitMethod

    public MethodProbesVisitor visitMethod​(int access,
                                           java.lang.String name,
                                           java.lang.String desc,
                                           java.lang.String signature,
                                           java.lang.String[] exceptions)

Description copied from class: `ClassProbesVisitor`
When visiting a method we need a `MethodProbesVisitor` to handle the probes of that method.

Specified by:
  `visitMethod` in class `ClassProbesVisitor`

#### visitField

    public org.objectweb.asm.FieldVisitor visitField​(int access,
                                                     java.lang.String name,
                                                     java.lang.String desc,
                                                     java.lang.String signature,
                                                     java.lang.Object value)

Overrides:
  `visitField` in class `org.objectweb.asm.ClassVisitor`

#### visitTotalProbeCount

    public void visitTotalProbeCount​(int count)

Description copied from class: `ClassProbesVisitor`
Reports the total number of encountered probes. For classes this method is called just before `ClassVisitor.visitEnd()`. For interfaces this method is called before the first method (the static initializer) is emitted.

Specified by:
  `visitTotalProbeCount` in class `ClassProbesVisitor`
Parameters:
  `count` - total number of probes

#### getClassName

    public java.lang.String getClassName()

Specified by:
  `getClassName` in interface `IFilterContext`
Returns:
  vm name of the enclosing class

#### getSuperClassName

    public java.lang.String getSuperClassName()

Specified by:
  `getSuperClassName` in interface `IFilterContext`
Returns:
  vm name of the super class of the enclosing class

#### getClassAnnotations

    public java.util.Set<java.lang.String> getClassAnnotations()

Specified by:
  `getClassAnnotations` in interface `IFilterContext`
Returns:
  vm names of the class annotations of the enclosing class

#### getSourceFileName

    public java.lang.String getSourceFileName()

Specified by:
  `getSourceFileName` in interface `IFilterContext`
Returns:
  file name of the corresponding source file or `null` if not available

#### getSourceDebugExtension

    public java.lang.String getSourceDebugExtension()

Specified by:
  `getSourceDebugExtension` in interface `IFilterContext`
Returns:
  value of SourceDebugExtension attribute or `null` if not available