Class ClassFilePostProcessor.ForClassFileTransformer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.security.ProtectionDomain ALL_PRIVILEGES
      A protection domain that represents all permissions.
      private java.lang.instrument.ClassFileTransformer classFileTransformer
      The class file transformer to delegate to.
      private static java.lang.Class<?> UNLOADED_TYPE
      Indicates that a class is not currently loaded.
    • Constructor Summary

      Constructors 
      Constructor Description
      ForClassFileTransformer​(java.lang.instrument.ClassFileTransformer classFileTransformer)
      Creates a new class file post processor for a class file transformer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] transform​(java.lang.ClassLoader classLoader, java.lang.String name, java.security.ProtectionDomain protectionDomain, byte[] binaryRepresentation)
      Transforms a class file for a given class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ALL_PRIVILEGES

        protected static final java.security.ProtectionDomain ALL_PRIVILEGES
        A protection domain that represents all permissions.
      • UNLOADED_TYPE

        @AlwaysNull
        private static final java.lang.Class<?> UNLOADED_TYPE
        Indicates that a class is not currently loaded.
      • classFileTransformer

        private final java.lang.instrument.ClassFileTransformer classFileTransformer
        The class file transformer to delegate to.
    • Constructor Detail

      • ForClassFileTransformer

        public ForClassFileTransformer​(java.lang.instrument.ClassFileTransformer classFileTransformer)
        Creates a new class file post processor for a class file transformer.
        Parameters:
        classFileTransformer - The class file transformer to delegate to.
    • Method Detail

      • transform

        public byte[] transform​(@MaybeNull
                                java.lang.ClassLoader classLoader,
                                java.lang.String name,
                                @MaybeNull
                                java.security.ProtectionDomain protectionDomain,
                                byte[] binaryRepresentation)
        Transforms a class file for a given class.
        Specified by:
        transform in interface ClassFilePostProcessor
        Parameters:
        classLoader - The class loader which is used to load a class or null if loaded by the bootstrap loader.
        name - The binary name of the transformed class.
        protectionDomain - The protection domain of the transformed class or null if no protection domain is provided.
        binaryRepresentation - The binary representation of the class file.
        Returns:
        The class file to use.