org.objectweb.asm.tree

Class MethodNode

public class MethodNode extends MemberNode implements MethodVisitor

A node that represents a method.

Author: Eric Bruneton

Field Summary
intaccess
The method's access flags (see Opcodes).
ObjectannotationDefault
The default value of this annotation interface method.
Stringdesc
The method's descriptor (see Type).
Listexceptions
The internal names of the method's exception classes (see getInternalName).
InsnListinstructions
The instructions of this method.
List[]invisibleParameterAnnotations
The runtime invisible parameter annotations of this method.
ListlocalVariables
The local variables of this method.
intmaxLocals
The maximum number of local variables of this method.
intmaxStack
The maximum stack size of this method.
Stringname
The method's name.
Stringsignature
The method's signature.
ListtryCatchBlocks
The try catch blocks of this method.
List[]visibleParameterAnnotations
The runtime visible parameter annotations of this method.
Constructor Summary
MethodNode()
Constructs an unitialized MethodNode.
MethodNode(int access, String name, String desc, String signature, String[] exceptions)
Constructs a new MethodNode.
Method Summary
voidaccept(ClassVisitor cv)
Makes the given class visitor visit this method.
voidaccept(MethodVisitor mv)
Makes the given method visitor visit this method.
protected LabelNodegetLabelNode(Label l)
Returns the LabelNode corresponding to the given Label.
AnnotationVisitorvisitAnnotationDefault()
voidvisitCode()
voidvisitFieldInsn(int opcode, String owner, String name, String desc)
voidvisitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack)
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, String signature, 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)
AnnotationVisitorvisitParameterAnnotation(int parameter, String desc, boolean visible)
voidvisitTableSwitchInsn(int min, int max, Label dflt, Label[] labels)
voidvisitTryCatchBlock(Label start, Label end, Label handler, String type)
voidvisitTypeInsn(int opcode, String type)
voidvisitVarInsn(int opcode, int var)

Field Detail

access

public int access
The method's access flags (see Opcodes). This field also indicates if the method is synthetic and/or deprecated.

annotationDefault

public Object annotationDefault
The default value of this annotation interface method. This field must be a Byte, Boolean, Character, Short, Integer, Long, Float, Double, String or Type, or an two elements String array (for enumeration values), a AnnotationNode, or a List of values of one of the preceding types. May be null.

desc

public String desc
The method's descriptor (see Type).

exceptions

public List exceptions
The internal names of the method's exception classes (see getInternalName). This list is a list of String objects.

instructions

public InsnList instructions
The instructions of this method. This list is a list of AbstractInsnNode objects.

UNKNOWN: org.objectweb.asm.tree.AbstractInsnNode instructions

invisibleParameterAnnotations

public List[] invisibleParameterAnnotations
The runtime invisible parameter annotations of this method. These lists are lists of AnnotationNode objects. May be null.

UNKNOWN: org.objectweb.asm.tree.AnnotationNode visible parameters

localVariables

public List localVariables
The local variables of this method. This list is a list of LocalVariableNode objects. May be null

UNKNOWN: org.objectweb.asm.tree.LocalVariableNode

maxLocals

public int maxLocals
The maximum number of local variables of this method.

maxStack

public int maxStack
The maximum stack size of this method.

name

public String name
The method's name.

signature

public String signature
The method's signature. May be null.

tryCatchBlocks

public List tryCatchBlocks
The try catch blocks of this method. This list is a list of TryCatchBlockNode objects.

UNKNOWN: org.objectweb.asm.tree.TryCatchBlockNode

visibleParameterAnnotations

public List[] visibleParameterAnnotations
The runtime visible parameter annotations of this method. These lists are lists of AnnotationNode objects. May be null.

UNKNOWN: org.objectweb.asm.tree.AnnotationNode invisible parameters

Constructor Detail

MethodNode

public MethodNode()
Constructs an unitialized MethodNode.

MethodNode

public MethodNode(int access, String name, String desc, String signature, String[] exceptions)
Constructs a new MethodNode.

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. exceptions the internal names of the method's exception classes (see getInternalName). May be null.

Method Detail

accept

public void accept(ClassVisitor cv)
Makes the given class visitor visit this method.

Parameters: cv a class visitor.

accept

public void accept(MethodVisitor mv)
Makes the given method visitor visit this method.

Parameters: mv a method visitor.

getLabelNode

protected LabelNode getLabelNode(Label l)
Returns the LabelNode corresponding to the given Label. Creates a new LabelNode if necessary. The default implementation of this method uses the info field to store associations between labels and label nodes.

Parameters: l a Label.

Returns: the LabelNode corresponding to l.

visitAnnotationDefault

public AnnotationVisitor visitAnnotationDefault()

visitCode

public void visitCode()

visitFieldInsn

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

visitFrame

public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack)

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, String signature, 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)

visitParameterAnnotation

public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible)

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 type)

visitVarInsn

public void visitVarInsn(int opcode, int var)