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

    Fields
    Modifier and Type
    Field
    Description
    private final ByteCodeAppender
    The delegate byte code appender.
    private int
    The currently recorded minimal required local variable array length.
    private int
    The currently recorded minimal required stack size.

    Fields inherited from class org.objectweb.asm.MethodVisitor

    api, mv
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    EmulatingMethodVisitor(org.objectweb.asm.MethodVisitor methodVisitor, ByteCodeAppender delegate)
    Creates a new emulating method visitor.
  • Method Summary

    Modifier and Type
    Method
    Description
    resolve(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
    Resolves this this advice emulating method visitor for its delegate.
    void
     
    void
     
    void
    visitMaxs(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • 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 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:
      visitCode in class org.objectweb.asm.MethodVisitor
    • visitMaxs

      public void visitMaxs(int stackSize, int localVariableLength)
      Overrides:
      visitMaxs in class org.objectweb.asm.MethodVisitor
    • visitEnd

      public void visitEnd()
      Overrides:
      visitEnd in class org.objectweb.asm.MethodVisitor