org.objectweb.asm.tree

Class TreeCodeAdapter

public class TreeCodeAdapter extends CodeAdapter

A {@link CodeAdapter CodeAdapter} that constructs a tree representation of the methods it vists. Each visitXXX method of this class constructs an XXXNode and adds it to the {@link #methodNode methodNode} node.

Author: Eric Bruneton

Field Summary
MethodNodemethodNode
A tree representation of the method that is being visited by this visitor.
Constructor Summary
TreeCodeAdapter(MethodNode methodNode)
Constructs a new {@link TreeCodeAdapter TreeCodeAdapter} object.
Method Summary
voidvisitAttribute(Attribute attr)
voidvisitFieldInsn(int opcode, String owner, String name, String desc)
voidvisitIincInsn(int var, int increment)
voidvisitInsn(int opcode)
voidvisitIntInsn(int opcode, int operand)
voidvisitJumpInsn(int opcode, Label label)
voidvisitLabel(Label label)
voidvisitLdcInsn(Object cst)
voidvisitLineNumber(int line, Label start)
voidvisitLocalVariable(String name, String desc, Label start, Label end, int index)
voidvisitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels)
voidvisitMaxs(int maxStack, int maxLocals)
voidvisitMethodInsn(int opcode, String owner, String name, String desc)
voidvisitMultiANewArrayInsn(String desc, int dims)
voidvisitTableSwitchInsn(int min, int max, Label dflt, Label[] labels)
voidvisitTryCatchBlock(Label start, Label end, Label handler, String type)
voidvisitTypeInsn(int opcode, String desc)
voidvisitVarInsn(int opcode, int var)

Field Detail

methodNode

public MethodNode methodNode
A tree representation of the method that is being visited by this visitor.

Constructor Detail

TreeCodeAdapter

public TreeCodeAdapter(MethodNode methodNode)
Constructs a new {@link TreeCodeAdapter TreeCodeAdapter} object.

Parameters: methodNode the method node to be used to store the tree representation constructed by this code visitor.

Method Detail

visitAttribute

public void visitAttribute(Attribute attr)

visitFieldInsn

public void visitFieldInsn(int opcode, String owner, String name, String desc)

visitIincInsn

public void visitIincInsn(int var, int increment)

visitInsn

public void visitInsn(int opcode)

visitIntInsn

public void visitIntInsn(int opcode, int operand)

visitJumpInsn

public void visitJumpInsn(int opcode, Label label)

visitLabel

public void visitLabel(Label label)

visitLdcInsn

public void visitLdcInsn(Object cst)

visitLineNumber

public void visitLineNumber(int line, Label start)

visitLocalVariable

public void visitLocalVariable(String name, String desc, Label start, Label end, int index)

visitLookupSwitchInsn

public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels)

visitMaxs

public void visitMaxs(int maxStack, int maxLocals)

visitMethodInsn

public void visitMethodInsn(int opcode, String owner, String name, String desc)

visitMultiANewArrayInsn

public void visitMultiANewArrayInsn(String desc, int dims)

visitTableSwitchInsn

public void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels)

visitTryCatchBlock

public void visitTryCatchBlock(Label start, Label end, Label handler, String type)

visitTypeInsn

public void visitTypeInsn(int opcode, String desc)

visitVarInsn

public void visitVarInsn(int opcode, int var)