public class MethodNode
extends org.objectweb.asm.MethodVisitor
Modifier and Type | Field and Description |
---|---|
int |
access
The method's access flags (see
Opcodes ). |
java.lang.Object |
annotationDefault
The default value of this annotation interface method.
|
java.util.List<org.objectweb.asm.Attribute> |
attrs
The non standard attributes of this method.
|
java.lang.String |
desc
The method's descriptor (see
Type ). |
java.util.List<java.lang.String> |
exceptions
The internal names of the method's exception classes (see
Type.getInternalName() ). |
InsnList |
instructions
The instructions of this method.
|
int |
invisibleAnnotableParameterCount
The number of method parameters than can have runtime invisible annotations.
|
java.util.List<AnnotationNode> |
invisibleAnnotations
The runtime invisible annotations of this method.
|
java.util.List<LocalVariableAnnotationNode> |
invisibleLocalVariableAnnotations
The invisible local variable annotations of this method.
|
java.util.List<AnnotationNode>[] |
invisibleParameterAnnotations
The runtime invisible parameter annotations of this method.
|
java.util.List<TypeAnnotationNode> |
invisibleTypeAnnotations
The runtime invisible type annotations of this method.
|
java.util.List<LocalVariableNode> |
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.
|
java.lang.String |
name
The method's name.
|
java.util.List<ParameterNode> |
parameters
The method parameter info (access flags and name)
|
java.lang.String |
signature
The method's signature.
|
java.util.List<TryCatchBlockNode> |
tryCatchBlocks
The try catch blocks of this method.
|
int |
visibleAnnotableParameterCount
The number of method parameters than can have runtime visible annotations.
|
java.util.List<AnnotationNode> |
visibleAnnotations
The runtime visible annotations of this method.
|
java.util.List<LocalVariableAnnotationNode> |
visibleLocalVariableAnnotations
The visible local variable annotations of this method.
|
java.util.List<AnnotationNode>[] |
visibleParameterAnnotations
The runtime visible parameter annotations of this method.
|
java.util.List<TypeAnnotationNode> |
visibleTypeAnnotations
The runtime visible type annotations of this method.
|
Constructor and Description |
---|
MethodNode()
Constructs an uninitialized
MethodNode . |
MethodNode(int api)
Constructs an uninitialized
MethodNode . |
MethodNode(int api,
int access,
java.lang.String name,
java.lang.String descriptor,
java.lang.String signature,
java.lang.String[] exceptions)
Constructs a new
MethodNode . |
MethodNode(int access,
java.lang.String name,
java.lang.String descriptor,
java.lang.String signature,
java.lang.String[] exceptions)
Constructs a new
MethodNode . |
Modifier and Type | Method and Description |
---|---|
void |
accept(org.objectweb.asm.ClassVisitor classVisitor)
Makes the given class visitor visit this method.
|
void |
accept(org.objectweb.asm.MethodVisitor methodVisitor)
Makes the given method visitor visit this method.
|
void |
check(int api)
Checks that this method node is compatible with the given ASM API version.
|
protected LabelNode |
getLabelNode(org.objectweb.asm.Label label)
Returns the LabelNode corresponding to the given Label.
|
void |
visitAnnotableParameterCount(int parameterCount,
boolean visible) |
org.objectweb.asm.AnnotationVisitor |
visitAnnotation(java.lang.String descriptor,
boolean visible) |
org.objectweb.asm.AnnotationVisitor |
visitAnnotationDefault() |
void |
visitAttribute(org.objectweb.asm.Attribute attribute) |
void |
visitCode() |
void |
visitEnd() |
void |
visitFieldInsn(int opcode,
java.lang.String owner,
java.lang.String name,
java.lang.String descriptor) |
void |
visitFrame(int type,
int nLocal,
java.lang.Object[] local,
int nStack,
java.lang.Object[] stack) |
void |
visitIincInsn(int var,
int increment) |
void |
visitInsn(int opcode) |
org.objectweb.asm.AnnotationVisitor |
visitInsnAnnotation(int typeRef,
org.objectweb.asm.TypePath typePath,
java.lang.String descriptor,
boolean visible) |
void |
visitIntInsn(int opcode,
int operand) |
void |
visitInvokeDynamicInsn(java.lang.String name,
java.lang.String descriptor,
org.objectweb.asm.Handle bootstrapMethodHandle,
java.lang.Object... bootstrapMethodArguments) |
void |
visitJumpInsn(int opcode,
org.objectweb.asm.Label label) |
void |
visitLabel(org.objectweb.asm.Label label) |
void |
visitLdcInsn(java.lang.Object value) |
void |
visitLineNumber(int line,
org.objectweb.asm.Label start) |
void |
visitLocalVariable(java.lang.String name,
java.lang.String descriptor,
java.lang.String signature,
org.objectweb.asm.Label start,
org.objectweb.asm.Label end,
int index) |
org.objectweb.asm.AnnotationVisitor |
visitLocalVariableAnnotation(int typeRef,
org.objectweb.asm.TypePath typePath,
org.objectweb.asm.Label[] start,
org.objectweb.asm.Label[] end,
int[] index,
java.lang.String descriptor,
boolean visible) |
void |
visitLookupSwitchInsn(org.objectweb.asm.Label dflt,
int[] keys,
org.objectweb.asm.Label[] labels) |
void |
visitMaxs(int maxStack,
int maxLocals) |
void |
visitMethodInsn(int opcode,
java.lang.String owner,
java.lang.String name,
java.lang.String descriptor)
Deprecated.
|
void |
visitMethodInsn(int opcode,
java.lang.String owner,
java.lang.String name,
java.lang.String descriptor,
boolean isInterface) |
void |
visitMultiANewArrayInsn(java.lang.String descriptor,
int numDimensions) |
void |
visitParameter(java.lang.String name,
int access) |
org.objectweb.asm.AnnotationVisitor |
visitParameterAnnotation(int parameter,
java.lang.String descriptor,
boolean visible) |
void |
visitTableSwitchInsn(int min,
int max,
org.objectweb.asm.Label dflt,
org.objectweb.asm.Label... labels) |
org.objectweb.asm.AnnotationVisitor |
visitTryCatchAnnotation(int typeRef,
org.objectweb.asm.TypePath typePath,
java.lang.String descriptor,
boolean visible) |
void |
visitTryCatchBlock(org.objectweb.asm.Label start,
org.objectweb.asm.Label end,
org.objectweb.asm.Label handler,
java.lang.String type) |
org.objectweb.asm.AnnotationVisitor |
visitTypeAnnotation(int typeRef,
org.objectweb.asm.TypePath typePath,
java.lang.String descriptor,
boolean visible) |
void |
visitTypeInsn(int opcode,
java.lang.String type) |
void |
visitVarInsn(int opcode,
int var) |
public int access
Opcodes
). This field also indicates if the method is
synthetic and/or deprecated.public java.lang.String name
public java.lang.String desc
Type
).public java.lang.String signature
public java.util.List<java.lang.String> exceptions
Type.getInternalName()
).public java.util.List<ParameterNode> parameters
public java.util.List<AnnotationNode> visibleAnnotations
public java.util.List<AnnotationNode> invisibleAnnotations
public java.util.List<TypeAnnotationNode> visibleTypeAnnotations
public java.util.List<TypeAnnotationNode> invisibleTypeAnnotations
public java.util.List<org.objectweb.asm.Attribute> attrs
public java.lang.Object annotationDefault
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.public int visibleAnnotableParameterCount
public java.util.List<AnnotationNode>[] visibleParameterAnnotations
AnnotationNode
objects. May be null.public int invisibleAnnotableParameterCount
public java.util.List<AnnotationNode>[] invisibleParameterAnnotations
AnnotationNode
objects. May be null.public InsnList instructions
public java.util.List<TryCatchBlockNode> tryCatchBlocks
public int maxStack
public int maxLocals
public java.util.List<LocalVariableNode> localVariables
public java.util.List<LocalVariableAnnotationNode> visibleLocalVariableAnnotations
public java.util.List<LocalVariableAnnotationNode> invisibleLocalVariableAnnotations
public MethodNode()
MethodNode
. Subclasses must not use this
constructor. Instead, they must use the MethodNode(int)
version.java.lang.IllegalStateException
- If a subclass calls this constructor.public MethodNode(int api)
MethodNode
.api
- the ASM API version implemented by this visitor. Must be one of Opcodes.ASM4
, Opcodes.ASM5
, Opcodes.ASM6
or Opcodes.ASM7_EXPERIMENTAL
.public MethodNode(int access, java.lang.String name, java.lang.String descriptor, java.lang.String signature, java.lang.String[] exceptions)
MethodNode
. Subclasses must not use this constructor. Instead,
they must use the MethodNode(int, int, String, String, String, String[])
version.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.descriptor
- 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 Type.getInternalName()
). May be null.java.lang.IllegalStateException
- If a subclass calls this constructor.public MethodNode(int api, int access, java.lang.String name, java.lang.String descriptor, java.lang.String signature, java.lang.String[] exceptions)
MethodNode
.api
- the ASM API version implemented by this visitor. Must be one of Opcodes.ASM4
, Opcodes.ASM5
, Opcodes.ASM6
or Opcodes.ASM7_EXPERIMENTAL
.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.descriptor
- 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 Type.getInternalName()
). May be null.public void visitParameter(java.lang.String name, int access)
visitParameter
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitAnnotationDefault()
visitAnnotationDefault
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String descriptor, boolean visible)
visitAnnotation
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)
visitTypeAnnotation
in class org.objectweb.asm.MethodVisitor
public void visitAnnotableParameterCount(int parameterCount, boolean visible)
visitAnnotableParameterCount
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitParameterAnnotation(int parameter, java.lang.String descriptor, boolean visible)
visitParameterAnnotation
in class org.objectweb.asm.MethodVisitor
public void visitAttribute(org.objectweb.asm.Attribute attribute)
visitAttribute
in class org.objectweb.asm.MethodVisitor
public void visitCode()
visitCode
in class org.objectweb.asm.MethodVisitor
public void visitFrame(int type, int nLocal, java.lang.Object[] local, int nStack, java.lang.Object[] stack)
visitFrame
in class org.objectweb.asm.MethodVisitor
public void visitInsn(int opcode)
visitInsn
in class org.objectweb.asm.MethodVisitor
public void visitIntInsn(int opcode, int operand)
visitIntInsn
in class org.objectweb.asm.MethodVisitor
public void visitVarInsn(int opcode, int var)
visitVarInsn
in class org.objectweb.asm.MethodVisitor
public void visitTypeInsn(int opcode, java.lang.String type)
visitTypeInsn
in class org.objectweb.asm.MethodVisitor
public void visitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)
visitFieldInsn
in class org.objectweb.asm.MethodVisitor
@Deprecated public void visitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)
visitMethodInsn
in class org.objectweb.asm.MethodVisitor
public void visitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor, boolean isInterface)
visitMethodInsn
in class org.objectweb.asm.MethodVisitor
public void visitInvokeDynamicInsn(java.lang.String name, java.lang.String descriptor, org.objectweb.asm.Handle bootstrapMethodHandle, java.lang.Object... bootstrapMethodArguments)
visitInvokeDynamicInsn
in class org.objectweb.asm.MethodVisitor
public void visitJumpInsn(int opcode, org.objectweb.asm.Label label)
visitJumpInsn
in class org.objectweb.asm.MethodVisitor
public void visitLabel(org.objectweb.asm.Label label)
visitLabel
in class org.objectweb.asm.MethodVisitor
public void visitLdcInsn(java.lang.Object value)
visitLdcInsn
in class org.objectweb.asm.MethodVisitor
public void visitIincInsn(int var, int increment)
visitIincInsn
in class org.objectweb.asm.MethodVisitor
public void visitTableSwitchInsn(int min, int max, org.objectweb.asm.Label dflt, org.objectweb.asm.Label... labels)
visitTableSwitchInsn
in class org.objectweb.asm.MethodVisitor
public void visitLookupSwitchInsn(org.objectweb.asm.Label dflt, int[] keys, org.objectweb.asm.Label[] labels)
visitLookupSwitchInsn
in class org.objectweb.asm.MethodVisitor
public void visitMultiANewArrayInsn(java.lang.String descriptor, int numDimensions)
visitMultiANewArrayInsn
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitInsnAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)
visitInsnAnnotation
in class org.objectweb.asm.MethodVisitor
public void visitTryCatchBlock(org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.Label handler, java.lang.String type)
visitTryCatchBlock
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitTryCatchAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, java.lang.String descriptor, boolean visible)
visitTryCatchAnnotation
in class org.objectweb.asm.MethodVisitor
public void visitLocalVariable(java.lang.String name, java.lang.String descriptor, java.lang.String signature, org.objectweb.asm.Label start, org.objectweb.asm.Label end, int index)
visitLocalVariable
in class org.objectweb.asm.MethodVisitor
public org.objectweb.asm.AnnotationVisitor visitLocalVariableAnnotation(int typeRef, org.objectweb.asm.TypePath typePath, org.objectweb.asm.Label[] start, org.objectweb.asm.Label[] end, int[] index, java.lang.String descriptor, boolean visible)
visitLocalVariableAnnotation
in class org.objectweb.asm.MethodVisitor
public void visitLineNumber(int line, org.objectweb.asm.Label start)
visitLineNumber
in class org.objectweb.asm.MethodVisitor
public void visitMaxs(int maxStack, int maxLocals)
visitMaxs
in class org.objectweb.asm.MethodVisitor
public void visitEnd()
visitEnd
in class org.objectweb.asm.MethodVisitor
protected LabelNode getLabelNode(org.objectweb.asm.Label label)
Label.info
field to store
associations between labels and label nodes.label
- a Label.public void check(int api)
api
- an ASM API version. Must be one of Opcodes.ASM4
, Opcodes.ASM5
,
Opcodes.ASM6
or Opcodes.ASM7_EXPERIMENTAL
.public void accept(org.objectweb.asm.ClassVisitor classVisitor)
classVisitor
- a class visitor.public void accept(org.objectweb.asm.MethodVisitor methodVisitor)
methodVisitor
- a method visitor.