Class TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending

    • Constructor Detail

      • Appending

        protected Appending​(org.objectweb.asm.MethodVisitor methodVisitor,
                            TypeDescription instrumentedType,
                            TypeWriter.MethodPool.Record record,
                            AnnotationValueFilter.Factory annotationValueFilterFactory,
                            boolean requireFrames,
                            boolean expandFrames)
        Creates a new appending initialization handler.
        Parameters:
        methodVisitor - The underlying method visitor.
        instrumentedType - The instrumented type.
        record - The method pool record for the type initializer.
        annotationValueFilterFactory - The used annotation value filter factory.
        requireFrames - true if the visitor is required to add frames.
        expandFrames - true if the visitor is required to expand any added frame.
    • Method Detail

      • of

        protected static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler of​(boolean enabled,
                                                                                                    org.objectweb.asm.MethodVisitor methodVisitor,
                                                                                                    TypeDescription instrumentedType,
                                                                                                    TypeWriter.MethodPool methodPool,
                                                                                                    AnnotationValueFilter.Factory annotationValueFilterFactory,
                                                                                                    boolean requireFrames,
                                                                                                    boolean expandFrames)
        Resolves an initialization handler.
        Parameters:
        enabled - true if the implementation context is enabled, i.e. any TypeInitializer might be active.
        methodVisitor - The delegation method visitor.
        instrumentedType - The instrumented type.
        methodPool - The method pool to use.
        annotationValueFilterFactory - The annotation value filter factory to use.
        requireFrames - true if frames must be computed.
        expandFrames - true if frames must be expanded.
        Returns:
        An initialization handler which is also guaranteed to be a MethodVisitor.
      • withDrain

        private static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrain withDrain​(org.objectweb.asm.MethodVisitor methodVisitor,
                                                                                                                             TypeDescription instrumentedType,
                                                                                                                             TypeWriter.MethodPool methodPool,
                                                                                                                             AnnotationValueFilter.Factory annotationValueFilterFactory,
                                                                                                                             boolean requireFrames,
                                                                                                                             boolean expandFrames)
        Resolves an initialization handler with a drain.
        Parameters:
        methodVisitor - The delegation method visitor.
        instrumentedType - The instrumented type.
        methodPool - The method pool to use.
        annotationValueFilterFactory - The annotation value filter factory to use.
        requireFrames - true if frames must be computed.
        expandFrames - true if frames must be expanded.
        Returns:
        An initialization handler which is also guaranteed to be a MethodVisitor.
      • withoutDrain

        private static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithoutDrain withoutDrain​(org.objectweb.asm.MethodVisitor methodVisitor,
                                                                                                                                   TypeDescription instrumentedType,
                                                                                                                                   TypeWriter.MethodPool methodPool,
                                                                                                                                   AnnotationValueFilter.Factory annotationValueFilterFactory,
                                                                                                                                   boolean requireFrames,
                                                                                                                                   boolean expandFrames)
        Resolves an initialization handler without a drain.
        Parameters:
        methodVisitor - The delegation method visitor.
        instrumentedType - The instrumented type.
        methodPool - The method pool to use.
        annotationValueFilterFactory - The annotation value filter factory to use.
        requireFrames - true if frames must be computed.
        expandFrames - true if frames must be expanded.
        Returns:
        An initialization handler which is also guaranteed to be a MethodVisitor.
      • visitCode

        public void visitCode()
        Overrides:
        visitCode in class org.objectweb.asm.MethodVisitor
      • 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
      • onStart

        protected abstract void onStart()
        Invoked after the user code was visited.
      • onVisitFrame

        protected void onVisitFrame​(int type,
                                    int localVariableLength,
                                    @MaybeNull
                                    java.lang.Object[] localVariable,
                                    int stackSize,
                                    @MaybeNull
                                    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 or null if none.
        stackSize - The size of the operand stack.
        stack - An array containing type symbols for all values on the operand stack or null if none.
      • visitMaxs

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

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

        public void apply​(org.objectweb.asm.ClassVisitor classVisitor,
                          TypeInitializer typeInitializer,
                          Implementation.Context implementationContext)
        Applies the drain.
        Specified by:
        apply in interface TypeInitializer.Drain
        Parameters:
        classVisitor - The class visitor to apply the initializer to.
        typeInitializer - The type initializer to write.
        implementationContext - The corresponding implementation context.
      • onComplete

        protected abstract void onComplete​(Implementation.Context implementationContext)
        Invoked upon completion of writing the type initializer.
        Parameters:
        implementationContext - The implementation context to use.