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
      • onStart

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

        public void visitFrame​(int type,
                               int localVariableLength,
                               java.lang.Object[] localVariable,
                               int stackSize,
                               java.lang.Object[] stack)
        Overrides:
        visitFrame in class org.objectweb.asm.MethodVisitor
      • 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.