Package net.bytebuddy.utility.visitor
Class ExceptionTableSensitiveMethodVisitor
- java.lang.Object
-
- org.objectweb.asm.MethodVisitor
-
- net.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor
-
- Direct Known Subclasses:
Advice.AdviceVisitor
,LineNumberPrependingMethodVisitor
public abstract class ExceptionTableSensitiveMethodVisitor extends org.objectweb.asm.MethodVisitor
AMethodVisitor
that adds a callback after visiting the exception table of a method.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExceptionTableSensitiveMethodVisitor(int api, org.objectweb.asm.MethodVisitor methodVisitor)
Creates an exception table sensitive method visitor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract void
onAfterExceptionTable()
Invoked after the exception table was visited.protected void
onVisitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Visits a field instruction.protected void
onVisitIincInsn(int offset, int increment)
Visits an increment instruction.protected void
onVisitInsn(int opcode)
Visits a simple instruction.protected void
onVisitIntInsn(int opcode, int operand)
Visits an integer opcode.protected void
onVisitInvokeDynamicInsn(java.lang.String name, java.lang.String descriptor, org.objectweb.asm.Handle handle, java.lang.Object... argument)
Visits an invoke dynamic instruction.protected void
onVisitJumpInsn(int opcode, org.objectweb.asm.Label label)
Visits a jump instruction.protected void
onVisitLabel(org.objectweb.asm.Label label)
Visits a label.protected void
onVisitLdcInsn(java.lang.Object constant)
Visits a constant pool access instruction.protected void
onVisitLookupSwitchInsn(org.objectweb.asm.Label defaultTarget, int[] keys, org.objectweb.asm.Label[] key)
Visits a lookup switch instruction.protected void
onVisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Deprecated.protected void
onVisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor, boolean iFace)
Visits a method instruction.protected void
onVisitMultiANewArrayInsn(java.lang.String descriptor, int dimensions)
Visits an instruction for creating a multidimensional array.protected void
onVisitTableSwitchInsn(int min, int max, org.objectweb.asm.Label defaultTarget, org.objectweb.asm.Label... label)
Visits a table switch instruction.protected void
onVisitTypeInsn(int opcode, java.lang.String type)
Visits a type instruction.protected void
onVisitVarInsn(int opcode, int offset)
Visits an variable instruction.void
visitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
void
visitIincInsn(int var, int increment)
void
visitInsn(int opcode)
void
visitIntInsn(int opcode, int operand)
void
visitInvokeDynamicInsn(java.lang.String name, java.lang.String desc, org.objectweb.asm.Handle bsm, java.lang.Object... bsmArgs)
void
visitJumpInsn(int opcode, org.objectweb.asm.Label label)
void
visitLabel(org.objectweb.asm.Label label)
void
visitLdcInsn(java.lang.Object cst)
void
visitLookupSwitchInsn(org.objectweb.asm.Label dflt, int[] keys, org.objectweb.asm.Label[] labels)
void
visitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
void
visitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc, boolean iFace)
void
visitMultiANewArrayInsn(java.lang.String desc, int dims)
void
visitTableSwitchInsn(int min, int max, org.objectweb.asm.Label dflt, org.objectweb.asm.Label... labels)
void
visitTypeInsn(int opcode, java.lang.String type)
void
visitVarInsn(int opcode, int var)
-
Methods inherited from class org.objectweb.asm.MethodVisitor
visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFrame, visitInsnAnnotation, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitMaxs, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation
-
-
-
-
Method Detail
-
onAfterExceptionTable
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.
-
visitLabel
public final void visitLabel(org.objectweb.asm.Label label)
- Overrides:
visitLabel
in classorg.objectweb.asm.MethodVisitor
-
onVisitLabel
protected void onVisitLabel(org.objectweb.asm.Label label)
Visits a label.- Parameters:
label
- The visited label.- See Also:
MethodVisitor.visitLabel(Label)
-
visitIntInsn
public final void visitIntInsn(int opcode, int operand)
- Overrides:
visitIntInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitIntInsn
protected void onVisitIntInsn(int opcode, int operand)
Visits an integer opcode.- Parameters:
opcode
- The visited opcode.operand
- The visited operand.
-
visitVarInsn
public final void visitVarInsn(int opcode, int var)
- Overrides:
visitVarInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitVarInsn
protected void onVisitVarInsn(int opcode, int offset)
Visits an variable instruction.- Parameters:
opcode
- The visited opcode.offset
- The visited offset.
-
visitTypeInsn
public final void visitTypeInsn(int opcode, java.lang.String type)
- Overrides:
visitTypeInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitTypeInsn
protected void onVisitTypeInsn(int opcode, java.lang.String type)
Visits a type instruction.- Parameters:
opcode
- The visited opcode.type
- The type name.
-
visitFieldInsn
public final void visitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
- Overrides:
visitFieldInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitFieldInsn
protected void onVisitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Visits a field instruction.- Parameters:
opcode
- The visited opcode.owner
- The field's owner.name
- The field's name.descriptor
- The field's descriptor.
-
visitMethodInsn
public final void visitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
- Overrides:
visitMethodInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitMethodInsn
@Deprecated protected void onVisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Deprecated.Visits a method instruction.- Parameters:
opcode
- The visited opcode.owner
- The method's owner.name
- The method's internal name.descriptor
- The method's descriptor.
-
visitMethodInsn
public final void visitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc, boolean iFace)
- Overrides:
visitMethodInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitMethodInsn
protected void onVisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor, boolean iFace)
Visits a method instruction.- Parameters:
opcode
- The visited opcode.owner
- The method's owner.name
- The method's internal name.descriptor
- The method's descriptor.iFace
-true
if the method belongs to an interface.
-
visitInvokeDynamicInsn
public final void visitInvokeDynamicInsn(java.lang.String name, java.lang.String desc, org.objectweb.asm.Handle bsm, java.lang.Object... bsmArgs)
- Overrides:
visitInvokeDynamicInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitInvokeDynamicInsn
protected void onVisitInvokeDynamicInsn(java.lang.String name, java.lang.String descriptor, org.objectweb.asm.Handle handle, java.lang.Object... argument)
Visits an invoke dynamic instruction.- Parameters:
name
- The name of the method.descriptor
- The descriptor of the method.handle
- The bootstrap method handle.argument
- The bootstrap method arguments.
-
visitJumpInsn
public final void visitJumpInsn(int opcode, org.objectweb.asm.Label label)
- Overrides:
visitJumpInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitJumpInsn
protected void onVisitJumpInsn(int opcode, org.objectweb.asm.Label label)
Visits a jump instruction.- Parameters:
opcode
- The visited opcode.label
- The visited label.
-
visitLdcInsn
public final void visitLdcInsn(java.lang.Object cst)
- Overrides:
visitLdcInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitLdcInsn
protected void onVisitLdcInsn(java.lang.Object constant)
Visits a constant pool access instruction.- Parameters:
constant
- The constant pool value.
-
visitIincInsn
public final void visitIincInsn(int var, int increment)
- Overrides:
visitIincInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitIincInsn
protected void onVisitIincInsn(int offset, int increment)
Visits an increment instruction.- Parameters:
offset
- The offset of the accessed variable.increment
- The value with which to increment.
-
visitTableSwitchInsn
public final void visitTableSwitchInsn(int min, int max, org.objectweb.asm.Label dflt, org.objectweb.asm.Label... labels)
- Overrides:
visitTableSwitchInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitTableSwitchInsn
protected void onVisitTableSwitchInsn(int min, int max, org.objectweb.asm.Label defaultTarget, org.objectweb.asm.Label... label)
Visits a table switch instruction.- Parameters:
min
- The minimum index.max
- The maximum index.defaultTarget
- A label indicating the default value.label
- Labels indicating the jump targets.
-
visitLookupSwitchInsn
public final void visitLookupSwitchInsn(org.objectweb.asm.Label dflt, int[] keys, org.objectweb.asm.Label[] labels)
- Overrides:
visitLookupSwitchInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitLookupSwitchInsn
protected void onVisitLookupSwitchInsn(org.objectweb.asm.Label defaultTarget, int[] keys, org.objectweb.asm.Label[] key)
Visits a lookup switch instruction.- Parameters:
defaultTarget
- The default option.keys
- The key values.key
- The targets for each key.
-
visitMultiANewArrayInsn
public final void visitMultiANewArrayInsn(java.lang.String desc, int dims)
- Overrides:
visitMultiANewArrayInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitMultiANewArrayInsn
protected void onVisitMultiANewArrayInsn(java.lang.String descriptor, int dimensions)
Visits an instruction for creating a multidimensional array.- Parameters:
descriptor
- The type descriptor of the array's component type.dimensions
- The dimensions of the array.
-
visitInsn
public final void visitInsn(int opcode)
- Overrides:
visitInsn
in classorg.objectweb.asm.MethodVisitor
-
onVisitInsn
protected void onVisitInsn(int opcode)
Visits a simple instruction.- Parameters:
opcode
- The opcode of the instruction.
-
-