org.jacoco.core.instr
Class ClassInstrumenter

java.lang.Object
  extended by org.jacoco.core.instr.BlockClassAdapter
      extended by org.jacoco.core.instr.ClassInstrumenter
All Implemented Interfaces:
ClassVisitor

public class ClassInstrumenter
extends BlockClassAdapter

Adapter that instruments a class for coverage tracing.

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

Constructor Summary
ClassInstrumenter(long id, IExecutionDataAccessorGenerator accessorGenerator, ClassVisitor cv)
          Emits a instrumented version of this class to the given class visitor.
 
Method Summary
 void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
           
protected  MethodVisitor visitAbstractMethod(int access, String name, String desc, String signature, String[] exceptions)
          This method is called for every abstract method.
 AnnotationVisitor visitAnnotation(String desc, boolean visible)
           
 void visitAttribute(Attribute attr)
           
 void visitEnd()
           
 FieldVisitor visitField(int access, String name, String desc, String signature, Object value)
           
 void visitInnerClass(String name, String outerName, String innerName, int access)
           
protected  IBlockMethodVisitor visitNonAbstractMethod(int access, String name, String desc, String signature, String[] exceptions)
          This method is called for every non-abstract method.
 void visitOuterClass(String owner, String name, String desc)
           
 void visitSource(String source, String debug)
           
 
Methods inherited from class org.jacoco.core.instr.BlockClassAdapter
getProbeCount, nextId, visitMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassInstrumenter

public ClassInstrumenter(long id,
                         IExecutionDataAccessorGenerator accessorGenerator,
                         ClassVisitor cv)
Emits a instrumented version of this class to the given class visitor.

Parameters:
id - unique identifier given to this class
accessorGenerator - this generator will be used for instrumentation
cv - next delegate in the visitor chain will receive the instrumented class
Method Detail

visit

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

visitField

public FieldVisitor visitField(int access,
                               String name,
                               String desc,
                               String signature,
                               Object value)

visitNonAbstractMethod

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

Specified by:
visitNonAbstractMethod in class BlockClassAdapter
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 MethodVisitor visitAbstractMethod(int access,
                                            String name,
                                            String desc,
                                            String signature,
                                            String[] exceptions)
Description copied from class: BlockClassAdapter
This method is called for every abstract method.

Specified by:
visitAbstractMethod in class BlockClassAdapter
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.

visitEnd

public void visitEnd()

visitAnnotation

public AnnotationVisitor visitAnnotation(String desc,
                                         boolean visible)

visitAttribute

public void visitAttribute(Attribute attr)

visitInnerClass

public void visitInnerClass(String name,
                            String outerName,
                            String innerName,
                            int access)

visitOuterClass

public void visitOuterClass(String owner,
                            String name,
                            String desc)

visitSource

public void visitSource(String source,
                        String debug)