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 {@link Opcodes}).
ObjectannotationDefault
The default value of this annotation interface method.
Stringdesc
The method's descriptor (see {@link Type}).
Listexceptions
The internal names of the method's exception classes (see {@link Type#getInternalName() getInternalName}).
Listinstructions
The instructions of this method.
List[]invisibleParameterAnnotations
The runtime invisible parameter annotations of this method.
ListlineNumbers
The line numbers 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(int access, String name, String desc, String signature, String[] exceptions)
Constructs a new {@link 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.
AnnotationVisitorvisitAnnotationDefault()
voidvisitCode()
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, 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 desc)
voidvisitVarInsn(int opcode, int var)

Field Detail

access

public int access
The method's access flags (see {@link 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 {@link Byte}, {@link Boolean}, {@link Character}, {@link Short}, {@link Integer}, {@link Long}, {@link Float}, {@link Double}, {@link String} or {@link Type}, or an two elements String array (for enumeration values), a {@link AnnotationNode}, or a {@link List} of values of one of the preceding types. May be null.

desc

public String desc
The method's descriptor (see {@link Type}).

exceptions

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

instructions

public List instructions
The instructions of this method. This list is a list of {@link 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 {@link AnnotationNode} objects. May be null.

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

lineNumbers

public List lineNumbers
The line numbers of this method. This list is a list of {@link LineNumberNode} objects. May be null

UNKNOWN: org.objectweb.asm.tree.LineNumberNode

localVariables

public List localVariables
The local variables of this method. This list is a list of {@link 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 {@link 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 {@link AnnotationNode} objects. May be null.

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

Constructor Detail

MethodNode

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

Parameters: access the method's access flags (see {@link Opcodes}). This parameter also indicates if the method is synthetic and/or deprecated. name the method's name. desc the method's descriptor (see {@link Type}). signature the method's signature. May be null. exceptions the internal names of the method's exception classes (see {@link Type#getInternalName() 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.

visitAnnotationDefault

public AnnotationVisitor visitAnnotationDefault()

visitCode

public void visitCode()

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, 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 desc)

visitVarInsn

public void visitVarInsn(int opcode, int var)