Class ResettableClassFileTransformer.WithDelegation.WithCallback<T>

Type Parameters:
T - The type of the value that is passed between the callback methods.
All Implemented Interfaces:
ClassFileTransformer, ResettableClassFileTransformer
Enclosing class:
ResettableClassFileTransformer.WithDelegation

@Enhance protected static class ResettableClassFileTransformer.WithDelegation.WithCallback<T> extends ResettableClassFileTransformer.WithDelegation
A class file transformer with a callback.
  • Constructor Details

  • Method Details

    • transform

      @MaybeNull public byte[] transform(@MaybeNull ClassLoader classLoader, @MaybeNull String internalName, @MaybeNull Class<?> classBeingRedefined, @MaybeNull ProtectionDomain protectionDomain, byte[] binaryRepresentation) throws IllegalClassFormatException
      Throws:
      IllegalClassFormatException
    • transform

      @MaybeNull protected byte[] transform(Object rawModule, @MaybeNull ClassLoader classLoader, @MaybeNull String internalName, @MaybeNull Class<?> classBeingRedefined, @MaybeNull ProtectionDomain protectionDomain, byte[] binaryRepresentation) throws IllegalClassFormatException
      A method to delegate to when the module system is supported on the current JVM.
      Parameters:
      rawModule - The instrumented class's java.lang.Module.
      classLoader - The type's class loader or null if the type is loaded by the bootstrap loader.
      internalName - The internal name of the instrumented class.
      classBeingRedefined - The loaded Class being redefined or null if no such class exists.
      protectionDomain - The instrumented type's protection domain or null if not available.
      binaryRepresentation - The class file of the instrumented class in its current state.
      Returns:
      The binary representation of the transformed class file or null if no transformation should be applied.
      Throws:
      IllegalClassFormatException - If the class file was found invalid.
    • doTransform

      @MaybeNull protected byte[] doTransform(Object rawModule, @MaybeNull ClassLoader classLoader, @MaybeNull String internalName, @MaybeNull Class<?> classBeingRedefined, @MaybeNull ProtectionDomain protectionDomain, byte[] binaryRepresentation) throws IllegalClassFormatException
      Callback between the transformation callbacks.
      Parameters:
      rawModule - The instrumented class's java.lang.Module.
      classLoader - The type's class loader or null if the type is loaded by the bootstrap loader.
      internalName - The internal name of the instrumented class.
      classBeingRedefined - The loaded Class being redefined or null if no such class exists.
      protectionDomain - The instrumented type's protection domain or null if not available.
      binaryRepresentation - The class file of the instrumented class in its current state.
      Returns:
      The binary representation of the transformed class file or null if no transformation should be applied.
      Throws:
      IllegalClassFormatException - If the class file was found invalid.