FileDocCategorySizeDatePackage
TreeCodeAdapter.javaAPI DocGlassfish v2 API5929Thu Mar 02 11:51:16 GMT 2006oracle.toplink.libraries.asm.tree

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

Fields Summary
public MethodNode
methodNode
A tree representation of the method that is being visited by this visitor.
Constructors Summary
public TreeCodeAdapter(MethodNode methodNode)
Constructs a new {@link TreeCodeAdapter TreeCodeAdapter} object.

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

    super(null);
    this.methodNode = methodNode;
  
Methods Summary
public voidvisitAttribute(oracle.toplink.libraries.asm.Attribute attr)

    attr.next = methodNode.codeAttrs;
    methodNode.codeAttrs = attr;
  
public voidvisitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)

    AbstractInsnNode n = new FieldInsnNode(opcode, owner, name, desc);
    methodNode.instructions.add(n);
  
public voidvisitIincInsn(int var, int increment)

    AbstractInsnNode n = new IincInsnNode(var, increment);
    methodNode.instructions.add(n);
  
public voidvisitInsn(int opcode)

    AbstractInsnNode n = new InsnNode(opcode);
    methodNode.instructions.add(n);
  
public voidvisitIntInsn(int opcode, int operand)

    AbstractInsnNode n = new IntInsnNode(opcode, operand);
    methodNode.instructions.add(n);
  
public voidvisitJumpInsn(int opcode, oracle.toplink.libraries.asm.Label label)

    AbstractInsnNode n = new JumpInsnNode(opcode, label);
    methodNode.instructions.add(n);
  
public voidvisitLabel(oracle.toplink.libraries.asm.Label label)

    methodNode.instructions.add(label);
  
public voidvisitLdcInsn(java.lang.Object cst)

    AbstractInsnNode n = new LdcInsnNode(cst);
    methodNode.instructions.add(n);
  
public voidvisitLineNumber(int line, oracle.toplink.libraries.asm.Label start)

    LineNumberNode n = new LineNumberNode(line, start);
    methodNode.lineNumbers.add(n);
  
public voidvisitLocalVariable(java.lang.String name, java.lang.String desc, oracle.toplink.libraries.asm.Label start, oracle.toplink.libraries.asm.Label end, int index)

    LocalVariableNode n = new LocalVariableNode(name, desc, start, end, index);
    methodNode.localVariables.add(n);
  
public voidvisitLookupSwitchInsn(oracle.toplink.libraries.asm.Label dflt, int[] keys, oracle.toplink.libraries.asm.Label[] labels)

    AbstractInsnNode n = new LookupSwitchInsnNode(dflt, keys, labels);
    methodNode.instructions.add(n);
  
public voidvisitMaxs(int maxStack, int maxLocals)

    methodNode.maxStack = maxStack;
    methodNode.maxLocals = maxLocals;
  
public voidvisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)

    AbstractInsnNode n = new MethodInsnNode(opcode, owner, name, desc);
    methodNode.instructions.add(n);
  
public voidvisitMultiANewArrayInsn(java.lang.String desc, int dims)

    AbstractInsnNode n = new MultiANewArrayInsnNode(desc, dims);
    methodNode.instructions.add(n);
  
public voidvisitTableSwitchInsn(int min, int max, oracle.toplink.libraries.asm.Label dflt, oracle.toplink.libraries.asm.Label[] labels)

    AbstractInsnNode n = new TableSwitchInsnNode(min, max, dflt, labels);
    methodNode.instructions.add(n);
  
public voidvisitTryCatchBlock(oracle.toplink.libraries.asm.Label start, oracle.toplink.libraries.asm.Label end, oracle.toplink.libraries.asm.Label handler, java.lang.String type)

    TryCatchBlockNode n = new TryCatchBlockNode(start, end, handler, type);
    methodNode.tryCatchBlocks.add(n);
  
public voidvisitTypeInsn(int opcode, java.lang.String desc)

    AbstractInsnNode n = new TypeInsnNode(opcode, desc);
    methodNode.instructions.add(n);
  
public voidvisitVarInsn(int opcode, int var)

    AbstractInsnNode n = new VarInsnNode(opcode, var);
    methodNode.instructions.add(n);