Package net.bytebuddy.asm
Class Advice.AdviceVisitor.WithExitAdvice.WithExceptionHandling
- java.lang.Object
-
- org.objectweb.asm.MethodVisitor
-
- net.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor
-
- net.bytebuddy.asm.Advice.AdviceVisitor
-
- net.bytebuddy.asm.Advice.AdviceVisitor.WithExitAdvice
-
- net.bytebuddy.asm.Advice.AdviceVisitor.WithExitAdvice.WithExceptionHandling
-
- All Implemented Interfaces:
Advice.Dispatcher.Bound.SkipHandler
- Enclosing class:
- Advice.AdviceVisitor.WithExitAdvice
protected static class Advice.AdviceVisitor.WithExitAdvice.WithExceptionHandling extends Advice.AdviceVisitor.WithExitAdvice
An advice visitor that captures exceptions by weaving try-catch blocks around user code.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.bytebuddy.asm.Advice.AdviceVisitor.WithExitAdvice
Advice.AdviceVisitor.WithExitAdvice.WithExceptionHandling, Advice.AdviceVisitor.WithExitAdvice.WithoutExceptionHandling
-
Nested classes/interfaces inherited from class net.bytebuddy.asm.Advice.AdviceVisitor
Advice.AdviceVisitor.WithExitAdvice, Advice.AdviceVisitor.WithoutExitAdvice
-
-
Field Summary
-
Fields inherited from class net.bytebuddy.asm.Advice.AdviceVisitor.WithExitAdvice
doesReturn, returnHandler
-
Fields inherited from class net.bytebuddy.asm.Advice.AdviceVisitor
instrumentedMethod, methodExit, methodSizeHandler, methodVisitor, stackMapFrameHandler
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WithExceptionHandling(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, StackManipulation exceptionHandler, TypeDescription instrumentedType, MethodDescription instrumentedMethod, Advice.Dispatcher.Resolved.ForMethodEnter methodEnter, Advice.Dispatcher.Resolved.ForMethodExit methodExit, int writerFlags, int readerFlags, TypeDescription throwable)
Creates a new advice visitor that captures exception by weaving try-catch blocks around user code.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
onExitAdviceReturn()
Invoked after the exit advice method has returned.protected void
onUserPrepare()
Invoked when the user method's exception handler (if any) is supposed to be prepared.protected void
onUserReturn()
Invoked after the user method has returned.protected void
onUserStart()
Writes the advice for entering the instrumented method.-
Methods inherited from class net.bytebuddy.asm.Advice.AdviceVisitor.WithExitAdvice
apply, onUserEnd, onVisitInsn
-
Methods inherited from class net.bytebuddy.asm.Advice.AdviceVisitor
onAfterExceptionTable, onVisitIincInsn, onVisitVarInsn, variable, variable, visitFrame, visitLocalVariable, visitLocalVariableAnnotation, visitMaxs
-
Methods inherited from class net.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor
onVisitFieldInsn, onVisitIntInsn, onVisitInvokeDynamicInsn, onVisitJumpInsn, onVisitLabel, onVisitLdcInsn, onVisitLookupSwitchInsn, onVisitMethodInsn, onVisitMethodInsn, onVisitMultiANewArrayInsn, onVisitTableSwitchInsn, onVisitTypeInsn, visitFieldInsn, visitIincInsn, visitInsn, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTypeInsn, visitVarInsn
-
Methods inherited from class org.objectweb.asm.MethodVisitor
visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitInsnAnnotation, visitLineNumber, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation
-
-
-
-
Constructor Detail
-
WithExceptionHandling
protected WithExceptionHandling(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, Assigner assigner, StackManipulation exceptionHandler, TypeDescription instrumentedType, MethodDescription instrumentedMethod, Advice.Dispatcher.Resolved.ForMethodEnter methodEnter, Advice.Dispatcher.Resolved.ForMethodExit methodExit, int writerFlags, int readerFlags, TypeDescription throwable)
Creates a new advice visitor that captures exception by weaving try-catch blocks around user code.- Parameters:
methodVisitor
- The method visitor for the instrumented method.instrumentedType
- A description of the instrumented type.implementationContext
- The implementation context to use.assigner
- The assigner to use.exceptionHandler
- The stack manipulation to apply within a suppression handler.instrumentedMethod
- A description of the instrumented method.methodEnter
- The dispatcher to be used for method entry.methodExit
- The dispatcher to be used for method exit.writerFlags
- The ASM writer flags that were set.readerFlags
- The ASM reader flags that were set.throwable
- The type of the handled throwable type for which this advice is invoked.
-
-
Method Detail
-
onUserPrepare
protected void onUserPrepare()
Description copied from class:Advice.AdviceVisitor
Invoked when the user method's exception handler (if any) is supposed to be prepared.- Specified by:
onUserPrepare
in classAdvice.AdviceVisitor
-
onUserStart
protected void onUserStart()
Description copied from class:Advice.AdviceVisitor
Writes the advice for entering the instrumented method.- Specified by:
onUserStart
in classAdvice.AdviceVisitor
-
onUserReturn
protected void onUserReturn()
Description copied from class:Advice.AdviceVisitor.WithExitAdvice
Invoked after the user method has returned.- Specified by:
onUserReturn
in classAdvice.AdviceVisitor.WithExitAdvice
-
onExitAdviceReturn
protected void onExitAdviceReturn()
Description copied from class:Advice.AdviceVisitor.WithExitAdvice
Invoked after the exit advice method has returned.- Specified by:
onExitAdviceReturn
in classAdvice.AdviceVisitor.WithExitAdvice
-
-