Interface ResettableClassFileTransformer.WithDelegation.Callback<T>

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

public static interface ResettableClassFileTransformer.WithDelegation.Callback<T>
A callback that is invoked upon class file transformation.
  • Method Details

    • onBeforeTransform

      @MaybeNull T onBeforeTransform(@MaybeNull JavaModule module, @MaybeNull ClassLoader classLoader, @MaybeNull String internalName, @MaybeNull Class<?> classBeingRedefined, @MaybeNull ProtectionDomain protectionDomain, byte[] binaryRepresentation) throws IllegalClassFormatException
      Invoked before the transformation is applied.
      Parameters:
      module - The instrumented class's Java module or null if the module system is not supported.
      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:
      A value to pass to the method that is invoked after transformation or null.
      Throws:
      IllegalClassFormatException - If the class file was found invalid.
    • onAfterTransform

      void onAfterTransform(@MaybeNull T value, @MaybeNull JavaModule module, @MaybeNull ClassLoader classLoader, @MaybeNull String internalName, @MaybeNull Class<?> classBeingRedefined, @MaybeNull ProtectionDomain protectionDomain, byte[] binaryRepresentation) throws IllegalClassFormatException
      Invoked after the transformation is applied.
      Parameters:
      value - The value that was returned before transformation.
      module - The instrumented class's Java module or null if the module system is not supported.
      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.
      Throws:
      IllegalClassFormatException - If the class file was found invalid.