Class BytecodeTransformerBuildItem


  • public final class BytecodeTransformerBuildItem
    extends MultiBuildItem
    • Field Detail

      • eager

        final boolean eager
        If this is true it means the class should be loaded eagerly by a thread pool in dev mode on multithreaded systems.

        Transformation is expensive, so doing it this way can speed up boot time.

      • classToTransform

        final String classToTransform
      • visitorFunction

        final BiFunction<String,​org.objectweb.asm.ClassVisitor,​org.objectweb.asm.ClassVisitor> visitorFunction
      • inputTransformer

        final BiFunction<String,​byte[],​byte[]> inputTransformer
        Function that can be applied to the inout bytes before it is passed into ASM. This should only be used in very specific circumstances. At the moment the only known valid use case is jacoco, which needs access to the unmodified class file bytes.
      • requireConstPoolEntry

        final Set<String> requireConstPoolEntry
        A set of class names that need to be present in the const pool for the transformation to happen. These need to be in JVM internal format.

        The transformation is only applied if at least one of the entries in the const pool is present

        Note that this is an optimisation, and if another transformer is transforming the class anyway then this transformer will always be applied.

      • cacheable

        final boolean cacheable
      • classReaderOptions

        final int classReaderOptions
      • continueOnFailure

        final boolean continueOnFailure
    • Constructor Detail

      • BytecodeTransformerBuildItem

        public BytecodeTransformerBuildItem​(String classToTransform,
                                            BiFunction<String,​org.objectweb.asm.ClassVisitor,​org.objectweb.asm.ClassVisitor> visitorFunction)
      • BytecodeTransformerBuildItem

        public BytecodeTransformerBuildItem​(String classToTransform,
                                            BiFunction<String,​org.objectweb.asm.ClassVisitor,​org.objectweb.asm.ClassVisitor> visitorFunction,
                                            Set<String> requireConstPoolEntry)
      • BytecodeTransformerBuildItem

        public BytecodeTransformerBuildItem​(boolean eager,
                                            String classToTransform,
                                            BiFunction<String,​org.objectweb.asm.ClassVisitor,​org.objectweb.asm.ClassVisitor> visitorFunction)
      • BytecodeTransformerBuildItem

        public BytecodeTransformerBuildItem​(boolean eager,
                                            String classToTransform,
                                            BiFunction<String,​org.objectweb.asm.ClassVisitor,​org.objectweb.asm.ClassVisitor> visitorFunction,
                                            boolean cacheable)
      • BytecodeTransformerBuildItem

        public BytecodeTransformerBuildItem​(boolean eager,
                                            String classToTransform,
                                            BiFunction<String,​org.objectweb.asm.ClassVisitor,​org.objectweb.asm.ClassVisitor> visitorFunction,
                                            Set<String> requireConstPoolEntry)
      • BytecodeTransformerBuildItem

        public BytecodeTransformerBuildItem​(boolean eager,
                                            String classToTransform,
                                            BiFunction<String,​org.objectweb.asm.ClassVisitor,​org.objectweb.asm.ClassVisitor> visitorFunction,
                                            Set<String> requireConstPoolEntry,
                                            boolean cacheable)
    • Method Detail

      • getClassToTransform

        public String getClassToTransform()
      • getVisitorFunction

        public BiFunction<String,​org.objectweb.asm.ClassVisitor,​org.objectweb.asm.ClassVisitor> getVisitorFunction()
      • getRequireConstPoolEntry

        public Set<String> getRequireConstPoolEntry()
      • isEager

        public boolean isEager()
      • isCacheable

        public boolean isCacheable()
      • getClassReaderOptions

        public int getClassReaderOptions()
      • getInputTransformer

        public BiFunction<String,​byte[],​byte[]> getInputTransformer()
      • isContinueOnFailure

        public boolean isContinueOnFailure()