MethodVisitor
that adds a callback after visiting the exception table of a method.
Modifier and Type | Field and Description |
---|---|
private boolean | trigger
|
Access | Constructor and Description |
---|---|
protected | ExceptionTableSensitiveMethodVisitor(int
The ASM API version. api, MethodVisitor The delegating method visitor. methodVisitor)Creates an exception table sensitive method visitor. |
Modifier and Type | Method and Description |
---|---|
private void | |
protected abstract void | |
protected void | onVisitFieldInsn(int
The visited opcode. opcode, String The field's owner. owner, String The field's name. name, String The field's descriptor. descriptor)Visits a field instruction. |
protected void | onVisitFrame(int
The type of stack map frame. type, int The length of the local variable array. localVariableLength, Object[] An array containing type symbols for all values in the local variable array. localVariable, int The size of the operand stack. stackSize, Object[] An array containing type symbols for all values on the operand stack. stack)Visits a stack map frame. |
protected void | onVisitIincInsn(int
The offset of the accessed variable. offset, int The value with which to increment. increment)Visits an increment instruction. |
protected void | |
protected void | onVisitIntInsn(int
The visited opcode. opcode, int The visited operand. operand)Visits an integer opcode. |
protected void | onVisitInvokeDynamicInsn(String
The name of the method. name, String The descriptor of the method. descriptor, Handle The bootstrap method handle. handle, Object... The bootstrap method arguments. argument)Visits an invoke dynamic instruction. |
protected void | onVisitJumpInsn(int
The visited opcode. opcode, Label The visited label. label)Visits a jump instruction. |
protected void | |
protected void | |
protected void | onVisitLookupSwitchInsn(Label
The default option. defaultTarget, int[] The key values. key, Label[] The targets for each key. label)Visits a lookup switch instruction. |
protected void | onVisitMethodInsn(int
The visited opcode. opcode, String The method's owner. owner, String The method's internal name. name, String The method's descriptor. descriptor)
Deprecated
Use
Visits a method instruction.
ExceptionTableSensitiveMethodVisitor#onVisitMethodInsn(int, String, String, String, boolean) instead.
|
protected void | onVisitMethodInsn(int
The visited opcode. opcode, String The method's owner. owner, String The method's internal name. name, String The method's descriptor. descriptor, boolean true if the method belongs to an interface.Visits a method instruction. |
protected void | onVisitMultiANewArrayInsn(String
The type descriptor of the array's component type. descriptor, int The dimensions of the array. dimensions)Visits an instruction for creating a multidimensional array. |
protected void | onVisitTableSwitchInsn(int
The minimum index. minimum, int The maximum index. maximum, Label A label indicating the default value. defaultTarget, Label... Labels indicating the jump targets. label)Visits a table switch instruction. |
protected void | |
protected void | onVisitVarInsn(int
The visited opcode. opcode, int The visited offset. offset)Visits an variable instruction. |
public final void | visitFieldInsn(int
the opcode of the type instruction to be visited. This opcode is either
GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD. opcode, String the internal name of the field's owner class (see owner, String Type#getInternalName() ).the field's name. name, String the field's descriptor (see descriptor)Type ).Overrides net. |
public final void | visitFrame(int
the type of this stack map frame. Must be type, int Opcodes#F_NEW for expanded
frames, or Opcodes#F_FULL , Opcodes#F_APPEND , Opcodes#F_CHOP , Opcodes#F_SAME or Opcodes#F_APPEND , Opcodes#F_SAME1 for compressed frames.the number of local variables in the visited frame. Long and double values
count for one variable. localVariableLength, Object[] the local variable types in this frame. This array must not be modified. Primitive
types are represented by localVariable, int Opcodes#TOP , Opcodes#INTEGER , Opcodes#FLOAT , Opcodes#LONG , Opcodes#DOUBLE , Opcodes#NULL or
Opcodes#UNINITIALIZED_THIS (long and double are represented by a single element).
Reference types are represented by String objects (representing internal names, see Type#getInternalName() ), and uninitialized types by Label objects (this label designates
the NEW instruction that created this uninitialized value).the number of operand stack elements in the visited frame. Long and double
values count for one stack element. stackSize, Object[] the operand stack types in this frame. This array must not be modified. Its
content has the same format as the "local" array. stack)
Visits the current state of the local variables and operand stack elements.
|
public final void | visitIincInsn(int
index of the local variable to be incremented. offset, int amount to increment the local variable by. increment)Overrides net. |
public final void | visitInsn(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)
Visits a zero operand instruction.
|
public final void | visitIntInsn(int
the opcode of the instruction to be visited. This opcode is either BIPUSH, SIPUSH
or NEWARRAY. opcode, int the operand of the instruction to be visited. operand)
Visits an instruction with a single int 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 . |
public final void | visitInvokeDynamicInsn(String
the method's name. name, String the method's descriptor (see descriptor, Handle Type ).the bootstrap method. handle, Object... argument)Overrides net. |
public final void | visitJumpInsn(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, 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)Overrides net. |
public final void | visitLabel(Label
a label)
Visits a label.
Label object. |
public final void | visitLdcInsn(Object
the constant to be loaded on the stack. This parameter must be a non null constant)
Visits a LDC instruction.
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. |
public final void | visitLookupSwitchInsn(Label
beginning of the default handler block. dflt, int[] the values of the keys. key, Label[] beginnings of the handler blocks. label)labels[i] is the beginning of the
handler block for the keys[i] key.Overrides net. |
public final void | visitMethodInsn(int
the opcode of the type instruction to be visited. This opcode is either
INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE. opcode, String the internal name of the method's owner class (see owner, String Type#getInternalName() ).the method's name. name, String the method's descriptor (see descriptor)Type ).Overrides net. |
public final void | visitMethodInsn(int
the opcode of the type instruction to be visited. This opcode is either
INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE. opcode, String the internal name of the method's owner class (see owner, String Type#getInternalName() ).the method's name. name, String the method's descriptor (see descriptor, boolean Type ).if the method's owner class is an interface. isInterface)Overrides net. |
public final void | visitMultiANewArrayInsn(String
an array type descriptor (see descriptor, int Type ).the number of dimensions of the array to allocate. dimensions)Overrides net. |
public final void | visitTableSwitchInsn(int
the minimum key value. minimum, int the maximum key value. maximum, Label beginning of the default handler block. defaultTarget, Label... beginnings of the handler blocks. label)labels[i] is the beginning of the
handler block for the min + i key.Overrides net. |
public final void | visitTypeInsn(int
the opcode of the type instruction to be visited. This opcode is either NEW,
ANEWARRAY, CHECKCAST or INSTANCEOF. opcode, String the operand of the instruction to be visited. This operand must be the internal
name of an object or array class (see type)Type#getInternalName() ).Overrides net. |
public final void | visitVarInsn(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, int the operand of the instruction to be visited. This operand is the index of a
local variable. offset)
Visits a local variable instruction.
|
trigger | back to summary |
---|---|
private boolean trigger
|
ExceptionTableSensitiveMethodVisitor | back to summary |
---|---|
protected ExceptionTableSensitiveMethodVisitor(int api, MethodVisitor methodVisitor) Creates an exception table sensitive method visitor.
|
considerEndOfExceptionTable | back to summary |
---|---|
private void considerEndOfExceptionTable() Considers if the end of the exception table was reached. |
onAfterExceptionTable | back to summary |
---|---|
protected abstract void onAfterExceptionTable() Invoked after the exception table was visited. Typically, the exception table is visited by ASM at the beginning of a method. It is however possible that a user adds exception table entries at a later point. Normally, this is however not meaningful use of ASM. |
onVisitFieldInsn | back to summary |
---|---|
protected void onVisitFieldInsn(int opcode, String owner, String name, String descriptor) Visits a field instruction. |
onVisitFrame | back to summary |
---|---|
protected void onVisitFrame(int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack) Visits a stack map frame.
|
onVisitIincInsn | back to summary |
---|---|
protected void onVisitIincInsn(int offset, int increment) Visits an increment instruction.
|
onVisitInsn | back to summary |
---|---|
protected void onVisitInsn(int opcode) Visits a simple instruction.
|
onVisitIntInsn | back to summary |
---|---|
protected void onVisitIntInsn(int opcode, int operand) Visits an integer opcode.
|
onVisitInvokeDynamicInsn | back to summary |
---|---|
protected void onVisitInvokeDynamicInsn(String name, String descriptor, Handle handle, Object... argument) Visits an invoke dynamic instruction. |
onVisitJumpInsn | back to summary |
---|---|
protected void onVisitJumpInsn(int opcode, Label label) Visits a jump instruction.
|
onVisitLabel | back to summary |
---|---|
protected void onVisitLabel(Label label) Visits a label.
|
onVisitLdcInsn | back to summary |
---|---|
protected void onVisitLdcInsn(Object constant) Visits a constant pool access instruction.
|
onVisitLookupSwitchInsn | back to summary |
---|---|
protected void onVisitLookupSwitchInsn(Label defaultTarget, int[] key, Label[] label) Visits a lookup switch instruction. |
onVisitMethodInsn | back to summary |
---|---|
protected void onVisitMethodInsn(int opcode, String owner, String name, String descriptor)
Deprecated Use Visits a method instruction.
|
onVisitMethodInsn | back to summary |
---|---|
protected void onVisitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) Visits a method instruction. |
onVisitMultiANewArrayInsn | back to summary |
---|---|
protected void onVisitMultiANewArrayInsn(String descriptor, int dimensions) Visits an instruction for creating a multidimensional array.
|
onVisitTableSwitchInsn | back to summary |
---|---|
protected void onVisitTableSwitchInsn(int minimum, int maximum, Label defaultTarget, Label... label) Visits a table switch instruction. |
onVisitTypeInsn | back to summary |
---|---|
protected void onVisitTypeInsn(int opcode, String type) Visits a type instruction.
|
onVisitVarInsn | back to summary |
---|---|
protected void onVisitVarInsn(int opcode, int offset) Visits an variable instruction.
|
visitFieldInsn | back to summary |
---|---|
public final void visitFieldInsn(int opcode, String owner, String name, String descriptor) Overrides net. Doc from net. Visits a field instruction. A field instruction is an instruction that loads or stores the value of a field of an object.
|
visitFrame | back to summary |
---|---|
public final void visitFrame(int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack) Overrides net. Doc from net. Visits the current state of the local variables and operand stack elements. This method must(*)
be called just before any instruction i that follows an unconditional branch
instruction such as GOTO or THROW, that is the target of a jump instruction, or that starts an
exception handler block. The visited types must describe the values of the local variables and
of the operand stack elements just before i is executed.
In both cases the first frame, corresponding to the method's parameters and access flags, is implicit and must not be visited. Also, it is illegal to visit two or more frames for the same code location (i.e., at least one instruction must be visited between two calls to visitFrame).
|
visitIincInsn | back to summary |
---|---|
public final void visitIincInsn(int offset, int increment) Overrides net. Doc from net. Visits an IINC instruction.
|
visitInsn | back to summary |
---|---|
public final void visitInsn(int opcode) Overrides net. Doc from net. Visits a zero operand instruction.
|
visitIntInsn | back to summary |
---|---|
public final void visitIntInsn(int opcode, int operand) Overrides net. Doc from net. Visits an instruction with a single int operand.
|
visitInvokeDynamicInsn | back to summary |
---|---|
public final void visitInvokeDynamicInsn(String name, String descriptor, Handle handle, Object... argument) Overrides net. Doc from net. Visits an invokedynamic instruction.
|
visitJumpInsn | back to summary |
---|---|
public final void visitJumpInsn(int opcode, Label label) Overrides net. Doc from net. Visits a jump instruction. A jump instruction is an instruction that may jump to another instruction.
|
visitLabel | back to summary |
---|---|
public final void visitLabel(Label label) Overrides net. Doc from net. Visits a label. A label designates the instruction that will be visited just after it. |
visitLdcInsn | back to summary |
---|---|
public final void visitLdcInsn(Object constant) Overrides net. Doc from net. Visits a LDC instruction. Note that new constant types may be added in future versions of the Java Virtual Machine. To easily detect new constant types, implementations of this method should check for unexpected constant types, like this: if (cst instanceof Integer) { // ... } else if (cst instanceof Float) { // ... } else if (cst instanceof Long) { // ... } else if (cst instanceof Double) { // ... } else if (cst instanceof String) { // ... } else if (cst instanceof Type) { int sort = ((Type) cst).getSort(); if (sort == Type.OBJECT) { // ... } else if (sort == Type.ARRAY) { // ... } else if (sort == Type.METHOD) { // ... } else { // throw an exception } } else if (cst instanceof Handle) { // ... } else if (cst instanceof ConstantDynamic) { // ... } else { // throw an exception }
|
visitLookupSwitchInsn | back to summary |
---|---|
public final void visitLookupSwitchInsn(Label dflt, int[] key, Label[] label) Overrides net. Doc from net. Visits a LOOKUPSWITCH instruction. |
visitMethodInsn | back to summary |
---|---|
public final void visitMethodInsn(int opcode, String owner, String name, String descriptor) Overrides net. Doc from net. Visits a method instruction. A method instruction is an instruction that invokes a method.
|
visitMethodInsn | back to summary |
---|---|
public final void visitMethodInsn(int opcode, String owner, String name, String descriptor, boolean isInterface) Overrides net. Doc from net. Visits a method instruction. A method instruction is an instruction that invokes a method.
|
visitMultiANewArrayInsn | back to summary |
---|---|
public final void visitMultiANewArrayInsn(String descriptor, int dimensions) Overrides net. Doc from net. Visits a MULTIANEWARRAY instruction. |
visitTableSwitchInsn | back to summary |
---|---|
public final void visitTableSwitchInsn(int minimum, int maximum, Label defaultTarget, Label... label) Overrides net. Doc from net. Visits a TABLESWITCH instruction. |
visitTypeInsn | back to summary |
---|---|
public final void visitTypeInsn(int opcode, String type) Overrides net. Doc from net. Visits a type instruction. A type instruction is an instruction that takes the internal name of
a class as parameter (see
|
visitVarInsn | back to summary |
---|---|
public final void visitVarInsn(int opcode, int offset) Overrides net. Doc from net. Visits a local variable instruction. A local variable instruction is an instruction that loads or stores the value of a local variable.
|