Package net.bytebuddy.asm
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.MethodVisitorA 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
Fields Modifier and Type Field Description private ByteCodeAppenderdelegateThe delegate byte code appender.private intlocalVariableLengthThe currently recorded minimal required local variable array length.private intstackSizeThe currently recorded minimal required stack size.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEmulatingMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, ByteCodeAppender delegate)Creates a new emulating method visitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ByteCodeAppender.Sizeresolve(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)Resolves this this advice emulating method visitor for its delegate.voidvisitCode()voidvisitEnd()voidvisitMaxs(int stackSize, int localVariableLength)-
Methods inherited from class org.objectweb.asm.MethodVisitor
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 Detail
-
delegate
private final ByteCodeAppender delegate
The delegate byte code appender.
-
stackSize
private int stackSize
The currently recorded minimal required stack size.
-
localVariableLength
private int localVariableLength
The currently recorded minimal required local variable array length.
-
-
Constructor Detail
-
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 Detail
-
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
-
-