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,TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending
public abstract class ExceptionTableSensitiveMethodVisitor extends org.objectweb.asm.MethodVisitorAMethodVisitorthat adds a callback after visiting the exception table of a method.
-
-
Field Summary
Fields Modifier and Type Field Description private booleantriggertrueif the exception table callback was already triggered.
-
Constructor Summary
Constructors Modifier Constructor Description protectedExceptionTableSensitiveMethodVisitor(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 private voidconsiderEndOfExceptionTable()Considers if the end of the exception table was reached.protected abstract voidonAfterExceptionTable()Invoked after the exception table was visited.protected voidonVisitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)Visits a field instruction.protected voidonVisitFrame(int type, int localVariableLength, java.lang.Object[] localVariable, int stackSize, java.lang.Object[] stack)Visits a stack map frame.protected voidonVisitIincInsn(int offset, int increment)Visits an increment instruction.protected voidonVisitInsn(int opcode)Visits a simple instruction.protected voidonVisitIntInsn(int opcode, int operand)Visits an integer opcode.protected voidonVisitInvokeDynamicInsn(java.lang.String name, java.lang.String descriptor, org.objectweb.asm.Handle handle, java.lang.Object... argument)Visits an invoke dynamic instruction.protected voidonVisitJumpInsn(int opcode, org.objectweb.asm.Label label)Visits a jump instruction.protected voidonVisitLabel(org.objectweb.asm.Label label)Visits a label.protected voidonVisitLdcInsn(java.lang.Object constant)Visits a constant pool access instruction.protected voidonVisitLookupSwitchInsn(org.objectweb.asm.Label defaultTarget, int[] key, org.objectweb.asm.Label[] label)Visits a lookup switch instruction.protected voidonVisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)Deprecated.protected voidonVisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor, boolean isInterface)Visits a method instruction.protected voidonVisitMultiANewArrayInsn(java.lang.String descriptor, int dimensions)Visits an instruction for creating a multidimensional array.protected voidonVisitTableSwitchInsn(int minimum, int maximum, org.objectweb.asm.Label defaultTarget, org.objectweb.asm.Label... label)Visits a table switch instruction.protected voidonVisitTypeInsn(int opcode, java.lang.String type)Visits a type instruction.protected voidonVisitVarInsn(int opcode, int offset)Visits an variable instruction.voidvisitFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)voidvisitFrame(int type, int localVariableLength, java.lang.Object[] localVariable, int stackSize, java.lang.Object[] stack)voidvisitIincInsn(int offset, int increment)voidvisitInsn(int opcode)voidvisitIntInsn(int opcode, int operand)voidvisitInvokeDynamicInsn(java.lang.String name, java.lang.String descriptor, org.objectweb.asm.Handle handle, java.lang.Object... argument)voidvisitJumpInsn(int opcode, org.objectweb.asm.Label label)voidvisitLabel(org.objectweb.asm.Label label)voidvisitLdcInsn(java.lang.Object constant)voidvisitLookupSwitchInsn(org.objectweb.asm.Label dflt, int[] key, org.objectweb.asm.Label[] label)voidvisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor)voidvisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor, boolean isInterface)voidvisitMultiANewArrayInsn(java.lang.String descriptor, int dimensions)voidvisitTableSwitchInsn(int minimum, int maximum, org.objectweb.asm.Label defaultTarget, org.objectweb.asm.Label... label)voidvisitTypeInsn(int opcode, java.lang.String type)voidvisitVarInsn(int opcode, int offset)-
Methods inherited from class org.objectweb.asm.MethodVisitor
getDelegate, visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitInsnAnnotation, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitMaxs, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation
-
-
-
-
Method Detail
-
considerEndOfExceptionTable
private void considerEndOfExceptionTable()
Considers if the end of the exception table was reached.
-
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.
-
visitFrame
public final void visitFrame(int type, int localVariableLength, @MaybeNull java.lang.Object[] localVariable, int stackSize, @MaybeNull java.lang.Object[] stack)- Overrides:
visitFramein classorg.objectweb.asm.MethodVisitor
-
onVisitFrame
protected void onVisitFrame(int type, int localVariableLength, @MaybeNull java.lang.Object[] localVariable, int stackSize, @MaybeNull java.lang.Object[] stack)Visits a stack map frame.- Parameters:
type- The type of stack map frame.localVariableLength- The length of the local variable array.localVariable- An array containing type symbols for all values in the local variable array ornullif none.stackSize- The size of the operand stack.stack- An array containing type symbols for all values on the operand stack ornullif none.
-
visitLabel
public final void visitLabel(org.objectweb.asm.Label label)
- Overrides:
visitLabelin 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:
visitIntInsnin 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 offset)- Overrides:
visitVarInsnin 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:
visitTypeInsnin 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 descriptor)- Overrides:
visitFieldInsnin 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 descriptor)- Overrides:
visitMethodInsnin 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 descriptor, boolean isInterface)- Overrides:
visitMethodInsnin classorg.objectweb.asm.MethodVisitor
-
onVisitMethodInsn
protected void onVisitMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String descriptor, boolean isInterface)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.isInterface-trueif the method belongs to an interface.
-
visitInvokeDynamicInsn
public final void visitInvokeDynamicInsn(java.lang.String name, java.lang.String descriptor, org.objectweb.asm.Handle handle, java.lang.Object... argument)- Overrides:
visitInvokeDynamicInsnin 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:
visitJumpInsnin 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 constant)
- Overrides:
visitLdcInsnin 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 offset, int increment)- Overrides:
visitIincInsnin 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 minimum, int maximum, org.objectweb.asm.Label defaultTarget, org.objectweb.asm.Label... label)- Overrides:
visitTableSwitchInsnin classorg.objectweb.asm.MethodVisitor
-
onVisitTableSwitchInsn
protected void onVisitTableSwitchInsn(int minimum, int maximum, org.objectweb.asm.Label defaultTarget, org.objectweb.asm.Label... label)Visits a table switch instruction.- Parameters:
minimum- The minimum index.maximum- 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[] key, org.objectweb.asm.Label[] label)- Overrides:
visitLookupSwitchInsnin classorg.objectweb.asm.MethodVisitor
-
onVisitLookupSwitchInsn
protected void onVisitLookupSwitchInsn(org.objectweb.asm.Label defaultTarget, int[] key, org.objectweb.asm.Label[] label)Visits a lookup switch instruction.- Parameters:
defaultTarget- The default option.key- The key values.label- The targets for each key.
-
visitMultiANewArrayInsn
public final void visitMultiANewArrayInsn(java.lang.String descriptor, int dimensions)- Overrides:
visitMultiANewArrayInsnin 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:
visitInsnin classorg.objectweb.asm.MethodVisitor
-
onVisitInsn
protected void onVisitInsn(int opcode)
Visits a simple instruction.- Parameters:
opcode- The opcode of the instruction.
-
-