org.jacoco.core.instr
Class BlockMethodAdapter

java.lang.Object
  extended by org.objectweb.asm.tree.MemberNode
      extended by org.objectweb.asm.tree.MethodNode
          extended by org.jacoco.core.instr.BlockMethodAdapter
All Implemented Interfaces:
MethodVisitor

public final class BlockMethodAdapter
extends MethodNode

A method visitor that determines block boundaries and reports them to the wrapped IBlockMethodVisitor. The implementation first buffers the content of the method to extract all control flow target labels. At the end of the method it flushes the content to the IBlockMethodVisitor.

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

Field Summary
 
Fields inherited from class org.objectweb.asm.tree.MethodNode
access, annotationDefault, desc, exceptions, instructions, invisibleParameterAnnotations, localVariables, maxLocals, maxStack, name, signature, tryCatchBlocks, visibleParameterAnnotations
 
Fields inherited from class org.objectweb.asm.tree.MemberNode
attrs, invisibleAnnotations, visibleAnnotations
 
Constructor Summary
BlockMethodAdapter(IBlockMethodVisitor blockVisitor, org.jacoco.core.instr.IProbeIdGenerator idGenerator, int access, String name, String desc, String signature, String[] exceptions)
          Create a new adapter for the given block visitor.
 
Method Summary
 void visitEnd()
           
 void visitJumpInsn(int opcode, Label label)
           
 void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels)
           
 void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels)
           
 void visitTryCatchBlock(Label start, Label end, Label handler, String type)
           
 
Methods inherited from class org.objectweb.asm.tree.MethodNode
accept, accept, getLabelNode, visitAnnotationDefault, visitCode, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitParameterAnnotation, visitTypeInsn, visitVarInsn
 
Methods inherited from class org.objectweb.asm.tree.MemberNode
visitAnnotation, visitAttribute
 
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.MethodVisitor
visitAnnotation, visitAttribute
 

Constructor Detail

BlockMethodAdapter

public BlockMethodAdapter(IBlockMethodVisitor blockVisitor,
                          org.jacoco.core.instr.IProbeIdGenerator idGenerator,
                          int access,
                          String name,
                          String desc,
                          String signature,
                          String[] exceptions)
Create a new adapter for the given block visitor.

Parameters:
blockVisitor - visitor to report block boundaries to
idGenerator - generator for probe ids
access - the method's access flags
name - the method's name.
desc - the method's descriptor
signature - the method's signature. May be null.
exceptions - the internal names of the method's exception classes. May be null.
Method Detail

visitJumpInsn

public void visitJumpInsn(int opcode,
                          Label label)
Specified by:
visitJumpInsn in interface MethodVisitor
Overrides:
visitJumpInsn in class MethodNode

visitTableSwitchInsn

public void visitTableSwitchInsn(int min,
                                 int max,
                                 Label dflt,
                                 Label[] labels)
Specified by:
visitTableSwitchInsn in interface MethodVisitor
Overrides:
visitTableSwitchInsn in class MethodNode

visitLookupSwitchInsn

public void visitLookupSwitchInsn(Label dflt,
                                  int[] keys,
                                  Label[] labels)
Specified by:
visitLookupSwitchInsn in interface MethodVisitor
Overrides:
visitLookupSwitchInsn in class MethodNode

visitTryCatchBlock

public void visitTryCatchBlock(Label start,
                               Label end,
                               Label handler,
                               String type)
Specified by:
visitTryCatchBlock in interface MethodVisitor
Overrides:
visitTryCatchBlock in class MethodNode

visitEnd

public void visitEnd()
Specified by:
visitEnd in interface MethodVisitor
Overrides:
visitEnd in class MemberNode