Class Advice.Appender.EmulatingMethodVisitor
java.lang.Object
org.objectweb.asm.MethodVisitor
net.bytebuddy.asm.Advice.Appender.EmulatingMethodVisitor
- Enclosing class:
Advice.Appender
protected static class Advice.Appender.EmulatingMethodVisitor
extends org.objectweb.asm.MethodVisitor
A method visitor that allows for the emulation of a full method visitor invocation circle without delegating initial
and ending visitations to the underlying visitor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteCodeAppenderThe delegate byte code appender.private intThe currently recorded minimal required local variable array length.private intThe currently recorded minimal required stack size.Fields inherited from class org.objectweb.asm.MethodVisitor
api, mv -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmulatingMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, ByteCodeAppender delegate) Creates a new emulating method visitor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ByteCodeAppender.Sizeresolve(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Resolves this this advice emulating method visitor for its delegate.voidvoidvisitEnd()voidvisitMaxs(int stackSize, int localVariableLength) Methods inherited from class org.objectweb.asm.MethodVisitor
getDelegate, visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn, visitVarInsn
-
Field Details
-
delegate
The delegate byte code appender. -
stackSize
private int stackSizeThe currently recorded minimal required stack size. -
localVariableLength
private int localVariableLengthThe currently recorded minimal required local variable array length.
-
-
Constructor Details
-
EmulatingMethodVisitor
protected EmulatingMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, ByteCodeAppender delegate) Creates a new emulating method visitor.- Parameters:
methodVisitor- The underlying method visitor.delegate- The delegate byte code appender.
-
-
Method Details
-
resolve
protected ByteCodeAppender.Size resolve(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Resolves this this advice emulating method visitor for its delegate.- Parameters:
methodVisitor- The method visitor to apply.implementationContext- The implementation context to apply.instrumentedMethod- The instrumented method.- Returns:
- The resulting size of the implemented method.
-
visitCode
public void visitCode()- Overrides:
visitCodein classorg.objectweb.asm.MethodVisitor
-
visitMaxs
public void visitMaxs(int stackSize, int localVariableLength) - Overrides:
visitMaxsin classorg.objectweb.asm.MethodVisitor
-
visitEnd
public void visitEnd()- Overrides:
visitEndin classorg.objectweb.asm.MethodVisitor
-