Class Bridger

  • All Implemented Interfaces:
    java.lang.instrument.ClassFileTransformer

    public final class Bridger
    extends java.lang.Object
    implements java.lang.instrument.ClassFileTransformer
    • Constructor Summary

      Constructors 
      Constructor Description
      Bridger()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void doAccept​(org.objectweb.asm.ClassWriter classWriter, org.objectweb.asm.ClassReader classReader)  
      int getTransformedMethodCallCount()  
      int getTransformedMethodCount()  
      static void main​(java.lang.String[] args)
      Translate all .class files in the given list of files and directories.
      private static void safeClose​(java.io.Closeable closeable)  
      byte[] transform​(java.io.InputStream input)  
      void transform​(java.io.InputStream input, java.io.OutputStream output)  
      void transform​(java.io.RandomAccessFile file)  
      byte[] transform​(java.lang.ClassLoader loader, java.lang.String className, java.lang.Class<?> classBeingRedefined, java.security.ProtectionDomain protectionDomain, byte[] classfileBuffer)  
      void transformRecursive​(java.io.File... files)
      Translate all .class files in the given list of files and directories.
      void transformRecursive​(java.lang.String... names)
      Translate all .class files in the given list of files and directories.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.instrument.ClassFileTransformer

        transform
    • Field Detail

      • transformedMethodCount

        private final java.util.concurrent.atomic.AtomicInteger transformedMethodCount
      • transformedMethodCallCount

        private final java.util.concurrent.atomic.AtomicInteger transformedMethodCallCount
    • Constructor Detail

      • Bridger

        public Bridger()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Translate all .class files in the given list of files and directories.
        Parameters:
        args - the file and directory names
      • transformRecursive

        public void transformRecursive​(java.lang.String... names)
        Translate all .class files in the given list of files and directories.
        Parameters:
        names - the file and directory names
      • transformRecursive

        public void transformRecursive​(java.io.File... files)
        Translate all .class files in the given list of files and directories.
        Parameters:
        files - the files and directories
      • transform

        public byte[] transform​(java.lang.ClassLoader loader,
                                java.lang.String className,
                                java.lang.Class<?> classBeingRedefined,
                                java.security.ProtectionDomain protectionDomain,
                                byte[] classfileBuffer)
                         throws java.lang.instrument.IllegalClassFormatException
        Specified by:
        transform in interface java.lang.instrument.ClassFileTransformer
        Throws:
        java.lang.instrument.IllegalClassFormatException
      • transform

        public byte[] transform​(java.io.InputStream input)
                         throws java.lang.instrument.IllegalClassFormatException,
                                java.io.IOException
        Throws:
        java.lang.instrument.IllegalClassFormatException
        java.io.IOException
      • getTransformedMethodCount

        public int getTransformedMethodCount()
      • getTransformedMethodCallCount

        public int getTransformedMethodCallCount()
      • doAccept

        private void doAccept​(org.objectweb.asm.ClassWriter classWriter,
                              org.objectweb.asm.ClassReader classReader)
                       throws java.lang.instrument.IllegalClassFormatException
        Throws:
        java.lang.instrument.IllegalClassFormatException
      • transform

        public void transform​(java.io.InputStream input,
                              java.io.OutputStream output)
                       throws java.lang.instrument.IllegalClassFormatException,
                              java.io.IOException
        Throws:
        java.lang.instrument.IllegalClassFormatException
        java.io.IOException
      • transform

        public void transform​(java.io.RandomAccessFile file)
                       throws java.lang.instrument.IllegalClassFormatException,
                              java.io.IOException
        Throws:
        java.lang.instrument.IllegalClassFormatException
        java.io.IOException
      • safeClose

        private static void safeClose​(java.io.Closeable closeable)