org.objectweb.asm.tree

Class MethodNode

Implemented Interfaces:
MethodVisitor

public class MethodNode
extends MemberNode
implements MethodVisitor

A node that represents a method.
Author:
Eric Bruneton

Field Summary

int
access
The method's access flags (see Opcodes).
Object
annotationDefault
The default value of this annotation interface method.
String
desc
The method's descriptor (see Type).
List
exceptions
The internal names of the method's exception classes (see getInternalName).
List
instructions
The instructions of this method.
List[]
invisibleParameterAnnotations
The runtime invisible parameter annotations of this method.
List
lineNumbers
The line numbers of this method.
List
localVariables
The local variables of this method.
int
maxLocals
The maximum number of local variables of this method.
int
maxStack
The maximum stack size of this method.
String
name
The method's name.
String
signature
The method's signature.
List
tryCatchBlocks
The try catch blocks of this method.
List[]
visibleParameterAnnotations
The runtime visible parameter annotations of this method.

Fields inherited from class org.objectweb.asm.tree.MemberNode

attrs, invisibleAnnotations, visibleAnnotations

Constructor Summary

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

Method Summary

void
accept(ClassVisitor cv)
Makes the given class visitor visit this method.
void
accept(MethodVisitor mv)
Makes the given method visitor visit this method.
AnnotationVisitor
visitAnnotationDefault()
void
visitCode()
void
visitFieldInsn(int opcode, String owner, String name, String desc)
void
visitIincInsn(int var, int increment)
void
visitInsn(int opcode)
void
visitIntInsn(int opcode, int operand)
void
visitJumpInsn(int opcode, Label label)
void
visitLabel(Label label)
void
visitLdcInsn(Object cst)
void
visitLineNumber(int line, Label start)
void
visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index)
void
visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels)
void
visitMaxs(int maxStack, int maxLocals)
void
visitMethodInsn(int opcode, String owner, String name, String desc)
void
visitMultiANewArrayInsn(String desc, int dims)
AnnotationVisitor
visitParameterAnnotation(int parameter, String desc, boolean visible)
void
visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels)
void
visitTryCatchBlock(Label start, Label end, Label handler, String type)
void
visitTypeInsn(int opcode, String desc)
void
visitVarInsn(int opcode, int var)

Methods inherited from class org.objectweb.asm.tree.MemberNode

visitAnnotation, visitAttribute, visitEnd

Field Details

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

exceptions

public List exceptions

instructions

public List instructions

invisibleParameterAnnotations

public List[] invisibleParameterAnnotations

lineNumbers

public List lineNumbers

localVariables

public List localVariables

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

visibleParameterAnnotations

public List[] visibleParameterAnnotations

Constructor Details

MethodNode

public MethodNode(int access,
                  String name,
                  String desc,
                  String signature,
                  String[] exceptions)
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 Details

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.

visitAnnotationDefault

public AnnotationVisitor visitAnnotationDefault()
Specified by:
visitAnnotationDefault in interface MethodVisitor

visitCode

public void visitCode()
Specified by:
visitCode in interface MethodVisitor

visitFieldInsn

public void visitFieldInsn(int opcode,
                           String owner,
                           String name,
                           String desc)
Specified by:
visitFieldInsn in interface MethodVisitor

visitIincInsn

public void visitIincInsn(int var,
                          int increment)
Specified by:
visitIincInsn in interface MethodVisitor

visitInsn

public void visitInsn(int opcode)
Specified by:
visitInsn in interface MethodVisitor

visitIntInsn

public void visitIntInsn(int opcode,
                         int operand)
Specified by:
visitIntInsn in interface MethodVisitor

visitJumpInsn

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

visitLabel

public void visitLabel(Label label)
Specified by:
visitLabel in interface MethodVisitor

visitLdcInsn

public void visitLdcInsn(Object cst)
Specified by:
visitLdcInsn in interface MethodVisitor

visitLineNumber

public void visitLineNumber(int line,
                            Label start)
Specified by:
visitLineNumber in interface MethodVisitor

visitLocalVariable

public void visitLocalVariable(String name,
                               String desc,
                               String signature,
                               Label start,
                               Label end,
                               int index)
Specified by:
visitLocalVariable in interface MethodVisitor

visitLookupSwitchInsn

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

visitMaxs

public void visitMaxs(int maxStack,
                      int maxLocals)
Specified by:
visitMaxs in interface MethodVisitor

visitMethodInsn

public void visitMethodInsn(int opcode,
                            String owner,
                            String name,
                            String desc)
Specified by:
visitMethodInsn in interface MethodVisitor

visitMultiANewArrayInsn

public void visitMultiANewArrayInsn(String desc,
                                    int dims)
Specified by:
visitMultiANewArrayInsn in interface MethodVisitor

visitParameterAnnotation

public AnnotationVisitor visitParameterAnnotation(int parameter,
                                                  String desc,
                                                  boolean visible)
Specified by:
visitParameterAnnotation in interface MethodVisitor

visitTableSwitchInsn

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

visitTryCatchBlock

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

visitTypeInsn

public void visitTypeInsn(int opcode,
                          String desc)
Specified by:
visitTypeInsn in interface MethodVisitor

visitVarInsn

public void visitVarInsn(int opcode,
                         int var)
Specified by:
visitVarInsn in interface MethodVisitor