Package net.bytebuddy.asm
Class Advice.StackMapFrameHandler.Default.ForAdvice
- java.lang.Object
-
- net.bytebuddy.asm.Advice.StackMapFrameHandler.Default.ForAdvice
-
- All Implemented Interfaces:
Advice.StackMapFrameHandler
,Advice.StackMapFrameHandler.ForAdvice
- Enclosing class:
- Advice.StackMapFrameHandler.Default
protected class Advice.StackMapFrameHandler.Default.ForAdvice extends java.lang.Object implements Advice.StackMapFrameHandler.ForAdvice
A stack map frame handler for an advice method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.StackMapFrameHandler
Advice.StackMapFrameHandler.Default, Advice.StackMapFrameHandler.ForAdvice, Advice.StackMapFrameHandler.ForInstrumentedMethod, Advice.StackMapFrameHandler.NoOp
-
-
Field Summary
Fields Modifier and Type Field Description protected MethodDescription.InDefinedShape
adviceMethod
The method description for which frames are translated.protected java.util.List<? extends TypeDescription>
endTypes
The types provided after execution of the advice code.private Advice.StackMapFrameHandler.Default.Initialization
initialization
The initialization to apply when resolving a reference to the instance on which a non-static method is invoked.protected java.util.List<? extends TypeDescription>
startTypes
The types provided before execution of the advice code.protected Advice.StackMapFrameHandler.Default.TranslationMode
translationMode
The translation mode to apply for this advice method.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForAdvice(MethodDescription.InDefinedShape adviceMethod, java.util.List<? extends TypeDescription> startTypes, java.util.List<? extends TypeDescription> endTypes, Advice.StackMapFrameHandler.Default.TranslationMode translationMode, Advice.StackMapFrameHandler.Default.Initialization initialization)
Creates a new meta data handler for an advice method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
injectCompletionFrame(org.objectweb.asm.MethodVisitor methodVisitor)
Injects a frame indicating the completion of the currently handled method, i.e.void
injectExceptionFrame(org.objectweb.asm.MethodVisitor methodVisitor)
Injects a frame indicating the beginning of an exception handler for the currently handled method.void
injectReturnFrame(org.objectweb.asm.MethodVisitor methodVisitor)
Injects a frame indicating the beginning of a return value handler for the currently handled method.void
translateFrame(org.objectweb.asm.MethodVisitor methodVisitor, int type, int localVariableLength, java.lang.Object[] localVariable, int stackSize, java.lang.Object[] stack)
Translates a frame.
-
-
-
Field Detail
-
adviceMethod
protected final MethodDescription.InDefinedShape adviceMethod
The method description for which frames are translated.
-
startTypes
protected final java.util.List<? extends TypeDescription> startTypes
The types provided before execution of the advice code.
-
endTypes
protected final java.util.List<? extends TypeDescription> endTypes
The types provided after execution of the advice code.
-
translationMode
protected final Advice.StackMapFrameHandler.Default.TranslationMode translationMode
The translation mode to apply for this advice method. Should be eitherAdvice.StackMapFrameHandler.Default.TranslationMode.ENTER
orAdvice.StackMapFrameHandler.Default.TranslationMode.EXIT
.
-
initialization
private final Advice.StackMapFrameHandler.Default.Initialization initialization
The initialization to apply when resolving a reference to the instance on which a non-static method is invoked.
-
-
Constructor Detail
-
ForAdvice
protected ForAdvice(MethodDescription.InDefinedShape adviceMethod, java.util.List<? extends TypeDescription> startTypes, java.util.List<? extends TypeDescription> endTypes, Advice.StackMapFrameHandler.Default.TranslationMode translationMode, Advice.StackMapFrameHandler.Default.Initialization initialization)
Creates a new meta data handler for an advice method.- Parameters:
adviceMethod
- The method description for which frames are translated.startTypes
- The types provided before execution of the advice code.endTypes
- The types provided after execution of the advice code.translationMode
- The translation mode to apply for this advice method. Should be eitherAdvice.StackMapFrameHandler.Default.TranslationMode.ENTER
orAdvice.StackMapFrameHandler.Default.TranslationMode.EXIT
.initialization
- The initialization to apply when resolving a reference to the instance on which a non-static method is invoked.
-
-
Method Detail
-
translateFrame
public void translateFrame(org.objectweb.asm.MethodVisitor methodVisitor, int type, int localVariableLength, java.lang.Object[] localVariable, int stackSize, java.lang.Object[] stack)
Translates a frame.- Specified by:
translateFrame
in interfaceAdvice.StackMapFrameHandler
- Parameters:
methodVisitor
- The method visitor to write the frame to.type
- The frame's type.localVariableLength
- The local variable length.localVariable
- An array containing the types of the current local variables.stackSize
- The size of the operand stack.stack
- An array containing the types of the current operand stack.
-
injectReturnFrame
public void injectReturnFrame(org.objectweb.asm.MethodVisitor methodVisitor)
Injects a frame indicating the beginning of a return value handler for the currently handled method.- Specified by:
injectReturnFrame
in interfaceAdvice.StackMapFrameHandler
- Parameters:
methodVisitor
- The method visitor onto which to apply the stack map frame.
-
injectExceptionFrame
public void injectExceptionFrame(org.objectweb.asm.MethodVisitor methodVisitor)
Injects a frame indicating the beginning of an exception handler for the currently handled method.- Specified by:
injectExceptionFrame
in interfaceAdvice.StackMapFrameHandler
- Parameters:
methodVisitor
- The method visitor onto which to apply the stack map frame.
-
injectCompletionFrame
public void injectCompletionFrame(org.objectweb.asm.MethodVisitor methodVisitor)
Injects a frame indicating the completion of the currently handled method, i.e. all yielded types were added.- Specified by:
injectCompletionFrame
in interfaceAdvice.StackMapFrameHandler
- Parameters:
methodVisitor
- The method visitor onto which to apply the stack map frame.
-
-