org.jacoco.core.instr
Class BlockClassAdapter

java.lang.Object
  extended by org.jacoco.core.instr.BlockClassAdapter
All Implemented Interfaces:
ClassVisitor
Direct Known Subclasses:
ClassAnalyzer, ClassInstrumenter

public abstract class BlockClassAdapter
extends Object
implements ClassVisitor

A ClassVisitor that drives IBlockMethodVisitor for each non-abstract method.

Version:
$Revision: $
Author:
Marc R. Hoffmann

Constructor Summary
BlockClassAdapter()
           
 
Method Summary
protected  int getProbeCount()
          Returns the total number of probes of the processed class.
 int nextId()
          Returns the next unique probe id.
protected abstract  MethodVisitor visitAbstractMethod(int access, String name, String desc, String signature, String[] exceptions)
          This method is called for every abstract method.
 MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
           
protected abstract  IBlockMethodVisitor visitNonAbstractMethod(int access, String name, String desc, String signature, String[] exceptions)
          This method is called for every non-abstract method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.asm.ClassVisitor
visit, visitAnnotation, visitAttribute, visitEnd, visitField, visitInnerClass, visitOuterClass, visitSource
 

Constructor Detail

BlockClassAdapter

public BlockClassAdapter()
Method Detail

visitMethod

public final MethodVisitor visitMethod(int access,
                                       String name,
                                       String desc,
                                       String signature,
                                       String[] exceptions)
Specified by:
visitMethod in interface ClassVisitor

visitNonAbstractMethod

protected abstract IBlockMethodVisitor visitNonAbstractMethod(int access,
                                                              String name,
                                                              String desc,
                                                              String signature,
                                                              String[] exceptions)
This method is called for every non-abstract method.

Parameters:
access - the method's access flags (see Opcodes). This parameter also indicates if the method is synthetic and/or deprecated.
name - the method's name.
desc - the method's descriptor (see Type).
signature - the method's signature. May be null if the method parameters, return type and exceptions do not use generic types.
exceptions - the internal names of the method's exception classes (see getInternalName). May be null.
Returns:
an object to visit the byte code of the method, or null if this class visitor is not interested in visiting the code of this method.

visitAbstractMethod

protected abstract MethodVisitor visitAbstractMethod(int access,
                                                     String name,
                                                     String desc,
                                                     String signature,
                                                     String[] exceptions)
This method is called for every abstract method.

Parameters:
access - the method's access flags (see Opcodes). This parameter also indicates if the method is synthetic and/or deprecated.
name - the method's name.
desc - the method's descriptor (see Type).
signature - the method's signature. May be null if the method parameters, return type and exceptions do not use generic types.
exceptions - the internal names of the method's exception classes (see getInternalName). May be null.
Returns:
an object to visit the byte code of the method, or null if this class visitor is not interested in visiting the code of this method.

getProbeCount

protected final int getProbeCount()
Returns the total number of probes of the processed class.

Returns:
number of probes

nextId

public int nextId()
Returns the next unique probe id.

Returns:
unique probe id