MethodVisitor providing a more detailed API to generate and transform instructions.
| Modifier and Type | Field and Description |
|---|---|
| public static final Type | OBJECT_TYPE
The type of the java.lang.Object class. |
| Access | Constructor and Description |
|---|---|
| public | InstructionAdapter(final MethodVisitor
the method visitor to which this adapter delegates calls. methodVisitor)Constructs a new |
| protected | InstructionAdapter(final int
the ASM API version implemented by this visitor. Must be one of the api, final MethodVisitor ASMx values in Opcodes.the method visitor to which this adapter delegates calls. methodVisitor)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | aconst(final Object
the constant to be pushed on the stack. This parameter must be an value)Integer,
a Float, a Long, a Double, a String, a Type of
OBJECT or ARRAY sort for .class constants, for classes whose version is 49, a
Type of METHOD sort for MethodType, a Handle for MethodHandle constants,
for classes whose version is 51 or a ConstantDynamic for a constant dynamic for
classes whose version is 55.Generates the instruction to push the given value on the stack. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| pack-priv static void | cast(final MethodVisitor
the method visitor to use to generate the instruction. methodVisitor, final Type a Type. from, final Type a Type. to)Generates the instruction to cast from the first given type to the other. |
| public void | cconst(final ConstantDynamic
the constant dynamic to be pushed on the stack. constantDynamic)Generates the instruction to push the given constant dynamic on the stack. |
| public void | |
| public void | |
| public void | |
| public void | dconst(final double
the constant to be pushed on the stack. doubleValue)Generates the instruction to push the given value on the stack. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | fconst(final float
the constant to be pushed on the stack. floatValue)Generates the instruction to push the given value on the stack. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | iconst(final int
the constant to be pushed on the stack. intValue)Generates the instruction to push the given value on the stack. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | invokeinterface(final String
the internal name of the method's owner class (see owner, final String Type#getInternalName()).the method's name. name, final String the method's descriptor (see descriptor)Type).Generates the instruction to call the given interface method. |
| public void | invokespecial(final String
the internal name of the method's owner class (see owner, final String Type#getInternalName()).the method's name. name, final String the method's descriptor (see descriptor)Type).
Deprecated
use
Deprecated.
invokespecial(String, String, String, boolean) instead.
|
| public void | invokespecial(final String
the internal name of the method's owner class (see owner, final String Type#getInternalName()).the method's name. name, final String the method's descriptor (see descriptor, final boolean Type).if the method's owner class is an interface. isInterface)Generates the instruction to call the given special method. |
| public void | invokestatic(final String
the internal name of the method's owner class (see owner, final String Type#getInternalName()).the method's name. name, final String the method's descriptor (see descriptor)Type).
Deprecated
use
Deprecated.
invokestatic(String, String, String, boolean) instead.
|
| public void | invokestatic(final String
the internal name of the method's owner class (see owner, final String Type#getInternalName()).the method's name. name, final String the method's descriptor (see descriptor, final boolean Type).if the method's owner class is an interface. isInterface)Generates the instruction to call the given static method. |
| public void | invokevirtual(final String
the internal name of the method's owner class (see owner, final String Type#getInternalName()).the method's name. name, final String the method's descriptor (see descriptor)Type).
Deprecated
use
Deprecated.
invokevirtual(String, String, String, boolean) instead.
|
| public void | invokevirtual(final String
the internal name of the method's owner class (see owner, final String Type#getInternalName()).the method's name. name, final String the method's descriptor (see descriptor, final boolean Type).if the method's owner class is an interface. isInterface)Generates the instruction to call the given virtual method. |
| public void | |
| public void | |
| public void | lconst(final long
the constant to be pushed on the stack. longValue)Generates the instruction to push the given value on the stack. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| pack-priv static void | newarray(final MethodVisitor
the method visitor to use to generate the instruction. methodVisitor, final Type an array Type. type)Generates the instruction to create and push on the stack an array of the given type. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | visitFieldInsn(final int
the opcode of the type instruction to be visited. This opcode is either
GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. opcode, final String the internal name of the field's owner class (see owner, final String Type#getInternalName()).the field's name. name, final String the field's descriptor (see descriptor)
Visits a field instruction.
Type). |
| public void | visitIincInsn(final int
index of the local variable to be incremented. varIndex, final int amount to increment the local variable by. increment)
Visits an IINC instruction.
|
| public void | visitInsn(final int
the opcode of the instruction to be visited. This opcode is either NOP,
ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, ICONST_5,
LCONST_0, LCONST_1, FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD,
FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE, FASTORE, DASTORE,
AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2, DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2,
SWAP, IADD, LADD, FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV, LDIV,
FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG, ISHL, LSHL, ISHR, LSHR, IUSHR,
LUSHR, IAND, LAND, IOR, LOR, IXOR, LXOR, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I,
D2L, D2F, I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN, FRETURN,
DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW, MONITORENTER, or MONITOREXIT. opcode)Overrides org. |
| public void | visitIntInsn(final int
the opcode of the instruction to be visited. This opcode is either BIPUSH, SIPUSH
or NEWARRAY. opcode, final int the operand of the instruction to be visited. operand)When opcode is BIPUSH, operand value should be between Byte.MIN_VALUE and Byte.MAX_VALUE. When opcode is SIPUSH, operand value should be between Short.MIN_VALUE and Short.MAX_VALUE. When opcode is NEWARRAY, operand value should be one of Opcodes#T_BOOLEAN, Opcodes#T_CHAR, Opcodes#T_FLOAT, Opcodes#T_DOUBLE, Opcodes#T_BYTE,
Opcodes#T_SHORT, Opcodes#T_INT or Opcodes#T_LONG.Overrides org. |
| public void | visitInvokeDynamicInsn(final String
the method's name. name, final String the method's descriptor (see descriptor, final Handle Type).the bootstrap method. bootstrapMethodHandle, final Object... bootstrapMethodArguments)Overrides org. |
| public void | visitJumpInsn(final int
the opcode of the type instruction to be visited. This opcode is either IFEQ,
IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT,
IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL. opcode, final Label the operand of the instruction to be visited. This operand is a label that
designates the instruction to which the jump instruction may jump. label)
Visits a jump instruction.
|
| public void | visitLabel(final Label
a label)Label object.Overrides org. |
| public void | visitLdcInsn(final Object
the constant to be loaded on the stack. This parameter must be a non null value)Integer, a Float, a Long, a Double, a String, a Type of OBJECT or ARRAY sort for .class constants, for classes whose version is
49, a Type of METHOD sort for MethodType, a Handle for MethodHandle
constants, for classes whose version is 51 or a ConstantDynamic for a constant
dynamic for classes whose version is 55.Overrides org. |
| public void | visitLookupSwitchInsn(final Label
beginning of the default handler block. dflt, final int[] the values of the keys. keys, final Label[] beginnings of the handler blocks. labels)labels[i] is the beginning of the
handler block for the keys[i] key.Overrides org. |
| public void | visitMethodInsn(final int
the opcode of the type instruction to be visited. This opcode is either
INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE. opcodeAndSource, final String the internal name of the method's owner class (see owner, final String Type#getInternalName()).the method's name. name, final String the method's descriptor (see descriptor, final boolean Type).if the method's owner class is an interface. isInterface)
Visits a method instruction.
|
| public void | visitMultiANewArrayInsn(final String
an array type descriptor (see descriptor, final int Type).the number of dimensions of the array to allocate. numDimensions)Overrides org. |
| public void | visitTableSwitchInsn(final int
the minimum key value. min, final int the maximum key value. max, final Label beginning of the default handler block. dflt, final Label... beginnings of the handler blocks. labels)labels[i] is the beginning of the
handler block for the min + i key.Overrides org. |
| public void | visitTypeInsn(final int
the opcode of the type instruction to be visited. This opcode is either NEW,
ANEWARRAY, CHECKCAST or INSTANCEOF. opcode, final String the operand of the instruction to be visited. This operand must be the internal
name of an object or array class (see type)
Visits a type instruction.
Type#getInternalName()). |
| public void | visitVarInsn(final int
the opcode of the local variable instruction to be visited. This opcode is either
ILOAD, LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET. opcode, final int the operand of the instruction to be visited. This operand is the index of a
local variable. varIndex)Overrides org. |
| public void |