Class Advice.AdviceVisitor

    • Constructor Detail

      • AdviceVisitor

        protected AdviceVisitor​(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,
                                java.util.List<? extends TypeDescription> postMethodTypes,
                                int writerFlags,
                                int readerFlags)
        Creates a new advice visitor.
        Parameters:
        methodVisitor - The actual method visitor that is underlying this method visitor to which all instructions are written.
        implementationContext - The implementation context to use.
        assigner - The assigner to use.
        exceptionHandler - The stack manipulation to apply within a suppression handler.
        instrumentedType - A description of the instrumented type.
        instrumentedMethod - The instrumented method.
        methodEnter - The method enter advice.
        methodExit - The method exit advice.
        postMethodTypes - A list of virtual method arguments that are available after the instrumented method has completed.
        writerFlags - The ASM writer flags that were set.
        readerFlags - The ASM reader flags that were set.
    • Method Detail

      • onAfterExceptionTable

        protected void onAfterExceptionTable()
        Description copied from class: ExceptionTableSensitiveMethodVisitor
        Invoked after the exception table was visited. Typically, the exception table is visited by ASM at the beginning of a method. It is however possible that a user adds exception table entries at a later point. Normally, this is however not meaningful use of ASM.
        Specified by:
        onAfterExceptionTable in class ExceptionTableSensitiveMethodVisitor
      • onUserPrepare

        protected abstract void onUserPrepare()
        Invoked when the user method's exception handler (if any) is supposed to be prepared.
      • onUserStart

        protected abstract void onUserStart()
        Writes the advice for entering the instrumented method.
      • onVisitFrame

        public void onVisitFrame​(int type,
                                 int localVariableLength,
                                 java.lang.Object[] localVariable,
                                 int stackSize,
                                 java.lang.Object[] stack)
        Description copied from class: ExceptionTableSensitiveMethodVisitor
        Visits a stack map frame.
        Overrides:
        onVisitFrame in class ExceptionTableSensitiveMethodVisitor
        Parameters:
        type - The type of stack map frame.
        localVariableLength - The length of the local variable array.
        localVariable - An array containing type symbols for all values in the local variable array.
        stackSize - The size of the operand stack.
        stack - An array containing type symbols for all values on the operand stack.
      • visitMaxs

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

        public void visitLocalVariable​(java.lang.String name,
                                       java.lang.String descriptor,
                                       java.lang.String signature,
                                       org.objectweb.asm.Label start,
                                       org.objectweb.asm.Label end,
                                       int index)
        Overrides:
        visitLocalVariable in class org.objectweb.asm.MethodVisitor
      • visitLocalVariableAnnotation

        public org.objectweb.asm.AnnotationVisitor visitLocalVariableAnnotation​(int typeReference,
                                                                                org.objectweb.asm.TypePath typePath,
                                                                                org.objectweb.asm.Label[] start,
                                                                                org.objectweb.asm.Label[] end,
                                                                                int[] index,
                                                                                java.lang.String descriptor,
                                                                                boolean visible)
        Overrides:
        visitLocalVariableAnnotation in class org.objectweb.asm.MethodVisitor
      • onUserEnd

        protected abstract void onUserEnd()
        Writes the advice for completing the instrumented method.