public class MethodNode extends MethodVisitor
| Modifier and Type | Field | 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<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.
|
api, mv| Constructor | 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 | Description |
|---|---|---|
void |
accept(ClassVisitor classVisitor) |
Makes the given class visitor visit this method.
|
void |
accept(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(Label label) |
Returns the LabelNode corresponding to the given Label.
|
void |
visitAnnotableParameterCount(int parameterCount,
boolean visible) |
|
AnnotationVisitor |
visitAnnotation(java.lang.String descriptor,
boolean visible) |
|
AnnotationVisitor |
visitAnnotationDefault() |
|
void |
visitAttribute(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 numLocal,
java.lang.Object[] local,
int numStack,
java.lang.Object[] stack) |
|
void |
visitIincInsn(int var,
int increment) |
|
void |
visitInsn(int opcode) |
|
AnnotationVisitor |
visitInsnAnnotation(int typeRef,
TypePath typePath,
java.lang.String descriptor,
boolean visible) |
|
void |
visitIntInsn(int opcode,
int operand) |
|
void |
visitInvokeDynamicInsn(java.lang.String name,
java.lang.String descriptor,
Handle bootstrapMethodHandle,
java.lang.Object... bootstrapMethodArguments) |
|
void |
visitJumpInsn(int opcode,
Label label) |
|
void |
visitLabel(Label label) |
|
void |
visitLdcInsn(java.lang.Object value) |
|
void |
visitLineNumber(int line,
Label start) |
|
void |
visitLocalVariable(java.lang.String name,
java.lang.String descriptor,
java.lang.String signature,
Label start,
Label end,
int index) |
|
AnnotationVisitor |
visitLocalVariableAnnotation(int typeRef,
TypePath typePath,
Label[] start,
Label[] end,
int[] index,
java.lang.String descriptor,
boolean visible) |
|
void |
visitLookupSwitchInsn(Label dflt,
int[] keys,
Label[] labels) |
|
void |
visitMaxs(int maxStack,
int maxLocals) |
|
void |
visitMethodInsn(int opcodeAndSource,
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) |
|
AnnotationVisitor |
visitParameterAnnotation(int parameter,
java.lang.String descriptor,
boolean visible) |
|
void |
visitTableSwitchInsn(int min,
int max,
Label dflt,
Label... labels) |
|
AnnotationVisitor |
visitTryCatchAnnotation(int typeRef,
TypePath typePath,
java.lang.String descriptor,
boolean visible) |
|
void |
visitTryCatchBlock(Label start,
Label end,
Label handler,
java.lang.String type) |
|
AnnotationVisitor |
visitTypeAnnotation(int typeRef,
TypePath typePath,
java.lang.String descriptor,
boolean visible) |
|
void |
visitTypeInsn(int opcode,
java.lang.String type) |
|
void |
visitVarInsn(int opcode,
int var) |
visitMethodInsnpublic 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<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, Opcodes.ASM7, Opcodes.ASM8 or Opcodes.ASM9.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, Opcodes.ASM7, Opcodes.ASM8 or Opcodes.ASM9.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 MethodVisitorpublic AnnotationVisitor visitAnnotationDefault()
visitAnnotationDefault in class MethodVisitorpublic AnnotationVisitor visitAnnotation(java.lang.String descriptor, boolean visible)
visitAnnotation in class MethodVisitorpublic AnnotationVisitor visitTypeAnnotation(int typeRef, TypePath typePath, java.lang.String descriptor, boolean visible)
visitTypeAnnotation in class MethodVisitorpublic void visitAnnotableParameterCount(int parameterCount,
boolean visible)
visitAnnotableParameterCount in class MethodVisitorpublic AnnotationVisitor visitParameterAnnotation(int parameter, java.lang.String descriptor, boolean visible)
visitParameterAnnotation in class MethodVisitorpublic void visitAttribute(Attribute attribute)
visitAttribute in class MethodVisitorpublic void visitCode()
visitCode in class MethodVisitorpublic void visitFrame(int type,
int numLocal,
java.lang.Object[] local,
int numStack,
java.lang.Object[] stack)
visitFrame in class MethodVisitorpublic void visitInsn(int opcode)
visitInsn in class MethodVisitorpublic void visitIntInsn(int opcode,
int operand)
visitIntInsn in class MethodVisitorpublic void visitVarInsn(int opcode,
int var)
visitVarInsn in class MethodVisitorpublic void visitTypeInsn(int opcode,
java.lang.String type)
visitTypeInsn in class MethodVisitorpublic void visitFieldInsn(int opcode,
java.lang.String owner,
java.lang.String name,
java.lang.String descriptor)
visitFieldInsn in class MethodVisitorpublic void visitMethodInsn(int opcodeAndSource,
java.lang.String owner,
java.lang.String name,
java.lang.String descriptor,
boolean isInterface)
visitMethodInsn in class MethodVisitorpublic void visitInvokeDynamicInsn(java.lang.String name,
java.lang.String descriptor,
Handle bootstrapMethodHandle,
java.lang.Object... bootstrapMethodArguments)
visitInvokeDynamicInsn in class MethodVisitorpublic void visitJumpInsn(int opcode,
Label label)
visitJumpInsn in class MethodVisitorpublic void visitLabel(Label label)
visitLabel in class MethodVisitorpublic void visitLdcInsn(java.lang.Object value)
visitLdcInsn in class MethodVisitorpublic void visitIincInsn(int var,
int increment)
visitIincInsn in class MethodVisitorpublic void visitTableSwitchInsn(int min,
int max,
Label dflt,
Label... labels)
visitTableSwitchInsn in class MethodVisitorpublic void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels)
visitLookupSwitchInsn in class MethodVisitorpublic void visitMultiANewArrayInsn(java.lang.String descriptor,
int numDimensions)
visitMultiANewArrayInsn in class MethodVisitorpublic AnnotationVisitor visitInsnAnnotation(int typeRef, TypePath typePath, java.lang.String descriptor, boolean visible)
visitInsnAnnotation in class MethodVisitorpublic void visitTryCatchBlock(Label start, Label end, Label handler, java.lang.String type)
visitTryCatchBlock in class MethodVisitorpublic AnnotationVisitor visitTryCatchAnnotation(int typeRef, TypePath typePath, java.lang.String descriptor, boolean visible)
visitTryCatchAnnotation in class MethodVisitorpublic void visitLocalVariable(java.lang.String name,
java.lang.String descriptor,
java.lang.String signature,
Label start,
Label end,
int index)
visitLocalVariable in class MethodVisitorpublic AnnotationVisitor visitLocalVariableAnnotation(int typeRef, TypePath typePath, Label[] start, Label[] end, int[] index, java.lang.String descriptor, boolean visible)
visitLocalVariableAnnotation in class MethodVisitorpublic void visitLineNumber(int line,
Label start)
visitLineNumber in class MethodVisitorpublic void visitMaxs(int maxStack,
int maxLocals)
visitMaxs in class MethodVisitorpublic void visitEnd()
visitEnd in class MethodVisitorprotected LabelNode getLabelNode(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, Opcodes.ASM7, Opcodes.ASM8 or Opcodes.ASM9.public void accept(ClassVisitor classVisitor)
classVisitor - a class visitor.public void accept(MethodVisitor methodVisitor)
methodVisitor - a method visitor.Copyright © 2022. All rights reserved.